Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[preflight] Some fatal errors occurred: [ERROR]: /etc/karmada/pki/ca.crt already exists #4005

Open
chaosi-zju opened this issue Aug 25, 2023 · 1 comment
Assignees
Labels
kind/question Indicates an issue that is a support question.

Comments

@chaosi-zju
Copy link
Member

chaosi-zju commented Aug 25, 2023

Please provide an in-depth description of the question you have:

➜  karmada git:(dev) ✗ karmadactl register 172.18.0.2:32443 --token p7dp43.md2a6yso74i87juv --discovery-token-ca-cert-hash sha256:1959d34e358e1f38d0a594e3c4708aa1b9b1321c7a07615feb60338e4f5cb16c --ca-cert-path /etc/karmada/pki2/ca.crt
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
        [ERROR]: /etc/karmada/pki/ca.crt already exists

[preflight] Please check the above errors

What do you think about this question?:

Hello @lonelyCZ, do you have some time to help my question?

pkg/karmadactl/register/register.go:375

// preflight checks the deployment environment of the member cluster
func (o *CommandRegisterOption) preflight() []error {
	var errlist []error

	// check if the given file already exist
	errlist = appendError(errlist, checkFileIfExist(filepath.Join(KarmadaDir, KarmadaAgentBootstrapKubeConfigFileName)))
	errlist = appendError(errlist, checkFileIfExist(filepath.Join(KarmadaDir, KarmadaAgentKubeConfigFileName)))
	errlist = appendError(errlist, checkFileIfExist(CACertPath))

image

In above code, CACertPath is just a default const value /etc/karmada/pki/ca.crt, why if this local path exist should directly return error?

I mean, if I specified --ca-cert-path=/etc/karmada/pki/other-ca.crt, why if /etc/karmada/pki/ca.crt exist shall return error? May be is a small bug?

Much appreciate your help!

Environment:

  • Karmada version:
  • Kubernetes version:
  • Others:
@chaosi-zju chaosi-zju added the kind/question Indicates an issue that is a support question. label Aug 25, 2023
@liangyuanpeng
Copy link
Contributor

same problem with here, I guess this is to prevent the karmada agent from being deployed on the karmada apiserver.

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Indicates an issue that is a support question.
Projects
None yet
Development

No branches or pull requests

2 participants