Skip to content

Support setting and getting maps from Helm values

Summary

Relevant thread: https://gitlab.com/gitlab-org/gl-openshift/gitlab-operator/-/merge_requests/134#note_567459990

We currently have GetValue and SetValue methods that support retrieving a value from a key in dot-notation format.

It would be helpful to have methods that support getting and setting maps as well. For example: configuring a set of key/value pairs as annotations on an object:

Example signature for set:

SetMapValue(key string, value interface{}) error

Example implementation:

annotations := map[string]string{
  key1: value1,
  key2: value2,
}

err := values.SetmapValue("global.ingress.annotations", annotations)

Acceptance criteria

  • Able to set and get maps in the Helm values