From f7b138ee8f03ace8b89218160421778296b23110 Mon Sep 17 00:00:00 2001 From: Alik Khilazhev <7482065+alikhil@users.noreply.github.com> Date: Mon, 12 May 2025 22:20:59 +0200 Subject: [PATCH] refactor and fix conflicts Signed-off-by: Alik Khilazhev <7482065+alikhil@users.noreply.github.com> --- cmd/helm/helm_test.go | 2 +- pkg/action/dependency.go | 2 +- pkg/action/install.go | 19 +++++++++---------- pkg/cmd/dependency_build.go | 2 +- pkg/cmd/template_test.go | 2 +- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/cmd/helm/helm_test.go b/cmd/helm/helm_test.go index bb4cd8cd1..95d4d1869 100644 --- a/cmd/helm/helm_test.go +++ b/cmd/helm/helm_test.go @@ -26,7 +26,7 @@ import ( func TestPluginExitCode(t *testing.T) { if os.Getenv("RUN_MAIN_FOR_TESTING") == "1" { - + os.Args = []string{"helm", "exitwith", "2"} // We DO call helm's main() here. So this looks like a normal `helm` process. main() diff --git a/pkg/action/dependency.go b/pkg/action/dependency.go index 5dc2b9bcd..1d16bcda9 100644 --- a/pkg/action/dependency.go +++ b/pkg/action/dependency.go @@ -38,7 +38,6 @@ type Dependency struct { Keyring string SkipRefresh bool ColumnWidth uint - BuildOrUpdateRecursive bool Username string Password string CertFile string @@ -46,6 +45,7 @@ type Dependency struct { CaFile string InsecureSkipTLSverify bool PlainHTTP bool + BuildOrUpdateRecursive bool } // NewDependency creates a new Dependency object with the given configuration. diff --git a/pkg/action/install.go b/pkg/action/install.go index 7a454ff90..2884ad72c 100644 --- a/pkg/action/install.go +++ b/pkg/action/install.go @@ -71,21 +71,17 @@ type Install struct { ChartPathOptions - DryRunOption string + ClientOnly bool + Force bool + CreateNamespace bool + DryRun bool + DryRunOption string // HideSecret can be set to true when DryRun is enabled in order to hide // Kubernetes Secrets in the output. It cannot be used outside of DryRun. HideSecret bool - WaitStrategy kube.WaitStrategy - HideNotes bool - SkipSchemaValidation bool - Labels map[string]string - ClientOnly bool - Force bool - CreateNamespace bool - DryRun bool DisableHooks bool Replace bool - Wait bool + WaitStrategy kube.WaitStrategy WaitForJobs bool Devel bool DependencyUpdate bool @@ -100,8 +96,11 @@ type Install struct { Atomic bool SkipCRDs bool SubNotes bool + HideNotes bool + SkipSchemaValidation bool DisableOpenAPIValidation bool IncludeCRDs bool + Labels map[string]string // KubeVersion allows specifying a custom kubernetes version to use and // APIVersions allows a manual set of supported API Versions to be passed // (for things like templating). These are ignored if ClientOnly is false diff --git a/pkg/cmd/dependency_build.go b/pkg/cmd/dependency_build.go index 68a76e0b8..075a26fed 100644 --- a/pkg/cmd/dependency_build.go +++ b/pkg/cmd/dependency_build.go @@ -74,7 +74,7 @@ func newDependencyBuildCmd(out io.Writer) *cobra.Command { if client.Verify { man.Verify = downloader.VerifyIfPossible } - err := man.Build(client.BuildOrUpdateRecursive) + err = man.Build(client.BuildOrUpdateRecursive) if e, ok := err.(downloader.ErrRepoNotFound); ok { return fmt.Errorf("%s. Please add the missing repos via 'helm repo add'", e.Error()) } diff --git a/pkg/cmd/template_test.go b/pkg/cmd/template_test.go index 68faa70b2..b1a3f2ab9 100644 --- a/pkg/cmd/template_test.go +++ b/pkg/cmd/template_test.go @@ -147,7 +147,7 @@ func TestTemplateCmd(t *testing.T) { }, { name: "template with dependency update recursive", - preCmd: func(t *testing.T) error { + preCmd: func(_ *testing.T) error { // We must reset the chart's dependency to actually // exercise the ability to provision missing nested depencendies. // If we don't do this, the chart will contain the `tgz` files from previous runs