Skip to content

Commit

Permalink
fix config defaults logic
Browse files Browse the repository at this point in the history
Signed-off-by: chrismark <chrismarkou92@gmail.com>
  • Loading branch information
ChrsMark committed Jul 21, 2021
1 parent 88260fd commit 2823bb6
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ func (c *Config) InitDefaults() {
c.CleanupTimeout = 60 * time.Second
c.SyncPeriod = 10 * time.Minute
c.Scope = "node"
c.Resources.Pod = Enabled{true}
c.Resources.Node = Enabled{true}
c.Resources.Service = Enabled{true}
c.LabelsDedot = true
c.AnnotationsDedot = true
}
Expand All @@ -63,5 +60,10 @@ func (c *Config) Validate() error {
c.Scope = "cluster"
}

if !c.Resources.Pod.Enabled && !c.Resources.Node.Enabled && !c.Resources.Service.Enabled {
c.Resources.Pod = Enabled{true}
c.Resources.Node = Enabled{true}
}

return nil
}

0 comments on commit 2823bb6

Please sign in to comment.