Skip to content

Commit

Permalink
Merge pull request #551 from Praqma/fix-550
Browse files Browse the repository at this point in the history
Initialize namespaces defined without any properties on init
  • Loading branch information
luisdavim authored Nov 24, 2020
2 parents f24f838 + e0c19ae commit bb26bb1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/app/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ func (c *cli) readState(s *state) {
}

s.setDefaults()
s.initializeNamespaces()
s.disableUntargetedApps(c.group, c.target)

if len(c.target) > 0 && len(s.TargetMap) == 0 {
Expand Down
8 changes: 8 additions & 0 deletions internal/app/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ func (s *state) setDefaults() {
}
}

func (s *state) initializeNamespaces() {
for nsName, ns := range s.Namespaces {
if ns == nil {
s.Namespaces[nsName] = &namespace{}
}
}
}

// validate validates that the values specified in the desired state are valid according to the desired state spec.
// check https://github.com/Praqma/helmsman/blob/master/docs/desired_state_specification.md for the detailed specification
func (s *state) validate() error {
Expand Down

0 comments on commit bb26bb1

Please sign in to comment.