MCPcopy
hub / github.com/helm/helm / newConfigMapsObject

Function newConfigMapsObject

pkg/storage/driver/cfgmaps.go:258–288  ·  view source on GitHub ↗

newConfigMapsObject constructs a kubernetes ConfigMap object to store a release. Each configmap data entry is the base64 encoded gzipped string of a release. The following labels are used within each configmap: "modifiedAt" - timestamp indicating when this configmap was last modified. (set in

(key string, rls *rspb.Release, lbs labels)

Source from the content-addressed store, hash-verified

256// "owner" - owner of the configmap, currently "helm".
257// "name" - name of the release.
258func newConfigMapsObject(key string, rls *rspb.Release, lbs labels) (*v1.ConfigMap, error) {
259 const owner = "helm"
260
261 // encode the release
262 s, err := encodeRelease(rls)
263 if err != nil {
264 return nil, err
265 }
266
267 if lbs == nil {
268 lbs.init()
269 }
270
271 // apply custom labels
272 lbs.fromMap(rls.Labels)
273
274 // apply labels
275 lbs.set("name", rls.Name)
276 lbs.set("owner", owner)
277 lbs.set("status", rls.Info.Status.String())
278 lbs.set("version", strconv.Itoa(rls.Version))
279
280 // create and return configmap object
281 return &v1.ConfigMap{
282 ObjectMeta: metav1.ObjectMeta{
283 Name: key,
284 Labels: lbs.toMap(),
285 },
286 Data: map[string]string{"release": s},
287 }, nil
288}

Callers 4

CreateMethod · 0.85
UpdateMethod · 0.85
InitMethod · 0.85

Calls 6

encodeReleaseFunction · 0.85
fromMapMethod · 0.80
setMethod · 0.80
toMapMethod · 0.80
initMethod · 0.45
StringMethod · 0.45

Tested by 2

InitMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…