mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 01:40:07 +00:00
Simplify labels for kubecfg run
We created a name=<controller name> label on each object we created. This was confusing. Instead, piggyback on `replicationController` label and use that as the selector.
This commit is contained in:
parent
8bfba149a5
commit
2444e4e1dc
@ -168,7 +168,7 @@ func RunController(image, name string, replicas int, client client.Interface, po
|
|||||||
DesiredState: api.ReplicationControllerState{
|
DesiredState: api.ReplicationControllerState{
|
||||||
Replicas: replicas,
|
Replicas: replicas,
|
||||||
ReplicaSelector: map[string]string{
|
ReplicaSelector: map[string]string{
|
||||||
"name": name,
|
"replicationController": name,
|
||||||
},
|
},
|
||||||
PodTemplate: api.PodTemplate{
|
PodTemplate: api.PodTemplate{
|
||||||
DesiredState: api.PodState{
|
DesiredState: api.PodState{
|
||||||
@ -184,13 +184,10 @@ func RunController(image, name string, replicas int, client client.Interface, po
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Labels: map[string]string{
|
Labels: map[string]string{
|
||||||
"name": name,
|
"replicationController": name,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Labels: map[string]string{
|
|
||||||
"name": name,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
controllerOut, err := client.CreateReplicationController(controller)
|
controllerOut, err := client.CreateReplicationController(controller)
|
||||||
|
Loading…
Reference in New Issue
Block a user