Skip to content

Commit

Permalink
Merge pull request #48 from DaoCloud/fix-relocate-container-images
Browse files Browse the repository at this point in the history
fix update image registry and repository
  • Loading branch information
KubeKyrie authored May 6, 2024
2 parents 2b4af0c + 167e039 commit c3c61dc
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 c3c61dc

Please sign in to comment.