mirror of https://github.com/kubernetes/kops.git
Fix nilpointer in create_kubecfg.go
This commit is contained in:
parent
b2573a1382
commit
b19ee16b09
|
@ -86,7 +86,7 @@ func BuildKubecfg(cluster *kops.Cluster, keyStore fi.Keystore, secretStore fi.Se
|
||||||
b.Context = clusterName
|
b.Context = clusterName
|
||||||
|
|
||||||
// add the CA Cert to the kubeconfig only if we didn't specify a SSL cert for the LB
|
// add the CA Cert to the kubeconfig only if we didn't specify a SSL cert for the LB
|
||||||
if cluster.Spec.API.LoadBalancer.SSLCertificate == "" {
|
if cluster.Spec.API == nil || cluster.Spec.API.LoadBalancer == nil || cluster.Spec.API.LoadBalancer.SSLCertificate == "" {
|
||||||
cert, _, _, err := keyStore.FindKeypair(fi.CertificateId_CA)
|
cert, _, _, err := keyStore.FindKeypair(fi.CertificateId_CA)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error fetching CA keypair: %v", err)
|
return nil, fmt.Errorf("error fetching CA keypair: %v", err)
|
||||||
|
|
Loading…
Reference in New Issue