mirror of
https://github.com/rancher/rke.git
synced 2025-09-01 15:06:23 +00:00
Remove dead code
This commit is contained in:
committed by
Alena Prokharchyk
parent
8022b815b3
commit
ad678b6a32
@@ -12,7 +12,6 @@ import (
|
||||
"github.com/rancher/rke/pki"
|
||||
"github.com/rancher/rke/pki/cert"
|
||||
"github.com/rancher/rke/services"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func SetUpAuthentication(ctx context.Context, kubeCluster, currentCluster *Cluster, fullState *FullState) error {
|
||||
@@ -24,20 +23,6 @@ func SetUpAuthentication(ctx context.Context, kubeCluster, currentCluster *Clust
|
||||
return nil
|
||||
}
|
||||
|
||||
func regenerateAPICertificate(c *Cluster, certificates map[string]pki.CertificatePKI) (map[string]pki.CertificatePKI, error) {
|
||||
logrus.Debugf("[certificates] Regenerating kubeAPI certificate")
|
||||
kubeAPIAltNames := pki.GetAltNames(c.ControlPlaneHosts, c.ClusterDomain, c.KubernetesServiceIP, c.Authentication.SANs)
|
||||
caCrt := certificates[pki.CACertName].Certificate
|
||||
caKey := certificates[pki.CACertName].Key
|
||||
kubeAPIKey := certificates[pki.KubeAPICertName].Key
|
||||
kubeAPICert, _, err := pki.GenerateSignedCertAndKey(caCrt, caKey, true, pki.KubeAPICertName, kubeAPIAltNames, kubeAPIKey, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
certificates[pki.KubeAPICertName] = pki.ToCertObject(pki.KubeAPICertName, "", "", kubeAPICert, kubeAPIKey, nil)
|
||||
return certificates, nil
|
||||
}
|
||||
|
||||
func GetClusterCertsFromKubernetes(ctx context.Context, kubeCluster *Cluster) (map[string]pki.CertificatePKI, error) {
|
||||
log.Infof(ctx, "[certificates] Getting Cluster certificates from Kubernetes")
|
||||
|
||||
@@ -132,24 +117,6 @@ func (c *Cluster) getBackupHosts() []*hosts.Host {
|
||||
return backupHosts
|
||||
}
|
||||
|
||||
func regenerateAPIAggregationCerts(c *Cluster, certificates map[string]pki.CertificatePKI) (map[string]pki.CertificatePKI, error) {
|
||||
logrus.Debugf("[certificates] Regenerating Kubernetes API server aggregation layer requestheader client CA certificates")
|
||||
requestHeaderCACrt, requestHeaderCAKey, err := pki.GenerateCACertAndKey(pki.RequestHeaderCACertName, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
certificates[pki.RequestHeaderCACertName] = pki.ToCertObject(pki.RequestHeaderCACertName, "", "", requestHeaderCACrt, requestHeaderCAKey, nil)
|
||||
|
||||
//generate API server proxy client key and certs
|
||||
logrus.Debugf("[certificates] Regenerating Kubernetes API server proxy client certificates")
|
||||
apiserverProxyClientCrt, apiserverProxyClientKey, err := pki.GenerateSignedCertAndKey(requestHeaderCACrt, requestHeaderCAKey, true, pki.APIProxyClientCertName, nil, nil, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
certificates[pki.APIProxyClientCertName] = pki.ToCertObject(pki.APIProxyClientCertName, "", "", apiserverProxyClientCrt, apiserverProxyClientKey, nil)
|
||||
return certificates, nil
|
||||
}
|
||||
|
||||
func RotateRKECertificates(ctx context.Context, c *Cluster, flags ExternalFlags, clusterState *FullState) error {
|
||||
var (
|
||||
serviceAccountTokenKey string
|
||||
|
Reference in New Issue
Block a user