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

Commit 1b3b34b

Browse files
committed
Encode secret and use labels not annotations
Signed-off-by: Chuck Ha <[email protected]>
1 parent 910842b commit 1b3b34b

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

capkactuators/actuators.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package capkactuators
1818

1919
import (
20+
"encoding/base64"
2021
"fmt"
2122
"io/ioutil"
2223

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

4344
func getRole(machine *clusterv1.Machine) string {
4445
// Figure out what kind of node we're making
45-
annotations := machine.GetAnnotations()
46-
setValue, ok := annotations["set"]
46+
labels := machine.GetLabels()
47+
setValue, ok := labels["set"]
4748
if !ok {
4849
setValue = constants.WorkerNodeRoleValue
4950
}
@@ -106,8 +107,8 @@ func kubeconfigToSecret(clusterName, namespace string) (*v1.Secret, error) {
106107
Name: fmt.Sprintf("kubeconfig-%s", clusterName),
107108
Namespace: namespace,
108109
},
109-
Data: map[string][]byte{
110-
"kubeconfig": data,
110+
StringData: map[string]string{
111+
"kubeconfig": base64.StdEncoding.EncodeToString(data),
111112
},
112113
}, nil
113114
}

cmd/capkctl/main.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,7 @@ func machineYAML(opts *machineOptions) string {
148148
Namespace: *opts.namespace,
149149
Labels: map[string]string{
150150
"cluster.k8s.io/cluster-name": *opts.clusterName,
151-
},
152-
Annotations: map[string]string{
153-
"set": *opts.set,
151+
"set": *opts.set,
154152
},
155153
},
156154
Spec: v1alpha1.MachineSpec{

0 commit comments

Comments
 (0)