MCPcopy Index your code
hub / github.com/apecloud/kubeblocks / AddLabelsInMap

Method AddLabelsInMap

pkg/controller/builder/builder_base.go:67–80  ·  view source on GitHub ↗
(labels map[string]string)

Source from the content-addressed store, hash-verified

65}
66
67func (builder *BaseBuilder[T, PT, B]) AddLabelsInMap(labels map[string]string) *B {
68 if len(labels) == 0 {
69 return builder.concreteBuilder
70 }
71 l := builder.object.GetLabels()
72 if l == nil {
73 l = make(map[string]string, 0)
74 }
75 for k, v := range labels {
76 l[k] = v
77 }
78 builder.object.SetLabels(l)
79 return builder.concreteBuilder
80}
81
82func (builder *BaseBuilder[T, PT, B]) AddAnnotations(keysAndValues ...string) *B {
83 builder.AddAnnotationsInMap(WithMap(keysAndValues...))

Callers 13

AddLabelsMethod · 0.95
BuildInstanceSetFunction · 0.45
getTemplateFunction · 0.45
BuildServiceAccountFunction · 0.45
BuildRoleBindingFunction · 0.45
BuildRoleFunction · 0.45
BuildComponentFunction · 0.45
buildHeadlessSvcFunction · 0.45
buildInstanceByTemplateFunction · 0.45

Calls 1

SetLabelsMethod · 0.45

Tested by

no test coverage detected