- Sort Score
- Result 10 results
- Languages All
Results 1 - 6 of 6 for CloneAndAddLabel (0.51 sec)
-
pkg/util/labels/labels.go
package labels import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Clones the given map and returns a new map with the given key and value added. // Returns the given map, if labelKey is empty. func CloneAndAddLabel(labels map[string]string, labelKey, labelValue string) map[string]string { if labelKey == "" { // Don't need to add a label. return labels } // Clone. newLabels := map[string]string{}
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Jan 11 17:34:12 UTC 2017 - 3.7K bytes - Viewed (0) -
pkg/util/labels/labels_test.go
labelValue: "42", want: map[string]string{ "foo1": "bar1", "foo2": "bar2", "foo3": "bar3", "foo4": "42", }, }, } for _, tc := range cases { got := CloneAndAddLabel(tc.labels, tc.labelKey, tc.labelValue) if !reflect.DeepEqual(got, tc.want) { t.Errorf("[Add] got %v, want %v", got, tc.want) } // now test the inverse. got_rm := CloneAndRemoveLabel(got, tc.labelKey)
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Jan 11 17:34:12 UTC 2017 - 4.1K bytes - Viewed (0) -
pkg/controller/deployment/sync.go
// new ReplicaSet does not exist, create one. newRSTemplate := *d.Spec.Template.DeepCopy() podTemplateSpecHash := controller.ComputeHash(&newRSTemplate, d.Status.CollisionCount) newRSTemplate.Labels = labelsutil.CloneAndAddLabel(d.Spec.Template.Labels, apps.DefaultDeploymentUniqueLabelKey, podTemplateSpecHash) // Add podTemplateHash label to selector.
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Jul 05 23:39:52 UTC 2023 - 24.5K bytes - Viewed (0) -
pkg/controller/daemon/update.go
name := ds.Name + "-" + hash history := &apps.ControllerRevision{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: ds.Namespace, Labels: labelsutil.CloneAndAddLabel(ds.Spec.Template.Labels, apps.DefaultDaemonSetUniqueLabelKey, hash), Annotations: ds.Annotations, OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(ds, controllerKind)}, },
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon May 13 16:53:53 UTC 2024 - 24.4K bytes - Viewed (0) -
pkg/controller/endpoint/endpoints_controller.go
} if newEndpoints.Labels == nil { newEndpoints.Labels = make(map[string]string) } if !helper.IsServiceIPSet(service) { newEndpoints.Labels = utillabels.CloneAndAddLabel(newEndpoints.Labels, v1.IsHeadlessService, "") } else { newEndpoints.Labels = utillabels.CloneAndRemoveLabel(newEndpoints.Labels, v1.IsHeadlessService) }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sat May 04 18:33:12 UTC 2024 - 26.3K bytes - Viewed (0) -
pkg/controller/daemon/daemon_controller_test.go
// Copy pod spec from DaemonSet template, or use a default one if DaemonSet is nil if ds != nil { hash := controller.ComputeHash(&ds.Spec.Template, ds.Status.CollisionCount) newLabels = labelsutil.CloneAndAddLabel(label, apps.DefaultDaemonSetUniqueLabelKey, hash) podSpec = ds.Spec.Template.Spec } else { podSpec = v1.PodSpec{ Containers: []v1.Container{ { Image: "foo/bar",
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sat May 04 18:33:12 UTC 2024 - 111.4K bytes - Viewed (0)