Skip to content

Commit

Permalink
fix update image registry and repository
Browse files Browse the repository at this point in the history
Signed-off-by: KubeKyrie <shaolong.qin@daocloud.io>
  • Loading branch information
KubeKyrie committed Apr 26, 2024
1 parent 2b4af0c commit 167e039
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions internal/chart/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,16 @@ var (

// updateValuesFile performs some substitutions to a given values.yaml file.
func updateValuesFile(valuesFile string, targetRepo *api.Target) error {
if err := updateContainerImageRegistry(valuesFile, targetRepo); err != nil {
return errors.Annotatef(err, "error updating %s file", valuesFile)
if targetRepo.ContainerRegistry != "" {
if err := updateContainerImageRegistry(valuesFile, targetRepo); err != nil {
return errors.Annotatef(err, "error updating %s file", valuesFile)
}
}
if err := updateContainerImageRepository(valuesFile, targetRepo); err != nil {
return errors.Annotatef(err, "error updating %s file", valuesFile)

if targetRepo.ContainerRepository != "" {
if err := updateContainerImageRepository(valuesFile, targetRepo); err != nil {
return errors.Annotatef(err, "error updating %s file", valuesFile)
}
}
return nil
}
Expand Down

0 comments on commit 167e039

Please sign in to comment.