Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Fix error when running kube commands with public API
Browse files Browse the repository at this point in the history
When running tarmak kubeconfig/kubectl with a public ELB in front of apiserver, it gives errors. This comes down to not setting the certificate. This fixes that.

Signed-off-by: Mattias Gees <mattias.gees@gmail.com>
  • Loading branch information
MattiasGees committed Dec 13, 2018
1 parent 396c019 commit 38c9671
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/tarmak/kubectl/kubectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,8 @@ func (k *Kubectl) setupConfig(c *api.Config, publicAPIEndpoint bool) (*api.Confi
}

// check if certificates are set
if !publicAPIEndpoint &&
(len(authInfo.ClientCertificateData) == 0 || len(authInfo.ClientKeyData) == 0 ||
len(cluster.CertificateAuthorityData) == 0) {
if len(authInfo.ClientCertificateData) == 0 || len(authInfo.ClientKeyData) == 0 ||
len(cluster.CertificateAuthorityData) == 0 {

if err := k.tarmak.Terraform().Prepare(k.tarmak.Environment().Hub()); err != nil {
return nil, nil, fmt.Errorf("failed to prepare terraform: %s", err)
Expand Down

0 comments on commit 38c9671

Please sign in to comment.