From 62747378ca165f4c43b8447174b01fcd7ef04d00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20SANCHEZ?= Date: Tue, 10 May 2022 13:33:22 +0200 Subject: [PATCH 1/3] feat: allow --validate on sync command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will permit usage of `--validate` options with sync command Signed-off-by: Grégory SANCHEZ --- main.go | 4 ++++ pkg/app/app.go | 1 + pkg/app/config.go | 2 ++ 3 files changed, 7 insertions(+) diff --git a/main.go b/main.go index 112c17c8..1dc3fda3 100644 --- a/main.go +++ b/main.go @@ -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: "validate 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"`, diff --git a/pkg/app/app.go b/pkg/app/app.go index 8d841f63..8d288a60 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -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) }) diff --git a/pkg/app/config.go b/pkg/app/config.go index 99cfc1fa..81350ab4 100644 --- a/pkg/app/config.go +++ b/pkg/app/config.go @@ -85,6 +85,8 @@ type SyncConfigProvider interface { Wait() bool WaitForJobs() bool + Validate() bool + SkipNeeds() bool IncludeNeeds() bool IncludeTransitiveNeeds() bool From 3978767ca796eb7cec69d7d50cfee93393aeda7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20SANCHEZ?= Date: Thu, 12 May 2022 21:14:16 +0200 Subject: [PATCH 2/3] Update main.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Yusuke Kuoka Signed-off-by: Grégory SANCHEZ --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 1dc3fda3..579c6715 100644 --- a/main.go +++ b/main.go @@ -443,7 +443,7 @@ func main() { }, cli.BoolFlag{ Name: "validate", - Usage: "validate 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", + 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", From dec10eb9d94911587e311b32edef9d8f009ac5f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20SANCHEZ?= Date: Tue, 17 May 2022 14:03:32 +0200 Subject: [PATCH 3/3] fix: fix lint error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Grégory SANCHEZ --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 579c6715..2050d0e0 100644 --- a/main.go +++ b/main.go @@ -443,7 +443,7 @@ func main() { }, 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", + 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",