MCPcopy
hub / github.com/operator-framework/operator-sdk / Build

Method Build

internal/helm/client/client.go:121–149  ·  view source on GitHub ↗
(reader io.Reader, validate bool)

Source from the content-addressed store, hash-verified

119}
120
121func (c *labelInjectingClient) Build(reader io.Reader, validate bool) (kube.ResourceList, error) {
122 resourceList, err := c.Interface.Build(reader, validate)
123 if err != nil {
124 return resourceList, err
125 }
126 err = resourceList.Visit(func(r *resource.Info, err error) error {
127 if err != nil {
128 return err
129 }
130 objMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r.Object)
131 if err != nil {
132 return err
133 }
134 u := &unstructured.Unstructured{Object: objMap}
135 labels := u.GetLabels()
136 if labels == nil {
137 labels = map[string]string{}
138 }
139 for k, v := range c.labels {
140 labels[k] = v
141 }
142 u.SetLabels(labels)
143 return nil
144 })
145 if err != nil {
146 return nil, err
147 }
148 return resourceList, nil
149}

Callers 11

BuildMethod · 0.45
reconcileReleaseFunction · 0.45
CleanupReleaseMethod · 0.45
fetchChartDependenciesFunction · 0.45
client_test.goFile · 0.45
configmap_test.goFile · 0.45
newFakeClientFunction · 0.45
newFakeClientFunction · 0.45
configmap_test.goFile · 0.45
registry_test.goFile · 0.45

Calls

no outgoing calls

Tested by 2

newFakeClientFunction · 0.36
newFakeClientFunction · 0.36