Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

Commit

Permalink
Encode secret and use labels not annotations
Browse files Browse the repository at this point in the history
Signed-off-by: Chuck Ha <[email protected]>
  • Loading branch information
chuckha committed Jun 18, 2019
1 parent 910842b commit 1b3b34b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 5 additions & 4 deletions capkactuators/actuators.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package capkactuators

import (
"encoding/base64"
"fmt"
"io/ioutil"

Expand All @@ -42,8 +43,8 @@ func getKindName(machine *clusterv1.Machine) string {

func getRole(machine *clusterv1.Machine) string {
// Figure out what kind of node we're making
annotations := machine.GetAnnotations()
setValue, ok := annotations["set"]
labels := machine.GetLabels()
setValue, ok := labels["set"]
if !ok {
setValue = constants.WorkerNodeRoleValue
}
Expand Down Expand Up @@ -106,8 +107,8 @@ func kubeconfigToSecret(clusterName, namespace string) (*v1.Secret, error) {
Name: fmt.Sprintf("kubeconfig-%s", clusterName),
Namespace: namespace,
},
Data: map[string][]byte{
"kubeconfig": data,
StringData: map[string]string{
"kubeconfig": base64.StdEncoding.EncodeToString(data),
},
}, nil
}
4 changes: 1 addition & 3 deletions cmd/capkctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ func machineYAML(opts *machineOptions) string {
Namespace: *opts.namespace,
Labels: map[string]string{
"cluster.k8s.io/cluster-name": *opts.clusterName,
},
Annotations: map[string]string{
"set": *opts.set,
"set": *opts.set,
},
},
Spec: v1alpha1.MachineSpec{
Expand Down

0 comments on commit 1b3b34b

Please sign in to comment.