@@ -61,17 +61,19 @@ type FileV2 struct {
61
61
// Hooks is a set of scripts to be run before or after the release is installed.
62
62
Hooks Hooks `yaml:"hooks,omitempty" json:"hooks,omitempty"`
63
63
// NamespaceMgmt contains the default namespace config for all namespaces managed by this course.
64
- NamespaceMgmt struct {
65
- // Default is the default namespace config for this course
66
- Default * NamespaceConfig `yaml:"default" json:"default"`
67
- } `yaml:"namespace_management,omitempty" json:"namespace_management,omitempty"`
68
- Secrets SecretsList `yaml:"secrets,omitempty" json:"secrets,omitempty"`
64
+ NamespaceMgmt NamespaceMgmt `yaml:"namespace_management,omitempty" json:"namespace_management,omitempty"`
65
+ Secrets SecretsList `yaml:"secrets,omitempty" json:"secrets,omitempty"`
69
66
// Releases is the list of releases that should be maintained by this course file.
70
67
Releases []* Release `yaml:"releases,omitempty" json:"releases,omitempty"`
71
68
// HelmArgs is a list of arguments to pass to helm commands
72
69
HelmArgs []string `yaml:"helm_args,omitempty" json:"helm_args,omitempty"`
73
70
}
74
71
72
+ type NamespaceMgmt struct {
73
+ // Default is the default namespace config for this course
74
+ Default * NamespaceConfig `yaml:"default" json:"default"`
75
+ }
76
+
75
77
// FileV2Unmarshal is a helper type that allows us to have a custom unmarshal function for the FileV2 struct
76
78
type FileV2Unmarshal FileV2
77
79
@@ -95,14 +97,18 @@ type Hooks struct {
95
97
96
98
// NamespaceConfig allows setting namespace annotations and labels
97
99
type NamespaceConfig struct {
98
- Metadata struct {
99
- Annotations map [string ]string `yaml:"annotations,omitempty" json:"annotations,omitempty"`
100
- Labels map [string ]string `yaml:"labels,omitempty" json:"labels,omitempty"`
101
- } `yaml:"metadata,omitempty" json:"metadata,omitempty"`
102
- Settings struct {
103
- // Overwrite specifies if these annotations and labels should be overwritten in the event that they already exist.
104
- Overwrite * bool `yaml:"overwrite,omitempty" json:"overwrite,omitempty"`
105
- } `yaml:"settings" json:"settings"`
100
+ Metadata NSMetadata `yaml:"metadata,omitempty" json:"metadata,omitempty"`
101
+ Settings NSSettings `yaml:"settings" json:"settings"`
102
+ }
103
+
104
+ type NSMetadata struct {
105
+ Annotations map [string ]string `yaml:"annotations,omitempty" json:"annotations,omitempty"`
106
+ Labels map [string ]string `yaml:"labels,omitempty" json:"labels,omitempty"`
107
+ }
108
+
109
+ type NSSettings struct {
110
+ // Overwrite specifies if these annotations and labels should be overwritten in the event that they already exist.
111
+ Overwrite * bool `yaml:"overwrite,omitempty" json:"overwrite,omitempty"`
106
112
}
107
113
108
114
// Release represents a helm release and all of its configuration
@@ -435,6 +441,15 @@ func decodeYamlWithEnv(value *yaml.Node) error {
435
441
if v .Kind == yaml .SequenceNode {
436
442
for i := range v .Content {
437
443
var err error
444
+
445
+ if v .Content [i ].Kind != yaml .ScalarNode {
446
+ err := decodeYamlWithEnv (v .Content [i ])
447
+ if err != nil {
448
+ return err
449
+ }
450
+ continue
451
+ }
452
+
438
453
v .Content [i ].Value , err = parseEnv (v .Content [i ].Value )
439
454
if err != nil {
440
455
return err
0 commit comments