Skip to content

Commit

Permalink
fix: wrong endpoint in generated hub cluster config (#609)
Browse files Browse the repository at this point in the history
## What type of PR is this?

/kind bug

## What this PR does / why we need it:

Fix wrong endpoint in generated hub cluster config:


![image](https://github.com/user-attachments/assets/4fd9b90b-fd34-43c0-8043-92ea191bfe9c)

And fix #608
  • Loading branch information
elliotxx authored Aug 29, 2024
1 parent 551e9f0 commit 2f462cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/util/certgenerator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const hubClusterKubeConfigTemplate = `apiVersion: v1
clusters:
- cluster:
insecure-skip-tls-verify: true
server: https://127.0.0.1:7443
server: karpor-server.%s.svc:7443
name: karpor
contexts:
- context:
Expand Down Expand Up @@ -189,5 +189,5 @@ func generateAdminKubeconfig(namespace string, cert *x509.Certificate, key crypt
if err != nil {
return "", fmt.Errorf("unable to marshal private key to PEM %s", err)
}
return fmt.Sprintf(hubClusterKubeConfigTemplate, base64.StdEncoding.EncodeToString(certData), base64.StdEncoding.EncodeToString(keyData)), nil
return fmt.Sprintf(hubClusterKubeConfigTemplate, namespace, base64.StdEncoding.EncodeToString(certData), base64.StdEncoding.EncodeToString(keyData)), nil
}

0 comments on commit 2f462cf

Please sign in to comment.