Skip to content

Commit

Permalink
Merge pull request helmfile#88 from chubchubsancho/validate_manifest_…
Browse files Browse the repository at this point in the history
…on_sync

feat: allow --validate on sync command
  • Loading branch information
itscaro authored May 30, 2022
2 parents f16001e + dec10eb commit 0cfef76
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,10 @@ func main() {
Name: "include-transitive-needs",
Usage: `like --include-needs, but also includes transitive needs (needs of needs). Does nothing when when --selector/-l flag is not provided. Overrides exclusions of other selectors and conditions.`,
},
cli.BoolFlag{
Name: "validate",
Usage: `ADVANCED CONFIGURATION: When sync is going to involve helm-template as a part of the "chartify" process, it might fail due to missing .Capabilities. This flag makes instructs helmfile to pass --validate to helm-template so it populates .Capabilities and validates your manifests against the Kubernetes cluster you are currently pointing at. Note that this requiers access to a Kubernetes cluster to obtain information necessary for validating, like the list of available API versions`,
},
cli.BoolFlag{
Name: "wait",
Usage: `Override helmDefaults.wait setting "helm upgrade --install --wait"`,
Expand Down
1 change: 1 addition & 0 deletions pkg/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ func (a *App) Sync(c SyncConfigProvider) error {
WaitForJobs: c.WaitForJobs(),
IncludeCRDs: &includeCRDs,
IncludeTransitiveNeeds: c.IncludeTransitiveNeeds(),
Validate: c.Validate(),
}, func() {
ok, errs = a.sync(run, c)
})
Expand Down
2 changes: 2 additions & 0 deletions pkg/app/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ type SyncConfigProvider interface {
Wait() bool
WaitForJobs() bool

Validate() bool

SkipNeeds() bool
IncludeNeeds() bool
IncludeTransitiveNeeds() bool
Expand Down

0 comments on commit 0cfef76

Please sign in to comment.