Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
259 changes: 139 additions & 120 deletions go.mod

Large diffs are not rendered by default.

500 changes: 308 additions & 192 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/cmd/cluster/config_edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func (o *editConfigOptions) confirmReconfigure(promptStr string) (bool, error) {
const noStr = "no"

confirmStr := []string{yesStr, noStr}
printer.Warning(o.CreateOptions.Out, promptStr)
printer.Warning(o.CreateOptions.Out, "%s", promptStr)
input, err := prompt.NewPrompt("Please type [Yes/No] to confirm:",
func(input string) error {
if !slices.Contains(confirmStr, strings.ToLower(input)) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/cluster/config_ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (o *configOpsOptions) confirmReconfigureWithRestart() error {
return nil
}
const confirmStr = "yes"
printer.Warning(o.Out, restartConfirmPrompt)
printer.Warning(o.Out, "%s", restartConfirmPrompt)
_, err := prompt.NewPrompt(fmt.Sprintf("Please type \"%s\" to confirm:", confirmStr),
func(input string) error {
if input != confirmStr {
Expand All @@ -228,7 +228,7 @@ func (o *configOpsOptions) confirmReconfigureWithRestart() error {

func (o *configOpsOptions) parseUpdatedParams() (map[string]string, error) {
if len(o.Parameters) == 0 && len(o.LocalFilePath) == 0 {
return nil, core.MakeError(missingUpdatedParametersErrMessage)
return nil, core.MakeError("%s", missingUpdatedParametersErrMessage)
}

keyValues := make(map[string]string)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/cluster/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ func makeNotFoundConfigFileErr(configFile, configSpec string, all []string) erro
}

func makeMissingClusterNameErr() error {
return cfgcore.MakeError(missingClusterArgErrMassage)
return cfgcore.MakeError("%s", missingClusterArgErrMassage)
}
2 changes: 1 addition & 1 deletion pkg/cmd/kubeblocks/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ func checkResources(dynamic dynamic.Interface) error {
for k, v := range crs {
errMsg.WriteString(fmt.Sprintf(" %s: %s\n", k, strings.Join(v, " ")))
}
return errors.Errorf(errMsg.String())
return errors.New(errMsg.String())
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/playground/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (o *destroyOptions) destroyCloud() error {
// kubeconfig and context, otherwise, it will delete the wrong cluster.
if err = o.deleteClustersAndUninstallKB(); err != nil {
if strings.Contains(err.Error(), kubeClusterUnreachableErr.Error()) {
printer.Warning(o.Out, err.Error())
printer.Warning(o.Out, "%s", err.Error())
} else {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/playground/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ func (o *initOptions) installKubeBlocks(k8sClusterName string) error {
// if the KubeBlocks has been installed, we ignore the error
errMsg := err.Error()
if strings.Contains(errMsg, "repeated installation is not supported") {
fmt.Fprintf(o.Out, strings.Split(errMsg, ",")[0]+"\n")
fmt.Fprintf(o.Out, "%s", strings.Split(errMsg, ",")[0]+"\n")
return nil
}
return err
Expand Down Expand Up @@ -588,7 +588,7 @@ func (o *initOptions) checkExistedCluster() error {
// if cloud provider is not same with the existed cluster cloud provider, suggest
// user to destroy the previous cluster first
if o.prevCluster.CloudProvider != o.cloudProvider {
printer.Warning(o.Out, warningMsg)
printer.Warning(o.Out, "%s", warningMsg)
return cmdutil.ErrExit
}

Expand All @@ -600,7 +600,7 @@ func (o *initOptions) checkExistedCluster() error {
// is same with the new cluster region, if not, suggest user to destroy the previous
// cluster first
if o.prevCluster.Region != o.region {
printer.Warning(o.Out, warningMsg)
printer.Warning(o.Out, "%s", warningMsg)
return cmdutil.ErrExit
}
return nil
Expand Down