Skip to content

Commit

Permalink
fix(deploy): bundle publish panics if remote dependencies cache not…
Browse files Browse the repository at this point in the history
… up to date

Signed-off-by: Ilya Lesikov <ilya@lesikov.com>
  • Loading branch information
ilya-lesikov committed Jan 30, 2025
1 parent 78ec2b2 commit 9ad3e33
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cmd/werf/bundle/publish/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/werf/3p-helm/pkg/chart/loader"
"github.com/werf/3p-helm/pkg/chartutil"
"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/secrets"
Expand Down Expand Up @@ -303,6 +304,11 @@ func runPublish(ctx context.Context, imageNameListFromArgs []string) error {
logboek.LogOptionalLn()
}

helmRegistryClient, err := common.NewHelmRegistryClient(ctx, *commonCmdData.DockerConfig, *commonCmdData.InsecureHelmDependencies)
if err != nil {
return err
}

bundlesRegistryClient, err := common.NewBundlesRegistryClient(ctx, &commonCmdData)
if err != nil {
return err
Expand Down Expand Up @@ -387,6 +393,19 @@ func runPublish(ctx context.Context, imageNameListFromArgs []string) error {
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,
}
loader.SetChartPathFunc = downloader.SetChartPath
loader.DepsBuildFunc = downloader.Build

bundle, err := createNewBundle(
ctx,
wc,
Expand Down

0 comments on commit 9ad3e33

Please sign in to comment.