Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package werf for openSUSE:Factory checked in at 2025-05-26 18:32:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/werf (Old) and /work/SRC/openSUSE:Factory/.werf.new.2732 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "werf" Mon May 26 18:32:43 2025 rev:53 rq:1279547 version:2.36.3 Changes: -------- --- /work/SRC/openSUSE:Factory/werf/werf.changes 2025-05-20 17:05:00.599801776 +0200 +++ /work/SRC/openSUSE:Factory/.werf.new.2732/werf.changes 2025-05-26 18:34:01.935624529 +0200 @@ -1,0 +2,20 @@ +Fri May 23 12:18:24 UTC 2025 - Johannes Kastl <opensuse_buildserv...@ojkastl.de> + +- Update to version 2.36.3: + * Bug Fixes + - deploy: improve values handling and add more trace logging; + undo many reverts (6bdca4a) + +------------------------------------------------------------------- +Fri May 23 04:56:48 UTC 2025 - Johannes Kastl <opensuse_buildserv...@ojkastl.de> + +- Update to version 2.36.2: + * Bug Fixes + - build, stapel: fix service git apply patch failed (#6871) + (31d3b88) + - deploy: wrong values rendered (many reverts) (1fc5833) + - giterminism: fix error in case of using invalid git worktree + (#6867) (48596ae) + - stapel: fix git apply patch error handling (81314a8) + +------------------------------------------------------------------- Old: ---- werf-2.36.1.obscpio New: ---- werf-2.36.3.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ werf.spec ++++++ --- /var/tmp/diff_new_pack.wuW7hw/_old 2025-05-26 18:34:02.915665619 +0200 +++ /var/tmp/diff_new_pack.wuW7hw/_new 2025-05-26 18:34:02.919665787 +0200 @@ -17,7 +17,7 @@ Name: werf -Version: 2.36.1 +Version: 2.36.3 Release: 0 Summary: CLI for the Werf CI/CD system License: Apache-2.0 ++++++ _service ++++++ --- /var/tmp/diff_new_pack.wuW7hw/_old 2025-05-26 18:34:02.955667296 +0200 +++ /var/tmp/diff_new_pack.wuW7hw/_new 2025-05-26 18:34:02.975668135 +0200 @@ -3,7 +3,7 @@ <param name="url">https://github.com/werf/werf</param> <param name="scm">git</param> <param name="exclude">.git</param> - <param name="revision">v2.36.1</param> + <param name="revision">v2.36.3</param> <param name="versionformat">@PARENT_TAG@</param> <param name="versionrewrite-pattern">v(.*)</param> <param name="changesgenerate">enable</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.wuW7hw/_old 2025-05-26 18:34:03.003669309 +0200 +++ /var/tmp/diff_new_pack.wuW7hw/_new 2025-05-26 18:34:03.007669477 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/werf/werf</param> - <param name="changesrevision">2e477824bd5c00e252c6417f8bc4cf12880dfc72</param></service></servicedata> + <param name="changesrevision">1751c1df12e737493462d88a9ed12fa6115e4c13</param></service></servicedata> (No newline at EOF) ++++++ vendor.tar.gz ++++++ /work/SRC/openSUSE:Factory/werf/vendor.tar.gz /work/SRC/openSUSE:Factory/.werf.new.2732/vendor.tar.gz differ: char 143, line 1 ++++++ werf-2.36.1.obscpio -> werf-2.36.3.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/CHANGELOG.md new/werf-2.36.3/CHANGELOG.md --- old/werf-2.36.1/CHANGELOG.md 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/CHANGELOG.md 2025-05-23 13:02:03.000000000 +0200 @@ -1,5 +1,22 @@ # Changelog +### [2.36.3](https://www.github.com/werf/werf/compare/v2.36.2...v2.36.3) (2025-05-23) + + +### Bug Fixes + +* **deploy:** improve values handling and add more trace logging; undo many reverts ([6bdca4a](https://www.github.com/werf/werf/commit/6bdca4a4b15cbc9590865d982d6ef03ff0ec6cd2)) + +### [2.36.2](https://www.github.com/werf/werf/compare/v2.36.1...v2.36.2) (2025-05-22) + + +### Bug Fixes + +* **build, stapel:** fix service git apply patch failed ([#6871](https://www.github.com/werf/werf/issues/6871)) ([31d3b88](https://www.github.com/werf/werf/commit/31d3b88f45b6b1e770396d167d7033e47143e95d)) +* **deploy:** wrong values rendered (many reverts) ([1fc5833](https://www.github.com/werf/werf/commit/1fc583348d7a90769531fc2fece00919b6b85314)) +* **giterminism:** fix error in case of using invalid git worktree ([#6867](https://www.github.com/werf/werf/issues/6867)) ([48596ae](https://www.github.com/werf/werf/commit/48596ae69112a564edd4b84086c3e5ce2cd82ea8)) +* **stapel:** fix git apply patch error handling ([81314a8](https://www.github.com/werf/werf/commit/81314a8189cb07a622f7ef3c030a1ff1b3c75b77)) + ### [2.36.1](https://www.github.com/werf/werf/compare/v2.36.0...v2.36.1) (2025-05-19) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/cmd/werf/bundle/apply/apply.go new/werf-2.36.3/cmd/werf/bundle/apply/apply.go --- old/werf-2.36.1/cmd/werf/bundle/apply/apply.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/cmd/werf/bundle/apply/apply.go 2025-05-23 13:02:03.000000000 +0200 @@ -15,10 +15,7 @@ "github.com/samber/lo" "github.com/spf13/cobra" - "github.com/werf/3p-helm/pkg/chart" - "github.com/werf/3p-helm/pkg/chartutil" - "github.com/werf/3p-helm/pkg/werf/secrets" - "github.com/werf/common-go/pkg/secrets_manager" + "github.com/werf/3p-helm/pkg/werf/helmopts" "github.com/werf/common-go/pkg/util" "github.com/werf/nelm/pkg/action" "github.com/werf/werf/v2/cmd/werf/common" @@ -182,9 +179,7 @@ registryCredentialsPath := docker.GetDockerConfigCredentialsFile(*commonCmdData.DockerConfig) - secrets.CoalesceTablesFunc = chartutil.CoalesceTables - secrets_manager.DisableSecretsDecryption = *commonCmdData.IgnoreSecretKey - chartutil.ServiceValues, err = helpers.GetBundleServiceValues(ctx, helpers.ServiceValuesOptions{ + serviceValues, err := helpers.GetBundleServiceValues(ctx, helpers.ServiceValuesOptions{ Env: *commonCmdData.Environment, Namespace: releaseNamespace, SetDockerConfigJsonValue: *commonCmdData.SetDockerConfigJsonValue, @@ -198,9 +193,18 @@ if err != nil { return fmt.Errorf("get current working directory: %w", err) } - secrets.SecretsWorkingDir = secretWorkDir - if err := bundles.Pull(ctx, fmt.Sprintf("%s:%s", repoAddress, cmdData.Tag), bundlePath, bundlesRegistryClient); err != nil { + if err := bundles.Pull(ctx, fmt.Sprintf("%s:%s", repoAddress, cmdData.Tag), bundlePath, bundlesRegistryClient, helmopts.HelmOptions{ + ChartLoadOpts: helmopts.ChartLoadOptions{ + ChartDir: bundlePath, + NoDecryptSecrets: *commonCmdData.IgnoreSecretKey, + NoDefaultSecretValues: *commonCmdData.DisableDefaultSecretValues, + NoDefaultValues: *commonCmdData.DisableDefaultValues, + SecretValuesFiles: common.GetSecretValues(&commonCmdData), + SecretsWorkingDir: secretWorkDir, + ExtraValues: serviceValues, + }, + }); err != nil { return fmt.Errorf("pull bundle: %w", err) } @@ -214,8 +218,6 @@ return fmt.Errorf("get release labels: %w", err) } - chart.CurrentChartType = chart.ChartTypeBundle - ctx = action.SetupLogging(ctx, cmp.Or(common.GetNelmLogLevel(&commonCmdData), action.DefaultReleaseInstallLogLevel), action.SetupLoggingOptions{ ColorMode: *commonCmdData.LogColorMode, }) @@ -243,6 +245,8 @@ KubeSkipTLSVerify: *commonCmdData.SkipTlsVerifyKube, KubeTLSServerName: *commonCmdData.KubeTlsServer, KubeToken: *commonCmdData.KubeToken, + LegacyChartType: helmopts.ChartTypeBundle, + LegacyExtraValues: serviceValues, LogRegistryStreamOut: os.Stdout, NetworkParallelism: common.GetNetworkParallelism(&commonCmdData), NoInstallCRDs: *commonCmdData.NoInstallCRDs, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/cmd/werf/bundle/copy/copy.go new/werf-2.36.3/cmd/werf/bundle/copy/copy.go --- old/werf-2.36.1/cmd/werf/bundle/copy/copy.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/cmd/werf/bundle/copy/copy.go 2025-05-23 13:02:03.000000000 +0200 @@ -8,10 +8,7 @@ "github.com/spf13/cobra" helm_v3 "github.com/werf/3p-helm/cmd/helm" - "github.com/werf/3p-helm/pkg/chart" - "github.com/werf/3p-helm/pkg/chartutil" - "github.com/werf/3p-helm/pkg/werf/secrets" - "github.com/werf/common-go/pkg/secrets_manager" + "github.com/werf/3p-helm/pkg/werf/helmopts" "github.com/werf/logboek" "github.com/werf/werf/v2/cmd/werf/common" "github.com/werf/werf/v2/pkg/deploy/bundles" @@ -133,17 +130,6 @@ return fmt.Errorf("incompatible options specified, could not use --helm-compatible-chart and --rename-chart=%q at the same time", *commonCmdData.RenameChart) } - secrets.CoalesceTablesFunc = chartutil.CoalesceTables - secrets_manager.DisableSecretsDecryption = true - - secretWorkDir, err := os.Getwd() - if err != nil { - return fmt.Errorf("get current working directory: %w", err) - } - secrets.SecretsWorkingDir = secretWorkDir - - chart.CurrentChartType = chart.ChartTypeBundle - return logboek.Context(ctx).LogProcess("Copy bundle").DoError(func() error { logboek.Context(ctx).LogFDetails("From: %s\n", fromAddr.String()) logboek.Context(ctx).LogFDetails("To: %s\n", toAddr.String()) @@ -154,6 +140,12 @@ ToRegistryClient: toRegistry, HelmCompatibleChart: *commonCmdData.HelmCompatibleChart, RenameChart: *commonCmdData.RenameChart, + HelmOptions: helmopts.HelmOptions{ + ChartLoadOpts: helmopts.ChartLoadOptions{ + ChartType: helmopts.ChartTypeBundle, + NoSecrets: true, + }, + }, }) }) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/cmd/werf/bundle/publish/publish.go new/werf-2.36.3/cmd/werf/bundle/publish/publish.go --- old/werf-2.36.1/cmd/werf/bundle/publish/publish.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/cmd/werf/bundle/publish/publish.go 2025-05-23 13:02:03.000000000 +0200 @@ -23,7 +23,8 @@ "github.com/werf/3p-helm/pkg/cli/values" "github.com/werf/3p-helm/pkg/downloader" "github.com/werf/3p-helm/pkg/getter" - "github.com/werf/3p-helm/pkg/werf/chartextender" + "github.com/werf/3p-helm/pkg/werf/file" + "github.com/werf/3p-helm/pkg/werf/helmopts" "github.com/werf/3p-helm/pkg/werf/secrets" "github.com/werf/3p-helm/pkg/werf/secrets/runtimedata" "github.com/werf/common-go/pkg/secrets_manager" @@ -331,7 +332,7 @@ return err } - loader.ChartFileReader = giterminismManager.FileReader() + file.ChartFileReader = giterminismManager.FileReader() headHash, err := giterminismManager.LocalGitRepo().HeadCommitHash(ctx) if err != nil { @@ -343,7 +344,7 @@ return fmt.Errorf("getting HEAD commit time failed: %w", err) } - chartutil.ServiceValues, err = helpers.GetServiceValues(ctx, werfConfig.Meta.Project, imagesRepo, imagesInfoGetters, helpers.ServiceValuesOptions{ + serviceValues, err := helpers.GetServiceValues(ctx, werfConfig.Meta.Project, imagesRepo, imagesInfoGetters, helpers.ServiceValuesOptions{ Env: *commonCmdData.Environment, CommitHash: headHash, CommitDate: headTime, @@ -354,17 +355,6 @@ helm_v3.Settings.Debug = *commonCmdData.LogDebug - loader.WithoutDefaultSecretValues = *commonCmdData.DisableDefaultSecretValues - loader.WithoutDefaultValues = *commonCmdData.DisableDefaultValues - secrets.CoalesceTablesFunc = chartutil.CoalesceTables - secrets.SecretsWorkingDir = giterminismManager.ProjectDir() - secrets_manager.DisableSecretsDecryption = *commonCmdData.IgnoreSecretKey - - chartextender.DefaultChartAPIVersion = chart.APIVersionV2 - chartextender.DefaultChartName = werfConfig.Meta.Project - chartextender.DefaultChartVersion = "1.0.0" - chartextender.ChartAppVersion = common.GetHelmChartConfigAppVersion(werfConfig) - // FIXME(1.3): compatibility mode with older 1.2 versions, which do not require WERF_SECRET_KEY in the 'werf bundle publish' command if err := secrets_manager.Manager.AllowMissedSecretKeyMode(giterminismManager.ProjectDir()); err != nil { return err @@ -379,23 +369,35 @@ bundleTmpDir := filepath.Join(werf.GetServiceDir(), "tmp", "bundles", uuid.NewString()) defer os.RemoveAll(bundleTmpDir) - downloader := &downloader.Manager{ - Out: logboek.Context(ctx).OutStream(), - ChartPath: bundleTmpDir, - AllowMissingRepos: true, - Getters: getter.All(helm_v3.Settings), - RegistryClient: helmRegistryClient, - RepositoryConfig: helm_v3.Settings.RepositoryConfig, - RepositoryCache: helm_v3.Settings.RepositoryCache, - Debug: helm_v3.Settings.Debug, + opts := helmopts.HelmOptions{ + ChartLoadOpts: helmopts.ChartLoadOptions{ + ChartAppVersion: common.GetHelmChartConfigAppVersion(werfConfig), + ChartDir: bundleTmpDir, + DefaultChartAPIVersion: chart.APIVersionV2, + DefaultChartName: werfConfig.Meta.Project, + DefaultChartVersion: "1.0.0", + DepDownloader: &downloader.Manager{ + Out: logboek.Context(ctx).OutStream(), + ChartPath: bundleTmpDir, + AllowMissingRepos: true, + Getters: getter.All(helm_v3.Settings), + RegistryClient: helmRegistryClient, + RepositoryConfig: helm_v3.Settings.RepositoryConfig, + RepositoryCache: helm_v3.Settings.RepositoryCache, + Debug: helm_v3.Settings.Debug, + }, + NoDecryptSecrets: *commonCmdData.IgnoreSecretKey, + NoDefaultSecretValues: *commonCmdData.DisableDefaultSecretValues, + NoDefaultValues: *commonCmdData.DisableDefaultValues, + SecretValuesFiles: common.GetSecretValues(&commonCmdData), + SecretsWorkingDir: giterminismManager.ProjectDir(), + ExtraValues: serviceValues, + }, } - loader.SetChartPathFunc = downloader.SetChartPath - loader.DepsBuildFunc = downloader.Build - - loader.SetServiceDir(werf.GetServiceDir()) if err = createNewBundle( ctx, + serviceValues, extraAnnotations, serviceAnnotations, extraLabels, @@ -409,6 +411,7 @@ Values: common.GetSet(&commonCmdData), FileValues: common.GetSetFile(&commonCmdData), }, + opts, ); err != nil { return fmt.Errorf("create bundle: %w", err) } @@ -420,16 +423,18 @@ bundleRepo = stagesStorage.Address() } - chart.CurrentChartType = chart.ChartTypeBundle + opts.ChartLoadOpts.ChartType = helmopts.ChartTypeBundle return bundles.Publish(ctx, bundleTmpDir, fmt.Sprintf("%s:%s", bundleRepo, cmdData.Tag), bundlesRegistryClient, bundles.PublishOptions{ HelmCompatibleChart: *commonCmdData.HelmCompatibleChart, RenameChart: *commonCmdData.RenameChart, + HelmOptions: opts, }) } func createNewBundle( ctx context.Context, + serviceValues map[string]interface{}, extraAnnotations map[string]string, serviceAnnotations map[string]string, extraLabels map[string]string, @@ -438,9 +443,10 @@ destDir string, chartVersion string, vals *values.Options, + opts helmopts.HelmOptions, ) error { chartPath := filepath.Join(projectDir, chartDir) - chrt, err := loader.LoadDir(chartPath) + chrt, err := loader.LoadDir(chartPath, opts) if err != nil { return fmt.Errorf("error loading chart %q: %w", chartPath, err) } @@ -448,12 +454,12 @@ var valsData []byte { p := getter.All(helm_v3.Settings) - vals, err := vals.MergeValues(p) + vals, err := vals.MergeValues(p, opts) if err != nil { return fmt.Errorf("unable to merge input values: %w", err) } - bundleVals, err := makeBundleValues(chrt, vals) + bundleVals, err := makeBundleValues(chrt, vals, serviceValues) if err != nil { return fmt.Errorf("unable to construct bundle values: %w", err) } @@ -466,7 +472,7 @@ var secretValsData []byte if chrt.SecretsRuntimeData != nil && !secrets_manager.Manager.IsMissedSecretKeyModeEnabled() { - vals, err := makeBundleSecretValues(ctx, chrt.SecretsRuntimeData) + vals, err := makeBundleSecretValues(ctx, chrt.SecretsRuntimeData, opts) if err != nil { return fmt.Errorf("unable to construct bundle secret values: %w", err) } @@ -481,7 +487,7 @@ destDir = chrt.Metadata.Name } - secrets.ChartDir = destDir + opts.ChartLoadOpts.ChartDir = destDir if err := os.RemoveAll(destDir); err != nil { return fmt.Errorf("unable to remove %q: %w", destDir, err) @@ -642,10 +648,9 @@ func makeBundleValues( chrt *chart.Chart, inputVals map[string]interface{}, + serviceValues map[string]interface{}, ) (map[string]interface{}, error) { - chartutil.DebugPrintValues(context.Background(), "input", inputVals) - - vals, err := chartutil.MergeInternal(context.Background(), inputVals, chartutil.ServiceValues, nil) + vals, err := chartutil.MergeInternal(context.Background(), inputVals, serviceValues, nil) if err != nil { return nil, fmt.Errorf("failed to coalesce werf chart values: %w", err) } @@ -663,17 +668,13 @@ chartutil.CoalesceChartValues(chrt, valsCopy, true) - chartutil.DebugPrintValues(context.Background(), "all", valsCopy) - return valsCopy, nil } func makeBundleSecretValues( ctx context.Context, secretsRuntimeData runtimedata.RuntimeData, + opts helmopts.HelmOptions, ) (map[string]interface{}, error) { - if chartutil.DebugSecretValues() { - chartutil.DebugPrintValues(context.Background(), "secret", secretsRuntimeData.GetDecryptedSecretValues()) - } - return secretsRuntimeData.GetEncodedSecretValues(ctx, secrets_manager.Manager, false) + return secretsRuntimeData.GetEncodedSecretValues(ctx, secrets_manager.Manager, opts.ChartLoadOpts.SecretsWorkingDir, opts.ChartLoadOpts.NoDecryptSecrets) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/cmd/werf/bundle/render/render.go new/werf-2.36.3/cmd/werf/bundle/render/render.go --- old/werf-2.36.1/cmd/werf/bundle/render/render.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/cmd/werf/bundle/render/render.go 2025-05-23 13:02:03.000000000 +0200 @@ -14,10 +14,7 @@ "github.com/samber/lo" "github.com/spf13/cobra" - "github.com/werf/3p-helm/pkg/chart" - "github.com/werf/3p-helm/pkg/chartutil" - "github.com/werf/3p-helm/pkg/werf/secrets" - "github.com/werf/common-go/pkg/secrets_manager" + "github.com/werf/3p-helm/pkg/werf/helmopts" "github.com/werf/common-go/pkg/util" "github.com/werf/nelm/pkg/action" "github.com/werf/werf/v2/cmd/werf/common" @@ -166,9 +163,7 @@ releaseName := common.GetOptionalRelease(&commonCmdData) registryCredentialsPath := docker.GetDockerConfigCredentialsFile(*commonCmdData.DockerConfig) - secrets.CoalesceTablesFunc = chartutil.CoalesceTables - secrets_manager.DisableSecretsDecryption = *commonCmdData.IgnoreSecretKey - chartutil.ServiceValues, err = helpers.GetBundleServiceValues(ctx, helpers.ServiceValuesOptions{ + serviceValues, err := helpers.GetBundleServiceValues(ctx, helpers.ServiceValuesOptions{ Env: *commonCmdData.Environment, Namespace: releaseNamespace, SetDockerConfigJsonValue: *commonCmdData.SetDockerConfigJsonValue, @@ -182,7 +177,6 @@ if err != nil { return fmt.Errorf("get current working directory: %w", err) } - secrets.SecretsWorkingDir = secretWorkDir var bundlePath string if isLocalBundle { @@ -201,7 +195,17 @@ bundlePath = filepath.Join(werf.GetServiceDir(), "tmp", "bundles", uuid.NewString()) defer os.RemoveAll(bundlePath) - if err := bundles.Pull(ctx, fmt.Sprintf("%s:%s", repoAddress, cmdData.Tag), bundlePath, bundlesRegistryClient); err != nil { + if err := bundles.Pull(ctx, fmt.Sprintf("%s:%s", repoAddress, cmdData.Tag), bundlePath, bundlesRegistryClient, helmopts.HelmOptions{ + ChartLoadOpts: helmopts.ChartLoadOptions{ + ChartDir: bundlePath, + NoDecryptSecrets: *commonCmdData.IgnoreSecretKey, + NoDefaultSecretValues: *commonCmdData.DisableDefaultSecretValues, + NoDefaultValues: *commonCmdData.DisableDefaultValues, + SecretValuesFiles: common.GetSecretValues(&commonCmdData), + SecretsWorkingDir: secretWorkDir, + ExtraValues: serviceValues, + }, + }); err != nil { return fmt.Errorf("pull bundle: %w", err) } } @@ -211,8 +215,6 @@ return fmt.Errorf("get annotations and labels: %w", err) } - chart.CurrentChartType = chart.ChartTypeBundle - // TODO(v3): get rid of forcing color mode via ci-env and use color mode detection logic from // Nelm instead. Until then, color will be always off here. ctx = action.SetupLogging(ctx, cmp.Or(common.GetNelmLogLevel(&commonCmdData), action.DefaultChartRenderLogLevel), action.SetupLoggingOptions{ @@ -240,7 +242,8 @@ KubeSkipTLSVerify: *commonCmdData.SkipTlsVerifyKube, KubeTLSServerName: *commonCmdData.KubeTlsServer, KubeToken: *commonCmdData.KubeToken, - Remote: cmdData.Validate, + LegacyChartType: helmopts.ChartTypeBundle, + LegacyExtraValues: serviceValues, LocalKubeVersion: *commonCmdData.KubeVersion, LogRegistryStreamOut: os.Stdout, NetworkParallelism: *commonCmdData.NetworkParallelism, @@ -249,6 +252,7 @@ ReleaseName: releaseName, ReleaseNamespace: releaseNamespace, ReleaseStorageDriver: os.Getenv("HELM_DRIVER"), + Remote: cmdData.Validate, SecretKeyIgnore: *commonCmdData.IgnoreSecretKey, SecretValuesPaths: common.GetSecretValues(&commonCmdData), SecretWorkDir: secretWorkDir, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/cmd/werf/converge/converge.go new/werf-2.36.3/cmd/werf/converge/converge.go --- old/werf-2.36.1/cmd/werf/converge/converge.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/cmd/werf/converge/converge.go 2025-05-23 13:02:03.000000000 +0200 @@ -12,8 +12,7 @@ "github.com/spf13/cobra" "github.com/werf/3p-helm/pkg/chart" - "github.com/werf/3p-helm/pkg/chart/loader" - "github.com/werf/3p-helm/pkg/chartutil" + "github.com/werf/3p-helm/pkg/werf/file" "github.com/werf/common-go/pkg/util" "github.com/werf/logboek" "github.com/werf/nelm/pkg/action" @@ -420,7 +419,7 @@ registryCredentialsPath := docker.GetDockerConfigCredentialsFile(*commonCmdData.DockerConfig) - chartutil.ServiceValues, err = helpers.GetServiceValues(ctx, werfConfig.Meta.Project, imagesRepo, imagesInfoGetters, helpers.ServiceValuesOptions{ + serviceValues, err := helpers.GetServiceValues(ctx, werfConfig.Meta.Project, imagesRepo, imagesInfoGetters, helpers.ServiceValuesOptions{ Namespace: releaseNamespace, Env: *commonCmdData.Environment, SetDockerConfigJsonValue: *commonCmdData.SetDockerConfigJsonValue, @@ -437,7 +436,7 @@ return fmt.Errorf("get release labels: %w", err) } - loader.ChartFileReader = giterminismManager.FileReader() + file.ChartFileReader = giterminismManager.FileReader() ctx = action.SetupLogging(ctx, cmp.Or(common.GetNelmLogLevel(&commonCmdData), action.DefaultReleaseInstallLogLevel), action.SetupLoggingOptions{ ColorMode: *commonCmdData.LogColorMode, @@ -470,6 +469,7 @@ KubeSkipTLSVerify: *commonCmdData.SkipTlsVerifyKube, KubeTLSServerName: *commonCmdData.KubeTlsServer, KubeToken: *commonCmdData.KubeToken, + LegacyExtraValues: serviceValues, LogRegistryStreamOut: os.Stdout, NetworkParallelism: common.GetNetworkParallelism(&commonCmdData), NoInstallCRDs: *commonCmdData.NoInstallCRDs, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/cmd/werf/helm/secret/decrypt/decrypt.go new/werf-2.36.3/cmd/werf/helm/secret/decrypt/decrypt.go --- old/werf-2.36.1/cmd/werf/helm/secret/decrypt/decrypt.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/cmd/werf/helm/secret/decrypt/decrypt.go 2025-05-23 13:02:03.000000000 +0200 @@ -98,7 +98,7 @@ var err error var encoder *secret.YamlEncoder - if enc, err := m.GetYamlEncoder(ctx, workingDir); err != nil { + if enc, err := m.GetYamlEncoder(ctx, workingDir, false); err != nil { return err } else { encoder = enc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/cmd/werf/helm/secret/encrypt/encrypt.go new/werf-2.36.3/cmd/werf/helm/secret/encrypt/encrypt.go --- old/werf-2.36.1/cmd/werf/helm/secret/encrypt/encrypt.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/cmd/werf/helm/secret/encrypt/encrypt.go 2025-05-23 13:02:03.000000000 +0200 @@ -97,7 +97,7 @@ var err error var encoder *secret.YamlEncoder - if enc, err := m.GetYamlEncoder(ctx, workingDir); err != nil { + if enc, err := m.GetYamlEncoder(ctx, workingDir, false); err != nil { return err } else { encoder = enc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/cmd/werf/plan/plan.go new/werf-2.36.3/cmd/werf/plan/plan.go --- old/werf-2.36.1/cmd/werf/plan/plan.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/cmd/werf/plan/plan.go 2025-05-23 13:02:03.000000000 +0200 @@ -11,8 +11,7 @@ "github.com/spf13/cobra" "github.com/werf/3p-helm/pkg/chart" - "github.com/werf/3p-helm/pkg/chart/loader" - "github.com/werf/3p-helm/pkg/chartutil" + "github.com/werf/3p-helm/pkg/werf/file" "github.com/werf/common-go/pkg/util" "github.com/werf/logboek" "github.com/werf/nelm/pkg/action" @@ -417,7 +416,7 @@ registryCredentialsPath := docker.GetDockerConfigCredentialsFile(*commonCmdData.DockerConfig) - chartutil.ServiceValues, err = helpers.GetServiceValues(ctx, werfConfig.Meta.Project, imagesRepository, imagesInfoGetters, helpers.ServiceValuesOptions{ + serviceValues, err := helpers.GetServiceValues(ctx, werfConfig.Meta.Project, imagesRepository, imagesInfoGetters, helpers.ServiceValuesOptions{ Namespace: releaseNamespace, Env: *commonCmdData.Environment, IsStub: isStub, @@ -432,7 +431,7 @@ return fmt.Errorf("get service values: %w", err) } - loader.ChartFileReader = giterminismManager.FileReader() + file.ChartFileReader = giterminismManager.FileReader() ctx = action.SetupLogging(ctx, cmp.Or(common.GetNelmLogLevel(&commonCmdData), action.DefaultReleasePlanInstallLogLevel), action.SetupLoggingOptions{ ColorMode: *commonCmdData.LogColorMode, @@ -463,6 +462,7 @@ KubeSkipTLSVerify: *commonCmdData.SkipTlsVerifyKube, KubeTLSServerName: *commonCmdData.KubeTlsServer, KubeToken: *commonCmdData.KubeToken, + LegacyExtraValues: serviceValues, LogRegistryStreamOut: os.Stdout, NetworkParallelism: common.GetNetworkParallelism(&commonCmdData), NoInstallCRDs: *commonCmdData.NoInstallCRDs, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/cmd/werf/render/render.go new/werf-2.36.3/cmd/werf/render/render.go --- old/werf-2.36.1/cmd/werf/render/render.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/cmd/werf/render/render.go 2025-05-23 13:02:03.000000000 +0200 @@ -11,8 +11,7 @@ "github.com/spf13/cobra" "github.com/werf/3p-helm/pkg/chart" - "github.com/werf/3p-helm/pkg/chart/loader" - "github.com/werf/3p-helm/pkg/chartutil" + "github.com/werf/3p-helm/pkg/werf/file" "github.com/werf/common-go/pkg/util" "github.com/werf/logboek" "github.com/werf/logboek/pkg/level" @@ -375,7 +374,7 @@ } registryCredentialsPath := docker.GetDockerConfigCredentialsFile(*commonCmdData.DockerConfig) - chartutil.ServiceValues, err = helpers.GetServiceValues(ctx, werfConfig.Meta.Project, imagesRepository, imagesInfoGetters, helpers.ServiceValuesOptions{ + serviceValues, err := helpers.GetServiceValues(ctx, werfConfig.Meta.Project, imagesRepository, imagesInfoGetters, helpers.ServiceValuesOptions{ Namespace: releaseNamespace, Env: *commonCmdData.Environment, IsStub: isStub, @@ -390,7 +389,7 @@ return fmt.Errorf("get service values: %w", err) } - loader.ChartFileReader = giterminismManager.FileReader() + file.ChartFileReader = giterminismManager.FileReader() // TODO(v3): get rid of forcing color mode via ci-env and use color mode detection logic from // Nelm instead. Until then, color will be always off here. @@ -423,7 +422,7 @@ KubeSkipTLSVerify: *commonCmdData.SkipTlsVerifyKube, KubeTLSServerName: *commonCmdData.KubeTlsServer, KubeToken: *commonCmdData.KubeToken, - Remote: cmdData.Validate, + LegacyExtraValues: serviceValues, LocalKubeVersion: *commonCmdData.KubeVersion, LogRegistryStreamOut: os.Stdout, NetworkParallelism: *commonCmdData.NetworkParallelism, @@ -432,6 +431,7 @@ ReleaseName: releaseName, ReleaseNamespace: releaseNamespace, ReleaseStorageDriver: os.Getenv("HELM_DRIVER"), + Remote: cmdData.Validate, SecretKeyIgnore: *commonCmdData.IgnoreSecretKey, SecretValuesPaths: common.GetSecretValues(&commonCmdData), SecretWorkDir: giterminismManager.ProjectDir(), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/go.mod new/werf-2.36.3/go.mod --- old/werf-2.36.1/go.mod 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/go.mod 2025-05-23 13:02:03.000000000 +0200 @@ -58,15 +58,15 @@ github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 - github.com/werf/3p-helm v0.0.0-20250513175502-6861d09b2363 + github.com/werf/3p-helm v0.0.0-20250523104754-b2fc45bbcb87 github.com/werf/3p-helm-for-werf-helm v0.0.0-20241217155820-089f92cd5c9d - github.com/werf/common-go v0.0.0-20250417171011-97dbede6f27c + github.com/werf/common-go v0.0.0-20250520111308-b0eda28dde0d github.com/werf/copy-recurse v0.2.7 github.com/werf/kubedog v0.13.1-0.20250411133038-3d8084fab0ec github.com/werf/kubedog-for-werf-helm v0.0.0-20241217155728-9d45c48b82b6 github.com/werf/lockgate v0.1.1 github.com/werf/logboek v0.6.1 - github.com/werf/nelm v1.3.1-0.20250514090232-c96056e7f789 + github.com/werf/nelm v1.4.1 github.com/werf/nelm-for-werf-helm v0.0.0-20241217155925-b0e6734d1dbf go.opentelemetry.io/otel v1.24.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/go.sum new/werf-2.36.3/go.sum --- old/werf-2.36.1/go.sum 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/go.sum 2025-05-23 13:02:03.000000000 +0200 @@ -1388,14 +1388,14 @@ github.com/werf/3p-buildah v1.35.2-0.20241120093816-5b80b7b735de/go.mod h1:vVSVUlTu8+99H5j43gBJscpkb/quZvdJg78+6X1HeTM= github.com/werf/3p-docker-buildx v0.13.0-rc2.0.20241111114615-d77c2e1444ad h1:FBDNACfjjpDBwXhALF5LgvEiu08HpUurb/2G323SVsQ= github.com/werf/3p-docker-buildx v0.13.0-rc2.0.20241111114615-d77c2e1444ad/go.mod h1:Q3gtkv8D3sdaa5LJXbzMooYR/A5vBiEB2yQ56wywohM= -github.com/werf/3p-helm v0.0.0-20250513175502-6861d09b2363 h1:71f/6hHWMGpm4+nKCKGbpkVMOd2ePzY//qgSBkEQXsY= -github.com/werf/3p-helm v0.0.0-20250513175502-6861d09b2363/go.mod h1:bwpkc66otpnI2/K8fteIF/IkrHrq6jrAFW5ETHPNa00= +github.com/werf/3p-helm v0.0.0-20250523104754-b2fc45bbcb87 h1:kHySZA0mA/KtaaO8lftbSHbM5FoB29ipvXrG9esUMtY= +github.com/werf/3p-helm v0.0.0-20250523104754-b2fc45bbcb87/go.mod h1:KDjmOsjFiOmj0fB0+q+0gGvlejPMjTgckLC59bX0BLg= github.com/werf/3p-helm-for-werf-helm v0.0.0-20241217155820-089f92cd5c9d h1:HN9jmAG2Gyhf8hJca9yoAO2xawNZQ/6OYDomxkKr5Sw= github.com/werf/3p-helm-for-werf-helm v0.0.0-20241217155820-089f92cd5c9d/go.mod h1:fozJ+C/Llp1e+jHxrJOZUu+D4QEw+laQK6W6RFqvTsg= github.com/werf/3p-oras v0.9.1-0.20240115121544-03962ecbd40a h1:PsU9szHZlIH+CjcuIuPXRLc5dsdoaFldvYjS6YHI7YQ= github.com/werf/3p-oras v0.9.1-0.20240115121544-03962ecbd40a/go.mod h1:XTePf8biMMCkqbuuWBZ24xOwo3hZej+BBM0uvd8aGqk= -github.com/werf/common-go v0.0.0-20250417171011-97dbede6f27c h1:DOXbzVhCnkn9znHNgiD1UahLu59Dv48iFO/L8i4Z/bI= -github.com/werf/common-go v0.0.0-20250417171011-97dbede6f27c/go.mod h1:taKDUxKmGfqNOlVx1O0ad5vdV4duKexTLO7Rch9HfeA= +github.com/werf/common-go v0.0.0-20250520111308-b0eda28dde0d h1:nVN0E4lQdToFiPty19uwj5TF+bCI/kAp5LLG4stWdO4= +github.com/werf/common-go v0.0.0-20250520111308-b0eda28dde0d/go.mod h1:taKDUxKmGfqNOlVx1O0ad5vdV4duKexTLO7Rch9HfeA= github.com/werf/copy-recurse v0.2.7 h1:3FTOarbJ9uhFLi75oeUCioK9zxZwuV7o28kuUBPDZPM= github.com/werf/copy-recurse v0.2.7/go.mod h1:6Ypb+qN+hRBJgoCgEkX1vpbqcQ+8q69BQ3hi8s8Y6Qc= github.com/werf/kubedog v0.13.1-0.20250411133038-3d8084fab0ec h1:tyfkagRcJVtfBF4aoxmnE6/idE7YIPo4RqdJQXNoJRg= @@ -1406,8 +1406,8 @@ github.com/werf/lockgate v0.1.1/go.mod h1:0yIFSLq9ausy6ejNxF5uUBf/Ib6daMAfXuCaTMZJzIE= github.com/werf/logboek v0.6.1 h1:oEe6FkmlKg0z0n80oZjLplj6sXcBeLleCkjfOOZEL2g= github.com/werf/logboek v0.6.1/go.mod h1:Gez5J4bxekyr6MxTmIJyId1F61rpO+0/V4vjCIEIZmk= -github.com/werf/nelm v1.3.1-0.20250514090232-c96056e7f789 h1:Lq9A/LFGmIxh0MRs+9PgD6C9GK3ofDoP7i6ijb5pI84= -github.com/werf/nelm v1.3.1-0.20250514090232-c96056e7f789/go.mod h1:xEkU7QBPkPqecrymb9mKTjTlibU9cawc8VbDFQbvUJ0= +github.com/werf/nelm v1.4.1 h1:V1ud6P0VFHiBSc71t8fCotAMbBYoXKjZxHZ/vP3y+GY= +github.com/werf/nelm v1.4.1/go.mod h1:2BaEAXz2OHy3fQyNfFe65A8IPY25E5SX1JomFBUAIxg= github.com/werf/nelm-for-werf-helm v0.0.0-20241217155925-b0e6734d1dbf h1:K51qz209c1yJgKzPw8AeS72T21F/ACp0VI3RJvT4THA= github.com/werf/nelm-for-werf-helm v0.0.0-20241217155925-b0e6734d1dbf/go.mod h1:7RJXSGPKKPEvfPqrTwNA8jT7y52O0ebwhSbSn29ESMA= github.com/xanzy/go-gitlab v0.31.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/pkg/build/stage/git_mapping.go new/werf-2.36.3/pkg/build/stage/git_mapping.go --- old/werf-2.36.1/pkg/build/stage/git_mapping.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/pkg/build/stage/git_mapping.go 2025-05-23 13:02:03.000000000 +0200 @@ -231,11 +231,12 @@ )) gitCommand := fmt.Sprintf( - "%s %s apply --ignore-whitespace --whitespace=nowarn --directory=\"%s\" --unsafe-paths %s", + "%s %s apply --ignore-whitespace --whitespace=nowarn --directory=\"%s\" --unsafe-paths %s %s", stapel.OptionalSudoCommand(gm.Owner, gm.Group), stapel.GitBinPath(), applyPatchDirectory, patchFile.ContainerFilePath, + fmt.Sprintf("|| exit %d", container_backend.ErrPatchApplyCode), ) commands = append(commands, strings.TrimLeft(gitCommand, " ")) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/pkg/container_backend/errors.go new/werf-2.36.3/pkg/container_backend/errors.go --- old/werf-2.36.1/pkg/container_backend/errors.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/pkg/container_backend/errors.go 2025-05-23 13:02:03.000000000 +0200 @@ -4,6 +4,7 @@ "errors" "github.com/containers/storage/types" + "github.com/docker/cli/cli" ) var ( @@ -13,3 +14,34 @@ ErrImageUsedByContainer = types.ErrImageUsedByContainer ErrPruneIsAlreadyRunning = errors.New("a prune operation is already running") ) + +var ErrPatchApply = errors.New(`cannot update source code added by git directive because the files being patched were modified by user commands in earlier stages (install, beforeSetup or setup) + +Possible solutions: + + - If these files should not be changed, update the commands that modify them. + + - If these files should be changed, declare them explicitly using the stageDependencies.<install|beforeSetup|setup> directive. This ensures the files are updated before running user commands. + + - If these files are not needed, exclude them using the includePaths or excludePaths options under the git directive.`) + +const ( + ErrPatchApplyCode = 42 +) + +var errByCode = map[int]error{ + ErrPatchApplyCode: ErrPatchApply, +} + +func CliErrorByCode(err error) error { + if err == nil { + return nil + } + var statusError cli.StatusError + if errors.As(err, &statusError) { + if e, ok := errByCode[statusError.StatusCode]; ok { + return e + } + } + return err +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/pkg/container_backend/legacy_stage_image_container.go new/werf-2.36.3/pkg/container_backend/legacy_stage_image_container.go --- old/werf-2.36.1/pkg/container_backend/legacy_stage_image_container.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/pkg/container_backend/legacy_stage_image_container.go 2025-05-23 13:02:03.000000000 +0200 @@ -288,7 +288,7 @@ err = docker.CliRun_LiveOutput(ctx, runArgs...) UnregisterRunningContainer(c.name) if err != nil { - return fmt.Errorf("container run failed: %w", err) + return fmt.Errorf("container run failed: %w", CliErrorByCode(err)) } return nil } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/pkg/deploy/bundles/bundle_accessor.go new/werf-2.36.3/pkg/deploy/bundles/bundle_accessor.go --- old/werf-2.36.1/pkg/deploy/bundles/bundle_accessor.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/pkg/deploy/bundles/bundle_accessor.go 2025-05-23 13:02:03.000000000 +0200 @@ -5,17 +5,19 @@ "fmt" "github.com/werf/3p-helm/pkg/chart" + "github.com/werf/3p-helm/pkg/werf/helmopts" "github.com/werf/werf/v2/pkg/docker_registry" ) type copyToOptions struct { HelmCompatibleChart bool RenameChart string + HelmOptions helmopts.HelmOptions } type BundleAccessor interface { - ReadChart(ctx context.Context) (*chart.Chart, error) - WriteChart(ctx context.Context, ch *chart.Chart) error + ReadChart(ctx context.Context, opts helmopts.HelmOptions) (*chart.Chart, error) + WriteChart(ctx context.Context, ch *chart.Chart, opts helmopts.HelmOptions) error CopyTo(ctx context.Context, to BundleAccessor, opts copyToOptions) error CopyFromArchive(ctx context.Context, fromArchive *BundleArchive, opts copyToOptions) error diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/pkg/deploy/bundles/bundle_archive.go new/werf-2.36.3/pkg/deploy/bundles/bundle_archive.go --- old/werf-2.36.1/pkg/deploy/bundles/bundle_archive.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/pkg/deploy/bundles/bundle_archive.go 2025-05-23 13:02:03.000000000 +0200 @@ -7,6 +7,7 @@ "io" "github.com/werf/3p-helm/pkg/chart" + "github.com/werf/3p-helm/pkg/werf/helmopts" "github.com/werf/logboek" "github.com/werf/werf/v2/pkg/image" ) @@ -15,6 +16,8 @@ chartArchiveFileName = "chart.tar.gz" ) +var _ BundleAccessor = (*BundleArchive)(nil) + type BundleArchive struct { Reader BundleArchiveReader Writer BundleArchiveWriter @@ -28,13 +31,13 @@ return NewImageArchiveOpener(bundle, imageTag) } -func (bundle *BundleArchive) ReadChart(ctx context.Context) (*chart.Chart, error) { +func (bundle *BundleArchive) ReadChart(ctx context.Context, opts helmopts.HelmOptions) (*chart.Chart, error) { chartBytes, err := bundle.Reader.ReadChartArchive() if err != nil { return nil, fmt.Errorf("unable to read chart archive: %w", err) } - ch, err := BytesToChart(chartBytes) + ch, err := BytesToChart(chartBytes, opts) if err != nil { return nil, fmt.Errorf("unable to parse chart archive from bundle archive: %w", err) } @@ -42,13 +45,13 @@ return ch, nil } -func (bundle *BundleArchive) WriteChart(ctx context.Context, ch *chart.Chart) error { +func (bundle *BundleArchive) WriteChart(ctx context.Context, ch *chart.Chart, opts helmopts.HelmOptions) error { chartBytes, err := ChartToBytes(ch) if err != nil { return fmt.Errorf("unable to dump chart to archive: %w", err) } - if err := bundle.Writer.WriteChartArchive(chartBytes); err != nil { + if err := bundle.Writer.WriteChartArchive(chartBytes, opts); err != nil { return fmt.Errorf("unable to write chart archive into bundle archive: %w", err) } @@ -60,7 +63,7 @@ } func (bundle *BundleArchive) CopyFromArchive(ctx context.Context, fromArchive *BundleArchive, opts copyToOptions) error { - ch, err := fromArchive.ReadChart(ctx) + ch, err := fromArchive.ReadChart(ctx, opts.HelmOptions) if err != nil { return fmt.Errorf("unable to read chart from the bundle archive %q: %w", fromArchive.Reader.String(), err) } @@ -70,7 +73,7 @@ } if err := logboek.Context(ctx).LogProcess("Saving bundle %s into archive", fromArchive.Reader.String()).DoError(func() error { - return bundle.WriteChart(ctx, ch) + return bundle.WriteChart(ctx, ch, opts.HelmOptions) }); err != nil { return err } @@ -122,7 +125,7 @@ } func (bundle *BundleArchive) CopyFromRemote(ctx context.Context, fromRemote *RemoteBundle, opts copyToOptions) error { - ch, err := fromRemote.ReadChart(ctx) + ch, err := fromRemote.ReadChart(ctx, opts.HelmOptions) if err != nil { return fmt.Errorf("unable to read chart from remote bundle: %w", err) } @@ -132,7 +135,7 @@ } if err := logboek.Context(ctx).LogProcess("Saving bundle %s into archive", fromRemote.RegistryAddress.FullName()).DoError(func() error { - return bundle.WriteChart(ctx, ch) + return bundle.WriteChart(ctx, ch, opts.HelmOptions) }); err != nil { return err } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/pkg/deploy/bundles/bundle_archive_writer.go new/werf-2.36.3/pkg/deploy/bundles/bundle_archive_writer.go --- old/werf-2.36.1/pkg/deploy/bundles/bundle_archive_writer.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/pkg/deploy/bundles/bundle_archive_writer.go 2025-05-23 13:02:03.000000000 +0200 @@ -10,11 +10,13 @@ "time" "github.com/google/uuid" + + "github.com/werf/3p-helm/pkg/werf/helmopts" ) type BundleArchiveWriter interface { Open() error - WriteChartArchive(data []byte) error + WriteChartArchive(data []byte, opts helmopts.HelmOptions) error WriteImageArchive(imageTag string, data []byte) error Save() error } @@ -94,7 +96,7 @@ return nil } -func (writer *BundleArchiveFileWriter) WriteChartArchive(data []byte) error { +func (writer *BundleArchiveFileWriter) WriteChartArchive(data []byte, opts helmopts.HelmOptions) error { now := time.Now() header := &tar.Header{ Name: chartArchiveFileName, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/pkg/deploy/bundles/bundles_registry_client.go new/werf-2.36.3/pkg/deploy/bundles/bundles_registry_client.go --- old/werf-2.36.1/pkg/deploy/bundles/bundles_registry_client.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/pkg/deploy/bundles/bundles_registry_client.go 2025-05-23 13:02:03.000000000 +0200 @@ -2,12 +2,13 @@ import ( "github.com/werf/3p-helm/pkg/chart" + "github.com/werf/3p-helm/pkg/werf/helmopts" bundles_registry "github.com/werf/werf/v2/pkg/deploy/bundles/registry" ) type BundlesRegistryClient interface { - PullChartToCache(ref *bundles_registry.Reference) error - LoadChart(ref *bundles_registry.Reference) (*chart.Chart, error) - SaveChart(ch *chart.Chart, ref *bundles_registry.Reference) error - PushChart(ref *bundles_registry.Reference) error + PullChartToCache(ref *bundles_registry.Reference, opts helmopts.HelmOptions) error + LoadChart(ref *bundles_registry.Reference, opts helmopts.HelmOptions) (*chart.Chart, error) + SaveChart(ch *chart.Chart, ref *bundles_registry.Reference, opts helmopts.HelmOptions) error + PushChart(ref *bundles_registry.Reference, opts helmopts.HelmOptions) error } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/pkg/deploy/bundles/chart_helpers.go new/werf-2.36.3/pkg/deploy/bundles/chart_helpers.go --- old/werf-2.36.1/pkg/deploy/bundles/chart_helpers.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/pkg/deploy/bundles/chart_helpers.go 2025-05-23 13:02:03.000000000 +0200 @@ -12,6 +12,7 @@ "github.com/werf/3p-helm/pkg/chart" "github.com/werf/3p-helm/pkg/chart/loader" "github.com/werf/3p-helm/pkg/chartutil" + "github.com/werf/3p-helm/pkg/werf/helmopts" "github.com/werf/logboek" ) @@ -36,9 +37,9 @@ return chartBytes.Bytes(), nil } -func BytesToChart(data []byte) (*chart.Chart, error) { +func BytesToChart(data []byte, opts helmopts.HelmOptions) (*chart.Chart, error) { dataReader := bytes.NewBuffer(data) - return loader.LoadArchiveWithOptions(dataReader, chart.LoadOptions{}) + return loader.LoadArchive(dataReader, opts) } func SaveChartValues(ctx context.Context, ch *chart.Chart) error { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/pkg/deploy/bundles/copy.go new/werf-2.36.3/pkg/deploy/bundles/copy.go --- old/werf-2.36.1/pkg/deploy/bundles/copy.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/pkg/deploy/bundles/copy.go 2025-05-23 13:02:03.000000000 +0200 @@ -3,6 +3,7 @@ import ( "context" + "github.com/werf/3p-helm/pkg/werf/helmopts" "github.com/werf/werf/v2/pkg/docker_registry" ) @@ -11,6 +12,7 @@ FromRegistryClient, ToRegistryClient docker_registry.Interface HelmCompatibleChart bool RenameChart string + HelmOptions helmopts.HelmOptions } func Copy(ctx context.Context, fromAddr, toAddr *Addr, opts CopyOptions) error { @@ -23,5 +25,5 @@ RegistryClient: opts.ToRegistryClient, }) - return fromBundle.CopyTo(ctx, toBundle, copyToOptions{HelmCompatibleChart: opts.HelmCompatibleChart, RenameChart: opts.RenameChart}) + return fromBundle.CopyTo(ctx, toBundle, copyToOptions{HelmCompatibleChart: opts.HelmCompatibleChart, RenameChart: opts.RenameChart, HelmOptions: opts.HelmOptions}) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/pkg/deploy/bundles/copy_test.go new/werf-2.36.3/pkg/deploy/bundles/copy_test.go --- old/werf-2.36.1/pkg/deploy/bundles/copy_test.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/pkg/deploy/bundles/copy_test.go 2025-05-23 13:02:03.000000000 +0200 @@ -13,6 +13,7 @@ "sigs.k8s.io/yaml" "github.com/werf/3p-helm/pkg/chart" + "github.com/werf/3p-helm/pkg/werf/helmopts" bundles_registry "github.com/werf/werf/v2/pkg/deploy/bundles/registry" "github.com/werf/werf/v2/pkg/docker_registry" ) @@ -485,8 +486,8 @@ func (writer *BundleArchiveStubWriter) Open() error { return nil } -func (writer *BundleArchiveStubWriter) WriteChartArchive(data []byte) error { - ch, err := BytesToChart(data) +func (writer *BundleArchiveStubWriter) WriteChartArchive(data []byte, opts helmopts.HelmOptions) error { + ch, err := BytesToChart(data, opts) if err != nil { return err } @@ -513,23 +514,23 @@ } } -func (client *BundlesRegistryClientStub) PullChartToCache(ref *bundles_registry.Reference) error { +func (client *BundlesRegistryClientStub) PullChartToCache(ref *bundles_registry.Reference, opts helmopts.HelmOptions) error { return nil } -func (client *BundlesRegistryClientStub) LoadChart(ref *bundles_registry.Reference) (*chart.Chart, error) { +func (client *BundlesRegistryClientStub) LoadChart(ref *bundles_registry.Reference, opts helmopts.HelmOptions) (*chart.Chart, error) { if ch, hasChart := client.StubCharts[ref.FullName()]; hasChart { return ch, nil } return nil, fmt.Errorf("no chart found by address %s", ref.FullName()) } -func (client *BundlesRegistryClientStub) SaveChart(ch *chart.Chart, ref *bundles_registry.Reference) error { +func (client *BundlesRegistryClientStub) SaveChart(ch *chart.Chart, ref *bundles_registry.Reference, opts helmopts.HelmOptions) error { client.StubCharts[ref.FullName()] = ch return nil } -func (client *BundlesRegistryClientStub) PushChart(ref *bundles_registry.Reference) error { +func (client *BundlesRegistryClientStub) PushChart(ref *bundles_registry.Reference, opts helmopts.HelmOptions) error { return nil } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/pkg/deploy/bundles/publish.go new/werf-2.36.3/pkg/deploy/bundles/publish.go --- old/werf-2.36.1/pkg/deploy/bundles/publish.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/pkg/deploy/bundles/publish.go 2025-05-23 13:02:03.000000000 +0200 @@ -6,9 +6,9 @@ "fmt" "path/filepath" - "github.com/werf/3p-helm/pkg/chart" "github.com/werf/3p-helm/pkg/chart/loader" "github.com/werf/3p-helm/pkg/downloader" + "github.com/werf/3p-helm/pkg/werf/helmopts" "github.com/werf/logboek" "github.com/werf/werf/v2/pkg/deploy/bundles/registry" ) @@ -16,6 +16,7 @@ type PublishOptions struct { HelmCompatibleChart bool RenameChart string + HelmOptions helmopts.HelmOptions } func Publish(ctx context.Context, bundleDir, bundleRef string, bundlesRegistryClient *registry.Client, opts PublishOptions) error { @@ -24,15 +25,13 @@ return fmt.Errorf("error parsing bundle ref %q: %w", bundleRef, err) } - loader.GlobalLoadOptions = &chart.LoadOptions{} - if err := logboek.Context(ctx).Default().LogProcess("Saving bundle to the local chart helm cache").DoError(func() error { path, err := filepath.Abs(bundleDir) if err != nil { return err } - ch, err := loader.Load(path) + ch, err := loader.Load(path, opts.HelmOptions) if err != nil { var e *downloader.ErrRepoNotFound if errors.As(err, &e) { @@ -46,7 +45,7 @@ ch.Metadata.Name = *nameOverwrite } - if err := bundlesRegistryClient.SaveChart(ch, r); err != nil { + if err := bundlesRegistryClient.SaveChart(ch, r, opts.HelmOptions); err != nil { return fmt.Errorf("unable to save bundle to the local chart helm cache: %w", err) } return nil @@ -55,7 +54,7 @@ } if err := logboek.Context(ctx).LogProcess("Pushing bundle %q", bundleRef).DoError(func() error { - return bundlesRegistryClient.PushChart(r) + return bundlesRegistryClient.PushChart(r, opts.HelmOptions) }); err != nil { return err } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/pkg/deploy/bundles/pull.go new/werf-2.36.3/pkg/deploy/bundles/pull.go --- old/werf-2.36.1/pkg/deploy/bundles/pull.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/pkg/deploy/bundles/pull.go 2025-05-23 13:02:03.000000000 +0200 @@ -5,24 +5,25 @@ "fmt" "github.com/werf/3p-helm/pkg/chartutil" + "github.com/werf/3p-helm/pkg/werf/helmopts" "github.com/werf/logboek" "github.com/werf/werf/v2/pkg/deploy/bundles/registry" ) -func Pull(ctx context.Context, bundleRef, destDir string, bundlesRegistryClient *registry.Client) error { +func Pull(ctx context.Context, bundleRef, destDir string, bundlesRegistryClient *registry.Client, opts helmopts.HelmOptions) error { r, err := registry.ParseReference(bundleRef) if err != nil { return err } if err := logboek.Context(ctx).LogProcess("Pulling bundle %q", bundleRef).DoError(func() error { - return bundlesRegistryClient.PullChartToCache(r) + return bundlesRegistryClient.PullChartToCache(r, opts) }); err != nil { return err } if err := logboek.Context(ctx).LogProcess("Exporting bundle %q", bundleRef).DoError(func() error { - ch, err := bundlesRegistryClient.LoadChart(r) + ch, err := bundlesRegistryClient.LoadChart(r, opts) if err != nil { return fmt.Errorf("unable to load pulled chart: %w", err) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/pkg/deploy/bundles/registry/cache.go new/werf-2.36.3/pkg/deploy/bundles/registry/cache.go --- old/werf-2.36.1/pkg/deploy/bundles/registry/cache.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/pkg/deploy/bundles/registry/cache.go 2025-05-23 13:02:03.000000000 +0200 @@ -37,6 +37,7 @@ "github.com/werf/3p-helm/pkg/chart" "github.com/werf/3p-helm/pkg/chart/loader" "github.com/werf/3p-helm/pkg/chartutil" + "github.com/werf/3p-helm/pkg/werf/helmopts" ) const ( @@ -87,7 +88,7 @@ } // FetchReference retrieves a chart ref from cache -func (cache *Cache) FetchReference(ref *Reference) (*CacheRefSummary, error) { +func (cache *Cache) FetchReference(ref *Reference, opts helmopts.HelmOptions) (*CacheRefSummary, error) { if err := cache.init(); err != nil { return nil, err } @@ -144,7 +145,7 @@ if err != nil { return &r, err } - ch, err := loader.LoadArchive(bytes.NewBuffer(contentBytes)) + ch, err := loader.LoadArchive(bytes.NewBuffer(contentBytes), opts) if err != nil { return &r, err } @@ -155,7 +156,7 @@ } // StoreReference stores a chart ref in cache -func (cache *Cache) StoreReference(ref *Reference, ch *chart.Chart) (*CacheRefSummary, error) { +func (cache *Cache) StoreReference(ref *Reference, ch *chart.Chart, opts helmopts.HelmOptions) (*CacheRefSummary, error) { if err := cache.init(); err != nil { return nil, err } @@ -165,7 +166,7 @@ Tag: ref.Tag, Chart: ch, } - existing, _ := cache.FetchReference(ref) + existing, _ := cache.FetchReference(ref, opts) r.Exists = existing.Exists config, _, err := cache.saveChartConfig(ch) if err != nil { @@ -194,11 +195,11 @@ // DeleteReference deletes a chart ref from cache // TODO: garbage collection, only manifest removed -func (cache *Cache) DeleteReference(ref *Reference) (*CacheRefSummary, error) { +func (cache *Cache) DeleteReference(ref *Reference, opts helmopts.HelmOptions) (*CacheRefSummary, error) { if err := cache.init(); err != nil { return nil, err } - r, err := cache.FetchReference(ref) + r, err := cache.FetchReference(ref, opts) if err != nil || !r.Exists { return r, err } @@ -208,7 +209,7 @@ } // ListReferences lists all chart refs in a cache -func (cache *Cache) ListReferences() ([]*CacheRefSummary, error) { +func (cache *Cache) ListReferences(opts helmopts.HelmOptions) ([]*CacheRefSummary, error) { if err := cache.init(); err != nil { return nil, err } @@ -225,7 +226,7 @@ if err != nil { return rr, err } - r, err := cache.FetchReference(ref) + r, err := cache.FetchReference(ref, opts) if err != nil { return rr, err } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/pkg/deploy/bundles/registry/client.go new/werf-2.36.3/pkg/deploy/bundles/registry/client.go --- old/werf-2.36.1/pkg/deploy/bundles/registry/client.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/pkg/deploy/bundles/registry/client.go 2025-05-23 13:02:03.000000000 +0200 @@ -35,6 +35,7 @@ "github.com/werf/3p-helm/pkg/chart" "github.com/werf/3p-helm/pkg/helmpath" + "github.com/werf/3p-helm/pkg/werf/helmopts" ) const ( @@ -131,8 +132,8 @@ } // PushChart uploads a chart to a registry -func (c *Client) PushChart(ref *Reference) error { - r, err := c.cache.FetchReference(ref) +func (c *Client) PushChart(ref *Reference, opts helmopts.HelmOptions) error { + r, err := c.cache.FetchReference(ref, opts) if err != nil { return err } @@ -209,11 +210,11 @@ // PullChartToCache pulls a chart from an OCI Registry to the Registry Cache. // This function is needed for `helm chart pull`, which is experimental and will be deprecated soon. // Likewise, the Registry cache will soon be deprecated as will this function. -func (c *Client) PullChartToCache(ref *Reference) error { +func (c *Client) PullChartToCache(ref *Reference, opts helmopts.HelmOptions) error { if ref.Tag == "" { return errors.New("tag explicitly required") } - existing, err := c.cache.FetchReference(ref) + existing, err := c.cache.FetchReference(ref, opts) if err != nil { return err } @@ -229,7 +230,7 @@ if err != nil { return err } - r, err := c.cache.FetchReference(ref) + r, err := c.cache.FetchReference(ref, opts) if err != nil { return err } @@ -246,8 +247,8 @@ } // SaveChart stores a copy of chart in local cache -func (c *Client) SaveChart(ch *chart.Chart, ref *Reference) error { - r, err := c.cache.StoreReference(ref, ch) +func (c *Client) SaveChart(ch *chart.Chart, ref *Reference, opts helmopts.HelmOptions) error { + r, err := c.cache.StoreReference(ref, ch, opts) if err != nil { return err } @@ -261,8 +262,8 @@ } // LoadChart retrieves a chart object by reference -func (c *Client) LoadChart(ref *Reference) (*chart.Chart, error) { - r, err := c.cache.FetchReference(ref) +func (c *Client) LoadChart(ref *Reference, opts helmopts.HelmOptions) (*chart.Chart, error) { + r, err := c.cache.FetchReference(ref, opts) if err != nil { return nil, err } @@ -274,8 +275,8 @@ } // RemoveChart deletes a locally saved chart -func (c *Client) RemoveChart(ref *Reference) error { - r, err := c.cache.DeleteReference(ref) +func (c *Client) RemoveChart(ref *Reference, opts helmopts.HelmOptions) error { + r, err := c.cache.DeleteReference(ref, opts) if err != nil { return err } @@ -287,11 +288,11 @@ } // PrintChartTable prints a list of locally stored charts -func (c *Client) PrintChartTable() error { +func (c *Client) PrintChartTable(opts helmopts.HelmOptions) error { table := uitable.New() table.MaxColWidth = 60 table.AddRow("REF", "NAME", "VERSION", "DIGEST", "SIZE", "CREATED") - rows, err := c.getChartTableRows() + rows, err := c.getChartTableRows(opts) if err != nil { return err } @@ -312,8 +313,8 @@ } // getChartTableRows returns rows in uitable-friendly format -func (c *Client) getChartTableRows() ([][]interface{}, error) { - rr, err := c.cache.ListReferences() +func (c *Client) getChartTableRows(opts helmopts.HelmOptions) ([][]interface{}, error) { + rr, err := c.cache.ListReferences(opts) if err != nil { return nil, err } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/pkg/deploy/bundles/remote_bundle.go new/werf-2.36.3/pkg/deploy/bundles/remote_bundle.go --- old/werf-2.36.1/pkg/deploy/bundles/remote_bundle.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/pkg/deploy/bundles/remote_bundle.go 2025-05-23 13:02:03.000000000 +0200 @@ -10,12 +10,15 @@ "sigs.k8s.io/yaml" "github.com/werf/3p-helm/pkg/chart" + "github.com/werf/3p-helm/pkg/werf/helmopts" "github.com/werf/common-go/pkg/util" "github.com/werf/logboek" bundles_registry "github.com/werf/werf/v2/pkg/deploy/bundles/registry" "github.com/werf/werf/v2/pkg/docker_registry" ) +var _ BundleAccessor = (*RemoteBundle)(nil) + type RemoteBundle struct { RegistryAddress *RegistryAddress BundlesRegistryClient BundlesRegistryClient @@ -30,9 +33,9 @@ } } -func (bundle *RemoteBundle) ReadChart(ctx context.Context) (*chart.Chart, error) { +func (bundle *RemoteBundle) ReadChart(ctx context.Context, opts helmopts.HelmOptions) (*chart.Chart, error) { if err := logboek.Context(ctx).LogProcess("Pulling bundle %s", bundle.RegistryAddress.FullName()).DoError(func() error { - if err := bundle.BundlesRegistryClient.PullChartToCache(bundle.RegistryAddress.Reference); err != nil { + if err := bundle.BundlesRegistryClient.PullChartToCache(bundle.RegistryAddress.Reference, opts); err != nil { return fmt.Errorf("unable to pull bundle %s: %w", bundle.RegistryAddress.FullName(), err) } return nil @@ -43,7 +46,7 @@ var ch *chart.Chart if err := logboek.Context(ctx).LogProcess("Loading bundle %s", bundle.RegistryAddress.FullName()).DoError(func() error { var err error - ch, err = bundle.BundlesRegistryClient.LoadChart(bundle.RegistryAddress.Reference) + ch, err = bundle.BundlesRegistryClient.LoadChart(bundle.RegistryAddress.Reference, opts) if err != nil { return fmt.Errorf("unable to load pulled bundle %s: %w", bundle.RegistryAddress.FullName(), err) } @@ -55,9 +58,9 @@ return ch, nil } -func (bundle *RemoteBundle) WriteChart(ctx context.Context, ch *chart.Chart) error { +func (bundle *RemoteBundle) WriteChart(ctx context.Context, ch *chart.Chart, opts helmopts.HelmOptions) error { if err := logboek.Context(ctx).LogProcess("Saving bundle %s", bundle.RegistryAddress.FullName()).DoError(func() error { - if err := bundle.BundlesRegistryClient.SaveChart(ch, bundle.RegistryAddress.Reference); err != nil { + if err := bundle.BundlesRegistryClient.SaveChart(ch, bundle.RegistryAddress.Reference, opts); err != nil { return fmt.Errorf("unable to save bundle %s to the local chart helm cache: %w", bundle.RegistryAddress.FullName(), err) } return nil @@ -66,7 +69,7 @@ } if err := logboek.Context(ctx).LogProcess("Pushing bundle %s", bundle.RegistryAddress.FullName()).DoError(func() error { - if err := bundle.BundlesRegistryClient.PushChart(bundle.RegistryAddress.Reference); err != nil { + if err := bundle.BundlesRegistryClient.PushChart(bundle.RegistryAddress.Reference, opts); err != nil { return fmt.Errorf("unable to push bundle %s: %w", bundle.RegistryAddress.FullName(), err) } return nil @@ -82,7 +85,7 @@ } func (bundle *RemoteBundle) CopyFromArchive(ctx context.Context, fromArchive *BundleArchive, opts copyToOptions) error { - ch, err := fromArchive.ReadChart(ctx) + ch, err := fromArchive.ReadChart(ctx, opts.HelmOptions) if err != nil { return fmt.Errorf("unable to read chart from the bundle archive %q: %w", fromArchive.Reader.String(), err) } @@ -141,7 +144,7 @@ } ch.Metadata.Version = sv.String() - if err := bundle.WriteChart(ctx, ch); err != nil { + if err := bundle.WriteChart(ctx, ch, opts.HelmOptions); err != nil { return fmt.Errorf("unable to write chart to remote bundle: %w", err) } @@ -149,7 +152,7 @@ } func (bundle *RemoteBundle) CopyFromRemote(ctx context.Context, fromRemote *RemoteBundle, opts copyToOptions) error { - ch, err := fromRemote.ReadChart(ctx) + ch, err := fromRemote.ReadChart(ctx, opts.HelmOptions) if err != nil { return fmt.Errorf("unable to read chart from source remote bundle: %w", err) } @@ -211,7 +214,7 @@ } ch.Metadata.Version = sv.String() - if err := bundle.WriteChart(ctx, ch); err != nil { + if err := bundle.WriteChart(ctx, ch, opts.HelmOptions); err != nil { return fmt.Errorf("unable to write chart to destination remote bundle: %w", err) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/pkg/giterminism_manager/interface.go new/werf-2.36.3/pkg/giterminism_manager/interface.go --- old/werf-2.36.1/pkg/giterminism_manager/interface.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/pkg/giterminism_manager/interface.go 2025-05-23 13:02:03.000000000 +0200 @@ -32,7 +32,7 @@ IsDockerignoreExistAnywhere(ctx context.Context, relPath string) (bool, error) ReadDockerignore(ctx context.Context, relPath string) ([]byte, error) - file.ChartFileReader + file.ChartFileReaderInterface } type Inspector interface { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/pkg/stapel/stapel.go new/werf-2.36.3/pkg/stapel/stapel.go --- old/werf-2.36.1/pkg/stapel/stapel.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/pkg/stapel/stapel.go 2025-05-23 13:02:03.000000000 +0200 @@ -3,7 +3,6 @@ import ( "context" "fmt" - "io/ioutil" "os" "path/filepath" "strconv" @@ -226,5 +225,5 @@ scriptLines = append(scriptLines, commands...) scriptData := []byte(strings.Join(scriptLines, "\n") + "\n") - return ioutil.WriteFile(path, scriptData, os.FileMode(0o667)) + return os.WriteFile(path, scriptData, os.FileMode(0o667)) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/pkg/true_git/work_tree.go new/werf-2.36.3/pkg/true_git/work_tree.go --- old/werf-2.36.1/pkg/true_git/work_tree.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/pkg/true_git/work_tree.go 2025-05-23 13:02:03.000000000 +0200 @@ -88,15 +88,34 @@ } isWorkTreeRegistered := false - if workTreeList, err := GetWorkTreeList(ctx, repoDir); err != nil { + isWorkTreePrunable := false + var dirToPrune, pruneReason string + + workTreeList, err := GetWorkTreeList(ctx, repoDir) + if err != nil { return "", fmt.Errorf("unable to get worktree list for repo %s: %w", repoDir, err) - } else { - for _, workTreeDesc := range workTreeList { - if filepath.ToSlash(workTreeDesc.Path) == filepath.ToSlash(resolvedWorkTreeDir) { - isWorkTreeRegistered = true - } + } + + for _, workTreeDesc := range workTreeList { + if filepath.ToSlash(workTreeDesc.Path) == filepath.ToSlash(resolvedWorkTreeDir) { + isWorkTreeRegistered = true + } + if workTreeDesc.Prunable { + isWorkTreePrunable = true + dirToPrune = workTreeDesc.Path + pruneReason = workTreeDesc.PruneReason } } + + if isWorkTreePrunable { + logboek.Context(ctx).Default().LogFDetails("Detected prunable worktree %s due to %s\n", dirToPrune, pruneReason) + logboek.Context(ctx).Default().LogF("Removing invalidated work tree dir %q of repo %s\n", dirToPrune, repoDir) + err := RemoveWorkTree(ctx, repoDir, dirToPrune) + if err != nil { + return "", fmt.Errorf("unable to remove worktree %q: %w", dirToPrune, err) + } + } + if !isWorkTreeRegistered { logboek.Context(ctx).Default().LogFDetails("Detected unregistered work tree dir %q of repo %s\n", workTreeDir, repoDir) } @@ -289,9 +308,11 @@ } type WorktreeDescriptor struct { - Path string - Head string - Branch string + Path string + Head string + Branch string + Prunable bool + PruneReason string } func GetWorkTreeList(ctx context.Context, repoDir string) ([]WorktreeDescriptor, error) { @@ -316,6 +337,9 @@ worktreeDesc.Head = strings.TrimPrefix(line, "HEAD ") case strings.HasPrefix(line, "branch "): worktreeDesc.Branch = strings.TrimPrefix(line, "branch ") + case strings.HasPrefix(line, "prunable "): + worktreeDesc.Prunable = true + worktreeDesc.PruneReason = strings.TrimPrefix(line, "prunable ") case line == "": res = append(res, *worktreeDesc) worktreeDesc = nil @@ -324,3 +348,8 @@ return res, nil } + +func RemoveWorkTree(ctx context.Context, repoDir, workTreeDir string) error { + removeCmd := NewGitCmd(ctx, &GitCmdOptions{RepoDir: repoDir}, "worktree", "remove", workTreeDir) + return removeCmd.Run(ctx) +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/pkg/werf/main.go new/werf-2.36.3/pkg/werf/main.go --- old/werf-2.36.1/pkg/werf/main.go 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/pkg/werf/main.go 2025-05-23 13:02:03.000000000 +0200 @@ -124,6 +124,7 @@ // TODO: options + update purgeHomeWerfFiles loader.SetLocalCacheDir(GetLocalCacheDir()) + loader.SetServiceDir(GetServiceDir()) secrets_manager.SetWerfHomeDir(GetHomeDir()) secrets_manager_legacy.WerfHomeDir = GetHomeDir() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/werf-2.36.1/trdl_channels.yaml new/werf-2.36.3/trdl_channels.yaml --- old/werf-2.36.1/trdl_channels.yaml 2025-05-20 11:21:17.000000000 +0200 +++ new/werf-2.36.3/trdl_channels.yaml 2025-05-23 13:02:03.000000000 +0200 @@ -38,7 +38,7 @@ - name: "2" channels: - name: alpha - version: 2.36.0 + version: 2.36.2 - name: beta version: 2.35.10 - name: ea ++++++ werf.obsinfo ++++++ --- /var/tmp/diff_new_pack.wuW7hw/_old 2025-05-26 18:34:04.143717108 +0200 +++ /var/tmp/diff_new_pack.wuW7hw/_new 2025-05-26 18:34:04.151717443 +0200 @@ -1,5 +1,5 @@ name: werf -version: 2.36.1 -mtime: 1747732877 -commit: 2e477824bd5c00e252c6417f8bc4cf12880dfc72 +version: 2.36.3 +mtime: 1747998123 +commit: 1751c1df12e737493462d88a9ed12fa6115e4c13