Skip to content

Commit

Permalink
fix: do not set default image registry (#114)
Browse files Browse the repository at this point in the history
(cherry picked from commit 5df7e8a)
  • Loading branch information
1aal committed Dec 15, 2023
1 parent f5649fc commit 73b949b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pkg/cmd/addon/addon.go
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,9 @@ func (o *addonCmdOpts) buildHelmPatch(result map[string]interface{}) error {
helmSpec.InstallValues.SetValues = o.addonEnableFlags.SetValues
}
// set resource registry
helmSpec.InstallValues.SetValues = append(helmSpec.InstallValues.SetValues, fmt.Sprintf("%s=%s", types.ImageRegistryKey, viper.Get(types.CfgKeyImageRegistry)))
if viper.Get(types.CfgKeyImageRegistry) != "" {
helmSpec.InstallValues.SetValues = append(helmSpec.InstallValues.SetValues, fmt.Sprintf("%s=%s", types.ImageRegistryKey, viper.Get(types.CfgKeyImageRegistry)))
}

b, err := json.Marshal(&helmSpec)
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion pkg/cmd/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ func initConfig() {
viper.SetDefault(types.CfgKeyClusterDefaultMemory, "1Gi")

viper.SetDefault(types.CfgKeyHelmRepoURL, "")
viper.SetDefault(types.CfgKeyImageRegistry, "infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com")
// If a config file is found, read it in.
if err := viper.ReadInConfig(); err == nil {
fmt.Fprintln(os.Stderr, "Using config file:", viper.ConfigFileUsed())
Expand Down

0 comments on commit 73b949b

Please sign in to comment.