Skip to content

Commit

Permalink
chore: remove rougue print and CA cert is base 64 decoded (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardcase authored Aug 5, 2020
1 parent 4f0ea92 commit a0c7778
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion pkg/flags/unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ func (b *flagBinder) Unmarshal(flagset *pflag.FlagSet, out interface{}) error {

func unmarshallFlag(flag *pflag.Flag, out reflect.Value) error {
fieldT := out.Type()
fmt.Println(fieldT.Kind())

flagValueStr := flag.Value.String()

Expand Down
8 changes: 7 additions & 1 deletion pkg/plugins/discovery/aws/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package aws

import (
"encoding/base64"
"fmt"

"k8s.io/client-go/tools/clientcmd/api"
Expand All @@ -29,11 +30,16 @@ func (p *eksClusterProvider) GetClusterConfig(ctx *provider.Context, cluster *pr
userName := fmt.Sprintf("kconnect-%s", p.identity.ProfileName)
contextName := fmt.Sprintf("%s@%s", userName, clusterName)

certData, err := base64.StdEncoding.DecodeString(*cluster.CertificateAuthorityData)
if err != nil {
return nil, fmt.Errorf("decoding certificate: %w", err)
}

cfg := &api.Config{
Clusters: map[string]*api.Cluster{
clusterName: {
Server: *cluster.ControlPlaneEndpoint,
CertificateAuthorityData: []byte(*cluster.CertificateAuthorityData),
CertificateAuthorityData: certData,
},
},
Contexts: map[string]*api.Context{
Expand Down

0 comments on commit a0c7778

Please sign in to comment.