Skip to content

Commit 2dc40c4

Browse files
[CI] [fix]: run yamllint as part of build_test_ci workflow, fix whitespace/indentation issues (#329)
* run yamllint as part of build_test_ci workflow * try workaround from https://github.com/release-drafter/release-drafter/issues/1125\#issuecomment-1471142225 * format yaml so it passes yamllint
1 parent ccdda60 commit 2dc40c4

File tree

17 files changed

+93
-82
lines changed

17 files changed

+93
-82
lines changed

.github/workflows/build_test_ci.yml

+9
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ jobs:
4343
- '!**/**.md'
4444
- '!docs/**'
4545
46+
yamllint:
47+
runs-on: ubuntu-latest
48+
needs: changes
49+
if: ${{ needs.changes.outputs.src == 'true' }}
50+
steps:
51+
- uses: actions/checkout@v4
52+
- name: Validate YAML file
53+
run: yamllint templates
54+
4655
go-build-test:
4756
runs-on: ubuntu-latest
4857
needs: changes

.github/workflows/release-drafter.yml

+2
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- uses: release-drafter/release-drafter@v6
23+
with:
24+
commitish: main
2325
env:
2426
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.yamllint

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
extends: default
3+
4+
rules:
5+
line-length: disable
6+
document-start: disable
7+
new-line-at-end-of-file: disable

templates/addons/cilium/cilium.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ spec:
2525
egressMasqueradeInterfaces: eth0
2626
policyAuditMode: ${FW_AUDIT_ONLY:=true}
2727
hostFirewall:
28-
enabled: true
28+
enabled: true
2929
extraConfig:
3030
allow-localhost: policy
3131
k8sServiceHost: {{ .InfraCluster.spec.controlPlaneEndpoint.host }}

templates/addons/cluster-autoscaler/cluster-autoscaler.yaml

+29-36
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,26 @@ spec:
1616
app: ${CLUSTER_NAME}-cluster-autoscaler
1717
spec:
1818
containers:
19-
- image: registry.k8s.io/autoscaling/cluster-autoscaler:${CLUSTER_AUTOSCALER_VERSION}
20-
name: cluster-autoscaler
21-
command:
22-
- /cluster-autoscaler
23-
args:
24-
- --cloud-provider=clusterapi
25-
- --kubeconfig=/mnt/kubeconfig/value
26-
- --clusterapi-cloud-config-authoritative
27-
- --node-group-auto-discovery=clusterapi:namespace=${NAMESPACE},clusterName=${CLUSTER_NAME}
28-
# See: https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#my-cluster-is-below-minimum--above-maximum-number-of-nodes-but-ca-did-not-fix-that-why
29-
- --enforce-node-group-min-size
30-
volumeMounts:
31-
- name: kubeconfig
32-
readOnly: true
33-
mountPath: /mnt/kubeconfig/
19+
- image: registry.k8s.io/autoscaling/cluster-autoscaler:${CLUSTER_AUTOSCALER_VERSION}
20+
name: cluster-autoscaler
21+
command: [/cluster-autoscaler]
22+
args:
23+
- --cloud-provider=clusterapi
24+
- --kubeconfig=/mnt/kubeconfig/value
25+
- --clusterapi-cloud-config-authoritative
26+
- --node-group-auto-discovery=clusterapi:namespace=${NAMESPACE},clusterName=${CLUSTER_NAME}
27+
# See: https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#my-cluster-is-below-minimum--above-maximum-number-of-nodes-but-ca-did-not-fix-that-why
28+
- --enforce-node-group-min-size
29+
volumeMounts:
30+
- name: kubeconfig
31+
readOnly: true
32+
mountPath: /mnt/kubeconfig/
3433
serviceAccountName: ${CLUSTER_NAME}-cluster-autoscaler
3534
terminationGracePeriodSeconds: 10
3635
volumes:
37-
- name: kubeconfig
38-
secret:
39-
secretName: ${CLUSTER_NAME}-kubeconfig
36+
- name: kubeconfig
37+
secret:
38+
secretName: ${CLUSTER_NAME}-kubeconfig
4039
---
4140
kind: RoleBinding
4241
apiVersion: rbac.authorization.k8s.io/v1
@@ -47,8 +46,8 @@ roleRef:
4746
kind: Role
4847
name: ${CLUSTER_NAME}-cluster-autoscaler
4948
subjects:
50-
- kind: ServiceAccount
51-
name: ${CLUSTER_NAME}-cluster-autoscaler
49+
- kind: ServiceAccount
50+
name: ${CLUSTER_NAME}-cluster-autoscaler
5251
---
5352
apiVersion: v1
5453
kind: ServiceAccount
@@ -60,19 +59,13 @@ apiVersion: rbac.authorization.k8s.io/v1
6059
metadata:
6160
name: ${CLUSTER_NAME}-cluster-autoscaler
6261
rules:
63-
- apiGroups:
64-
- cluster.x-k8s.io
65-
- infrastructure.cluster.x-k8s.io
66-
resources:
67-
- machinedeployments
68-
- machinedeployments/scale
69-
- machines
70-
- machinesets
71-
- machinepools
72-
- linodemachinetemplates
73-
- linodemachines
74-
verbs:
75-
- get
76-
- list
77-
- update
78-
- watch
62+
- apiGroups: [cluster.x-k8s.io, infrastructure.cluster.x-k8s.io]
63+
resources:
64+
- machinedeployments
65+
- machinedeployments/scale
66+
- machines
67+
- machinesets
68+
- machinepools
69+
- linodemachinetemplates
70+
- linodemachines
71+
verbs: [get, list, update, watch]

templates/addons/cluster-resource-set/secret.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ spec:
2323
matchLabels:
2424
crs: ${CLUSTER_NAME}-crs
2525
resources:
26-
- kind: Secret
27-
name: linode-${CLUSTER_NAME}-crs-0
26+
- kind: Secret
27+
name: linode-${CLUSTER_NAME}-crs-0
2828
strategy: ApplyOnce
2929
---

templates/addons/etcd-backup-restore/etcd-backup-restore.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ data:
8989
- --etcd-connection-timeout=30s
9090
- --delta-snapshot-period=60s
9191
- --delta-snapshot-memory-limit=104857600
92-
- --compress-snapshots=true
92+
- --compress-snapshots=true
9393
- --compression-policy=gzip
9494
- --cacert=/etc/kubernetes/pki/etcd/ca.crt
9595
- --cert=/etc/kubernetes/pki/etcd/healthcheck-client.crt
@@ -147,6 +147,6 @@ spec:
147147
etcd-backup: "true"
148148
cluster: ${CLUSTER_NAME}
149149
resources:
150-
- kind: ConfigMap
151-
name: ${CLUSTER_NAME}-etcd-backup-restore-addon
150+
- kind: ConfigMap
151+
name: ${CLUSTER_NAME}-etcd-backup-restore-addon
152152
strategy: ApplyOnce

templates/addons/etcd-backup-restore/linode-obj.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ spec:
2323
etcd-backup: "true"
2424
cluster: ${CLUSTER_NAME}
2525
resources:
26-
- kind: Secret
27-
name: ${CLUSTER_NAME}-etcd-backup-bucket-details
26+
- kind: Secret
27+
name: ${CLUSTER_NAME}-etcd-backup-bucket-details
2828
strategy: ApplyOnce

templates/addons/etcd-backup-restore/sse-key-secret.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ spec:
2424
etcd-backup: "true"
2525
cluster: ${CLUSTER_NAME}
2626
resources:
27-
- kind: Secret
28-
name: ${CLUSTER_NAME}-ssekey
27+
- kind: Secret
28+
name: ${CLUSTER_NAME}-ssekey
2929
strategy: ApplyOnce

templates/addons/machine-health-check/machinehealthcheck.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ spec:
2020
matchLabels:
2121
cluster.x-k8s.io/deployment-name: ${CLUSTER_NAME}-md-0
2222
unhealthyConditions:
23-
- type: Ready
24-
status: Unknown
25-
timeout: 300s
26-
- type: Ready
27-
status: "False"
28-
timeout: 300s
23+
- type: Ready
24+
status: Unknown
25+
timeout: 300s
26+
- type: Ready
27+
status: "False"
28+
timeout: 300s
2929
---
3030
apiVersion: cluster.x-k8s.io/v1beta1
3131
kind: MachineHealthCheck

templates/flavors/clusterclass-kubeadm/cluster-template.yaml

+9-9
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ spec:
1515
class: kubeadm
1616
version: ${KUBERNETES_VERSION}
1717
variables:
18-
- name: region
19-
value: ${LINODE_REGION}
20-
- name: controlPlaneMachineType
21-
value: ${LINODE_CONTROL_PLANE_MACHINE_TYPE}
22-
- name: workerMachineType
23-
value: ${LINODE_MACHINE_TYPE}
18+
- name: region
19+
value: ${LINODE_REGION}
20+
- name: controlPlaneMachineType
21+
value: ${LINODE_CONTROL_PLANE_MACHINE_TYPE}
22+
- name: workerMachineType
23+
value: ${LINODE_MACHINE_TYPE}
2424
controlPlane:
2525
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
2626
workers:
2727
machineDeployments:
28-
- class: default-worker
29-
name: md-0
30-
replicas: ${WORKER_MACHINE_COUNT}
28+
- class: default-worker
29+
name: md-0
30+
replicas: ${WORKER_MACHINE_COUNT}

templates/flavors/clusterclass-kubeadm/clusterClass.yaml

+12-12
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ spec:
2020
name: kubeadm
2121
workers:
2222
machineDeployments:
23-
- class: default-worker
24-
template:
25-
bootstrap:
26-
ref:
27-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
28-
kind: KubeadmConfigTemplate
29-
name: kubeadm-worker
30-
infrastructure:
31-
ref:
32-
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
33-
kind: LinodeMachineTemplate
34-
name: kubeadm-worker
23+
- class: default-worker
24+
template:
25+
bootstrap:
26+
ref:
27+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
28+
kind: KubeadmConfigTemplate
29+
name: kubeadm-worker
30+
infrastructure:
31+
ref:
32+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
33+
kind: LinodeMachineTemplate
34+
name: kubeadm-worker
3535
variables:
3636
- name: region
3737
required: true

templates/flavors/clusterclass-kubeadm/deleteTransformer.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ patch: |-
6464
- op: remove
6565
path: /spec/template/spec/version
6666
value:
67-
#patch: |-
67+
# patch: |-
6868
# $patch: delete
6969
# apiVersion: controlplane.cluster.x-k8s.io/v1beta1
7070
# kind: KubeadmControlPlaneTemplate
@@ -77,4 +77,4 @@ patch: |-
7777
# kind: LinodeMachineTemplate
7878
# name: ${CLUSTER_NAME}-control-plane
7979
# replicas: ${CONTROL_PLANE_MACHINE_COUNT}
80-
# version: ${KUBERNETES_VERSION}
80+
# version: ${KUBERNETES_VERSION}

templates/flavors/k3s/default/k3sControlPlane.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ spec:
9090
owner: root:root
9191
contentFrom:
9292
secret:
93-
key: linode-token-region.yaml
93+
key: linode-token-region.yaml
9494
name: linode-${CLUSTER_NAME}-crs-0
9595
serverConfig:
9696
disableComponents:

templates/flavors/rke2/default/rke2ControlPlane.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ spec:
3434
node-role.kubernetes.io/control-plane: "true"
3535
- contentFrom:
3636
secret:
37-
key: linode-token-region.yaml
37+
key: linode-token-region.yaml
3838
name: linode-${CLUSTER_NAME}-crs-0
3939
owner: root:root
4040
path: /var/lib/rancher/rke2/server/manifests/linode-token-region.yaml

templates/infra/linodeMachineTemplate.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ spec:
1010
type: ${LINODE_CONTROL_PLANE_MACHINE_TYPE}
1111
region: ${LINODE_REGION}
1212
interfaces:
13-
- purpose: public
14-
primary: true
13+
- purpose: public
14+
primary: true
1515
authorizedKeys:
1616
# uncomment to include your ssh key in linode provisioning
1717
# - $LINODE_SSH_PUBKEY
@@ -27,8 +27,8 @@ spec:
2727
type: ${LINODE_MACHINE_TYPE}
2828
region: ${LINODE_REGION}
2929
interfaces:
30-
- purpose: public
31-
primary: true
30+
- purpose: public
31+
primary: true
3232
authorizedKeys:
3333
# uncomment to include your ssh key in linode provisioning
3434
# - $LINODE_SSH_PUBKEY

templates/infra/secret.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ kind: Secret
44
metadata:
55
name: ${CLUSTER_NAME}-credentials
66
labels:
7-
clusterctl.cluster.x-k8s.io/move: "true"
7+
clusterctl.cluster.x-k8s.io/move: "true"
88
stringData:
99
apiToken: ${LINODE_TOKEN}

0 commit comments

Comments
 (0)