From 5616d45c2cd4fb66fb17ed8558a0d7b02fe47c86 Mon Sep 17 00:00:00 2001 From: "kay.yan" Date: Mon, 25 Apr 2022 11:48:53 +0800 Subject: [PATCH] ContainerRegistry --- api/config.go | 12 ++++++------ internal/chart/sync.go | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/api/config.go b/api/config.go index 0b36b4e2..433fc138 100644 --- a/api/config.go +++ b/api/config.go @@ -21,12 +21,12 @@ func (c *Config) Validate() error { } case Kind_LOCAL: } - if c.GetTarget().GetContainerRegistry() == "" { - return errors.Errorf(`"target.containerRegistry" cannot be empty`) - } - if c.GetTarget().GetContainerRepository() == "" { - return errors.Errorf(`"target.containerRepository" cannot be empty`) - } + // if c.GetTarget().GetContainerRegistry() == "" { + // return errors.Errorf(`"target.containerRegistry" cannot be empty`) + // } + // if c.GetTarget().GetContainerRepository() == "" { + // return errors.Errorf(`"target.containerRepository" cannot be empty`) + // } } // Authentication diff --git a/internal/chart/sync.go b/internal/chart/sync.go index 250f909b..b245312e 100644 --- a/internal/chart/sync.go +++ b/internal/chart/sync.go @@ -14,6 +14,11 @@ import ( // repo to the target repo func ChangeReferences(chartPath, name, version string, source *api.Source, target *api.Target) error { // Update values*.yaml + if target.GetContainerRegistry() == "" && target.GetContainerRepository() == "" { + // Skip modify value.yaml and readme + return nil + } + for _, f := range []string{ path.Join(chartPath, ValuesFilename), path.Join(chartPath, ValuesProductionFilename),