From 14a527dc3d4f71a798c5585e15b1325731082672 Mon Sep 17 00:00:00 2001 From: Pawel Krupa Date: Mon, 10 Sep 2018 13:30:35 +0200 Subject: [PATCH 1/3] lint yaml --- examples/addons.yaml | 4 ++-- examples/machine-set.yaml | 22 +++++++++--------- examples/machine-with-filters.yaml | 12 +++++----- examples/machine-with-user-data.yaml | 22 +++++++++--------- examples/machine.yaml | 22 +++++++++--------- examples/master-machine.yaml | 22 +++++++++--------- examples/provider-components.yml | 34 ++++++++++++++-------------- examples/worker-machine.yaml | 22 +++++++++--------- 8 files changed, 80 insertions(+), 80 deletions(-) diff --git a/examples/addons.yaml b/examples/addons.yaml index 160202c2fb..59a93edce1 100644 --- a/examples/addons.yaml +++ b/examples/addons.yaml @@ -10,5 +10,5 @@ metadata: namespace: test type: Opaque data: - awsAccessKeyId: - awsSecretAccessKey: + awsAccessKeyId: + awsSecretAccessKey: diff --git a/examples/machine-set.yaml b/examples/machine-set.yaml index 382581834e..0c46be6874 100644 --- a/examples/machine-set.yaml +++ b/examples/machine-set.yaml @@ -50,16 +50,16 @@ spec: id: openshift_master_launch_instances keyName: libra tags: - - name: openshift-node-group-config - value: node-config-master - - name: host-type - value: master - - name: sub-host-type - value: default + - name: openshift-node-group-config + value: node-config-master + - name: host-type + value: master + - name: sub-host-type + value: default securityGroups: - - id: sg-00868b02fbe29de17 - - id: sg-0a4658991dc5eb40a - - id: sg-009a70e28fa4ba84e - - id: sg-07323d56fb932c84c - - id: sg-08b1ffd32874d59a2 + - id: sg-00868b02fbe29de17 + - id: sg-0a4658991dc5eb40a + - id: sg-009a70e28fa4ba84e + - id: sg-07323d56fb932c84c + - id: sg-08b1ffd32874d59a2 publicIP: true diff --git a/examples/machine-with-filters.yaml b/examples/machine-with-filters.yaml index a7d279e37d..389342d4c0 100644 --- a/examples/machine-with-filters.yaml +++ b/examples/machine-with-filters.yaml @@ -30,13 +30,13 @@ spec: id: meh-master-profile keyName: tectonic tags: - - name: "kubernetes.io/cluster/meh" - value: owned + - name: "kubernetes.io/cluster/meh" + value: owned securityGroups: - - filters: - - name: "tag:Name" - values: - - "meh_worker_sg" + - filters: + - name: "tag:Name" + values: + - "meh_worker_sg" userDataSecret: name: ignition-worker versions: diff --git a/examples/machine-with-user-data.yaml b/examples/machine-with-user-data.yaml index b292e2cdb9..ad0142f5d3 100644 --- a/examples/machine-with-user-data.yaml +++ b/examples/machine-with-user-data.yaml @@ -36,18 +36,18 @@ spec: id: openshift_master_launch_instances keyName: libra tags: - - name: openshift-node-group-config - value: node-config-master - - name: host-type - value: master - - name: sub-host-type - value: default + - name: openshift-node-group-config + value: node-config-master + - name: host-type + value: master + - name: sub-host-type + value: default securityGroups: - - id: sg-00868b02fbe29de17 - - id: sg-0a4658991dc5eb40a - - id: sg-009a70e28fa4ba84e - - id: sg-07323d56fb932c84c - - id: sg-08b1ffd32874d59a2 + - id: sg-00868b02fbe29de17 + - id: sg-0a4658991dc5eb40a + - id: sg-009a70e28fa4ba84e + - id: sg-07323d56fb932c84c + - id: sg-08b1ffd32874d59a2 publicIp: true userDataSecret: name: aws-actuator-user-data-secret diff --git a/examples/machine.yaml b/examples/machine.yaml index 82d0155a75..a51aa3188d 100644 --- a/examples/machine.yaml +++ b/examples/machine.yaml @@ -38,18 +38,18 @@ spec: id: openshift_master_launch_instances keyName: libra tags: - - name: openshift-node-group-config - value: node-config-master - - name: host-type - value: master - - name: sub-host-type - value: default + - name: openshift-node-group-config + value: node-config-master + - name: host-type + value: master + - name: sub-host-type + value: default securityGroups: - - id: sg-00868b02fbe29de17 - - id: sg-0a4658991dc5eb40a - - id: sg-009a70e28fa4ba84e - - id: sg-07323d56fb932c84c - - id: sg-08b1ffd32874d59a2 + - id: sg-00868b02fbe29de17 + - id: sg-0a4658991dc5eb40a + - id: sg-009a70e28fa4ba84e + - id: sg-07323d56fb932c84c + - id: sg-08b1ffd32874d59a2 publicIp: true versions: kubelet: 1.10.1 diff --git a/examples/master-machine.yaml b/examples/master-machine.yaml index dbc352598e..22b876862e 100644 --- a/examples/master-machine.yaml +++ b/examples/master-machine.yaml @@ -36,18 +36,18 @@ spec: id: openshift_master_launch_instances keyName: libra tags: - - name: openshift-node-group-config - value: node-config-master - - name: host-type - value: master - - name: sub-host-type - value: default + - name: openshift-node-group-config + value: node-config-master + - name: host-type + value: master + - name: sub-host-type + value: default securityGroups: - - id: sg-00868b02fbe29de17 - - id: sg-0a4658991dc5eb40a - - id: sg-009a70e28fa4ba84e - - id: sg-07323d56fb932c84c - - id: sg-08b1ffd32874d59a2 + - id: sg-00868b02fbe29de17 + - id: sg-0a4658991dc5eb40a + - id: sg-009a70e28fa4ba84e + - id: sg-07323d56fb932c84c + - id: sg-08b1ffd32874d59a2 publicIp: true userDataSecret: name: aws-actuator-master-user-data-secret diff --git a/examples/provider-components.yml b/examples/provider-components.yml index c593c7fe15..2518008574 100644 --- a/examples/provider-components.yml +++ b/examples/provider-components.yml @@ -28,10 +28,10 @@ spec: - name: controller-manager image: gcr.io/k8s-cluster-api/controller-manager:0.0.7 volumeMounts: - - name: config - mountPath: /etc/kubernetes - - name: certs - mountPath: /etc/ssl/certs + - name: config + mountPath: /etc/kubernetes + - name: certs + mountPath: /etc/ssl/certs command: - "./controller-manager" args: @@ -46,22 +46,22 @@ spec: - name: aws-machine-controller image: gcr.io/k8s-cluster-api/aws-machine-controller:0.0.1 volumeMounts: - - name: config - mountPath: /etc/kubernetes - - name: certs - mountPath: /etc/ssl/certs - - name: kubeadm - mountPath: /usr/bin/kubeadm + - name: config + mountPath: /etc/kubernetes + - name: certs + mountPath: /etc/ssl/certs + - name: kubeadm + mountPath: /usr/bin/kubeadm env: - - name: NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName command: - - /machine-controller + - /machine-controller args: - - --log-level=debug - - --kubeconfig=/etc/kubernetes/admin.conf + - --log-level=debug + - --kubeconfig=/etc/kubernetes/admin.conf resources: requests: cpu: 100m diff --git a/examples/worker-machine.yaml b/examples/worker-machine.yaml index 6192b25ea0..b592fce9f9 100644 --- a/examples/worker-machine.yaml +++ b/examples/worker-machine.yaml @@ -34,18 +34,18 @@ spec: id: openshift_master_launch_instances keyName: libra tags: - - name: openshift-node-group-config - value: node-config-worker - - name: host-type - value: worker - - name: sub-host-type - value: default + - name: openshift-node-group-config + value: node-config-worker + - name: host-type + value: worker + - name: sub-host-type + value: default securityGroups: - - id: sg-00868b02fbe29de17 - - id: sg-0a4658991dc5eb40a - - id: sg-009a70e28fa4ba84e - - id: sg-07323d56fb932c84c - - id: sg-08b1ffd32874d59a2 + - id: sg-00868b02fbe29de17 + - id: sg-0a4658991dc5eb40a + - id: sg-009a70e28fa4ba84e + - id: sg-07323d56fb932c84c + - id: sg-08b1ffd32874d59a2 publicIp: true userDataSecret: name: aws-actuator-node-user-data-secret From 85a13095ea9139b6e6d54a100d8b19efc1e12973 Mon Sep 17 00:00:00 2001 From: Pawel Krupa Date: Mon, 10 Sep 2018 13:34:31 +0200 Subject: [PATCH 2/3] make go-fmt happy --- cloud/aws/actuators/machine/actuator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/aws/actuators/machine/actuator.go b/cloud/aws/actuators/machine/actuator.go index 9ef6a4c43f..c4e8babc71 100644 --- a/cloud/aws/actuators/machine/actuator.go +++ b/cloud/aws/actuators/machine/actuator.go @@ -104,7 +104,7 @@ func (a *Actuator) removeStoppedMachine(machine *clusterv1.Machine, client awscl return TerminateInstances(client, instances, mLog) } -func buildEc2Filters(inputFilters []providerconfigv1.Filter) []*ec2.Filter{ +func buildEc2Filters(inputFilters []providerconfigv1.Filter) []*ec2.Filter { filters := make([]*ec2.Filter, len(inputFilters)) for i, f := range inputFilters { values := make([]*string, len(f.Values)) From e99c5d53e2c3410ea12b0daec1a6bfefecdbbdd7 Mon Sep 17 00:00:00 2001 From: Pawel Krupa Date: Mon, 10 Sep 2018 14:01:36 +0200 Subject: [PATCH 3/3] fix some golint suggestions --- cloud/aws/actuators/machine/utils.go | 2 +- cmd/aws-actuator/main.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cloud/aws/actuators/machine/utils.go b/cloud/aws/actuators/machine/utils.go index c764fc1877..1531a64522 100644 --- a/cloud/aws/actuators/machine/utils.go +++ b/cloud/aws/actuators/machine/utils.go @@ -183,7 +183,7 @@ func TerminateInstances(client awsclient.Client, instances []*ec2.Instance, mLog return nil } -// MachineConfigProviderFromClusterAPIMachineSpec gets the machine provider config MachineSetSpec from the +// MachineProviderFromClusterAPIMachineSpec gets the machine provider config MachineSetSpec from the // specified cluster-api MachineSpec. func MachineProviderConfigFromClusterAPIMachineSpec(ms *clusterv1.MachineSpec) (*providerconfigv1.AWSMachineProviderConfig, error) { if ms.ProviderConfig.Value == nil { diff --git a/cmd/aws-actuator/main.go b/cmd/aws-actuator/main.go index 4592c53afd..60f199871b 100644 --- a/cmd/aws-actuator/main.go +++ b/cmd/aws-actuator/main.go @@ -214,7 +214,7 @@ cat < /etc/default/kubelet KUBELET_KUBEADM_EXTRA_ARGS=--cgroup-driver=systemd EOF -kubeadm join {{ .MasterIp }}:8443 --token 2iqzqm.85bs0x6miyx1nm7l --discovery-token-unsafe-skip-ca-verification +kubeadm join {{ .MasterIP }}:8443 --token 2iqzqm.85bs0x6miyx1nm7l --discovery-token-unsafe-skip-ca-verification HEREDOC @@ -222,12 +222,12 @@ bash /root/user-data.sh > /root/user-data.logs ` type userDataParams struct { - MasterIp string + MasterIP string } func generateWorkerUserData(masterIp string, workerUserDataSecret *apiv1.Secret) (*apiv1.Secret, error) { params := userDataParams{ - MasterIp: masterIp, + MasterIP: masterIp, } t, err := template.New("workeruserdata").Parse(workerUserDataBlob) if err != nil {