diff --git a/kubectl-plugin/config/migrate.go b/kubectl-plugin/config/migrate.go index 004c678..e1eeca8 100644 --- a/kubectl-plugin/config/migrate.go +++ b/kubectl-plugin/config/migrate.go @@ -55,7 +55,13 @@ func (o *migrateOption) runE(cmd *cobra.Command, args []string) (err error) { } var password string - if password, err = o.getDevOpsPassword(); err == nil { + if password, err = o.getDevOpsPassword(); password == "" { + if err == nil { + err = fmt.Errorf("the password of Jenkins is empty") + } else { + err = fmt.Errorf("the password of Jenkins is empty, it might caused by: %v", err) + } + } else if err == nil { err = o.updateKubeSphereConfig("devops-config", o.namespace, map[string]interface{}{ "password": password, })