diff --git a/tools/kubernetes.go b/tools/kubernetes.go index 25715d1..b482452 100644 --- a/tools/kubernetes.go +++ b/tools/kubernetes.go @@ -35,12 +35,16 @@ type KubernetesService struct { } func NewDynamicClient(host string, ca string, cert string, data string) (*dynamic.DynamicClient, error) { + decodedCa, _ := base64.StdEncoding.DecodeString(ca) + decodedCert, _ := base64.StdEncoding.DecodeString(cert) + decodedKey, _ := base64.StdEncoding.DecodeString(data) + config := &rest.Config{ Host: host, TLSClientConfig: rest.TLSClientConfig{ - CAData: []byte(ca), - CertData: []byte(cert), - KeyData: []byte(data), + CAData: []byte(decodedCa), + CertData: []byte(decodedCert), + KeyData: []byte(decodedKey), }, }