Skip to content

Commit

Permalink
Fix bugs about karmada-data dir lost
Browse files Browse the repository at this point in the history
Signed-off-by: jwcesign <jiangwei115@huawei.com>
  • Loading branch information
jwcesign committed Sep 20, 2022
1 parent d81f0ff commit 7cb0b4f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/karmadactl/cmdinit/kubernetes/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,17 @@ func (i *CommandInitOption) Complete() error {
}

// Determine whether KarmadaDataPath exists, if so, delete it
// Related issue: https://github.com/karmada-io/karmada/pull/1455
// When the current host uses init to install karmada multiple times, the installation fails
// because the data directory of karmada is not empty.
if utils.IsExist(i.KarmadaDataPath) {
if err := os.RemoveAll(i.KarmadaDataPath); err != nil {
return err
}
}

return nil
// Create this dir, next steps will download crds to this dir
return os.MkdirAll(i.KarmadaDataPath, 0755)
}

// genCerts create ca etcd karmada cert
Expand Down

0 comments on commit 7cb0b4f

Please sign in to comment.