chore(label): new label "values-from"
This labels allow to use some environment variables from another service and use the configMap / secret instead of the original value. This is useful to avoid duplication of values for several variables.
This commit is contained in:
13
generator/labels/labelStructs/valueFrom.go
Normal file
13
generator/labels/labelStructs/valueFrom.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package labelStructs
|
||||
|
||||
import "gopkg.in/yaml.v3"
|
||||
|
||||
type ValueFrom map[string]string
|
||||
|
||||
func GetValueFrom(data string) (*ValueFrom, error) {
|
||||
vf := ValueFrom{}
|
||||
if err := yaml.Unmarshal([]byte(data), &vf); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &vf, nil
|
||||
}
|
Reference in New Issue
Block a user