Skip to content

Commit

Permalink
Ensure we don't overwrite pr templates during generation
Browse files Browse the repository at this point in the history
  • Loading branch information
jsturtevant committed Aug 11, 2021
1 parent deb29c1 commit 44efade
Show file tree
Hide file tree
Showing 30 changed files with 242 additions and 174 deletions.
1 change: 1 addition & 0 deletions templates/cluster-template-aad.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
useExperimentalRetryJoin: true
machineTemplate:
Expand Down
1 change: 1 addition & 0 deletions templates/cluster-template-azure-bastion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
machineTemplate:
infrastructureRef:
Expand Down
1 change: 1 addition & 0 deletions templates/cluster-template-ephemeral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
machineTemplate:
infrastructureRef:
Expand Down
1 change: 1 addition & 0 deletions templates/cluster-template-external-cloud-provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
machineTemplate:
infrastructureRef:
Expand Down
2 changes: 2 additions & 0 deletions templates/cluster-template-machinepool-multiple-subnets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
machineTemplate:
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
machineTemplate:
infrastructureRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
machineTemplate:
infrastructureRef:
Expand Down
1 change: 1 addition & 0 deletions templates/cluster-template-machinepool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
machineTemplate:
infrastructureRef:
Expand Down
1 change: 1 addition & 0 deletions templates/cluster-template-nat-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
machineTemplate:
infrastructureRef:
Expand Down
1 change: 1 addition & 0 deletions templates/cluster-template-nvidia-gpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
machineTemplate:
infrastructureRef:
Expand Down
1 change: 1 addition & 0 deletions templates/cluster-template-system-assigned-identity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
machineTemplate:
infrastructureRef:
Expand Down
1 change: 1 addition & 0 deletions templates/cluster-template-user-assigned-identity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
machineTemplate:
infrastructureRef:
Expand Down
1 change: 1 addition & 0 deletions templates/cluster-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
machineTemplate:
infrastructureRef:
Expand Down
1 change: 1 addition & 0 deletions templates/flavors/base/cluster-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ spec:
- - LABEL=etcd_disk
- /var/lib/etcddisk
preKubeadmCommands: []
postKubeadmCommands: []
version: "${KUBERNETES_VERSION}"
---
kind: AzureMachineTemplate
Expand Down
1 change: 1 addition & 0 deletions templates/test/ci/cluster-template-prow-ci-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands:
- bash -c /tmp/kubeadm-bootstrap.sh
useExperimentalRetryJoin: true
Expand Down
1 change: 1 addition & 0 deletions templates/test/ci/cluster-template-prow-custom-vnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
machineTemplate:
infrastructureRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
machineTemplate:
infrastructureRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
machineTemplate:
infrastructureRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands:
- bash -c /tmp/kubeadm-bootstrap.sh
useExperimentalRetryJoin: true
Expand Down
1 change: 1 addition & 0 deletions templates/test/ci/cluster-template-prow-machine-pool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
machineTemplate:
infrastructureRef:
Expand Down
1 change: 1 addition & 0 deletions templates/test/ci/cluster-template-prow-nvidia-gpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
machineTemplate:
infrastructureRef:
Expand Down
1 change: 1 addition & 0 deletions templates/test/ci/cluster-template-prow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ spec:
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands: []
preKubeadmCommands: []
machineTemplate:
infrastructureRef:
Expand Down
55 changes: 41 additions & 14 deletions templates/test/dev/cluster-template-custom-builds-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,25 @@ spec:
overwrite: false
tableType: gpt
files:
- content: |
network:
version: 2
ethernets:
eth0:
mtu: 1400
match:
macaddress: MACADDRESS
set-name: eth0
owner: root:root
path: /etc/netplan/60-eth0.yaml
permissions: "0644"
- contentFrom:
secret:
key: control-plane-azure.json
name: ${CLUSTER_NAME}-control-plane-azure-json
owner: root:root
path: /etc/kubernetes/azure.json
permissions: "0644"
- content: |
#!/bin/bash
Expand Down Expand Up @@ -144,13 +163,6 @@ spec:
owner: root:root
path: /tmp/replace-k8s-components.sh
permissions: "0744"
- contentFrom:
secret:
key: control-plane-azure.json
name: ${CLUSTER_NAME}-control-plane-azure-json
owner: root:root
path: /etc/kubernetes/azure.json
permissions: "0644"
initConfiguration:
nodeRegistration:
kubeletExtraArgs:
Expand All @@ -169,6 +181,9 @@ spec:
- - LABEL=etcd_disk
- /var/lib/etcddisk
postKubeadmCommands:
- mac=$(ip -o link | grep eth0 | grep ether | awk '{ print $17 }')
- sed -i -e "s/MACADDRESS/$${mac}/g" /etc/netplan/60-eth0.yaml
- netplan apply
- bash -c /tmp/replace-k8s-components.sh
preKubeadmCommands:
- bash -c /tmp/replace-k8s-binaries.sh
Expand Down Expand Up @@ -260,6 +275,25 @@ spec:
template:
spec:
files:
- contentFrom:
secret:
key: worker-node-azure.json
name: ${CLUSTER_NAME}-md-0-azure-json
owner: root:root
path: /etc/kubernetes/azure.json
permissions: "0644"
- content: |
network:
version: 2
ethernets:
eth0:
mtu: 1400
match:
macaddress: MACADDRESS
set-name: eth0
owner: root:root
path: /etc/netplan/60-eth0.yaml
permissions: "0644"
- content: |
#!/bin/bash
Expand All @@ -281,13 +315,6 @@ spec:
owner: root:root
path: /tmp/replace-k8s-binaries.sh
permissions: "0744"
- contentFrom:
secret:
key: control-plane-azure.json
name: ${CLUSTER_NAME}-control-plane-azure-json
owner: root:root
path: /etc/kubernetes/azure.json
permissions: "0644"
joinConfiguration:
nodeRegistration:
kubeletExtraArgs:
Expand Down
28 changes: 14 additions & 14 deletions templates/test/dev/cluster-template-custom-builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ spec:
overwrite: false
tableType: gpt
files:
- contentFrom:
secret:
key: control-plane-azure.json
name: ${CLUSTER_NAME}-control-plane-azure-json
owner: root:root
path: /etc/kubernetes/azure.json
permissions: "0644"
- content: |
#!/bin/bash
Expand Down Expand Up @@ -143,13 +150,6 @@ spec:
owner: root:root
path: /tmp/replace-k8s-components.sh
permissions: "0744"
- contentFrom:
secret:
key: control-plane-azure.json
name: ${CLUSTER_NAME}-control-plane-azure-json
owner: root:root
path: /etc/kubernetes/azure.json
permissions: "0644"
initConfiguration:
nodeRegistration:
kubeletExtraArgs:
Expand Down Expand Up @@ -259,6 +259,13 @@ spec:
template:
spec:
files:
- contentFrom:
secret:
key: worker-node-azure.json
name: ${CLUSTER_NAME}-md-0-azure-json
owner: root:root
path: /etc/kubernetes/azure.json
permissions: "0644"
- content: |
#!/bin/bash
Expand All @@ -280,13 +287,6 @@ spec:
owner: root:root
path: /tmp/replace-k8s-binaries.sh
permissions: "0744"
- contentFrom:
secret:
key: control-plane-azure.json
name: ${CLUSTER_NAME}-control-plane-azure-json
owner: root:root
path: /etc/kubernetes/azure.json
permissions: "0644"
joinConfiguration:
nodeRegistration:
kubeletExtraArgs:
Expand Down
15 changes: 14 additions & 1 deletion templates/test/dev/custom-builds-windows/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ namespace: default
resources:
- ../../../test/ci/prow-windows
patchesStrategicMerge:
- ../custom-builds/patches/custom-builds.yaml
- patches/windows-image-update.yaml
- ../custom-builds/patches/machine-deployment-pr-version.yaml
patchesJson6902:
- target:
group: bootstrap.cluster.x-k8s.io
Expand All @@ -12,3 +12,16 @@ patchesJson6902:
name: .*-md-win
namespace: default
path: patches/custom-builds-windows.yaml
- target:
group: bootstrap.cluster.x-k8s.io
version: v1alpha4
kind: KubeadmConfigTemplate
name: .*-md-0
namespace: default
path: ../custom-builds/patches/kubeadm-bootstrap.yaml
- target:
group: controlplane.cluster.x-k8s.io
version: v1alpha4
kind: KubeadmControlPlane
name: .*-control-plane
path: ../custom-builds/patches/kubeadm-controlplane-bootstrap.yaml
17 changes: 15 additions & 2 deletions templates/test/dev/custom-builds/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,18 @@ namespace: default
resources:
- ../../../test/ci/prow
patchesStrategicMerge:
- ../patches/control-plane-custom-builds.yaml
- patches/custom-builds.yaml
- patches/machine-deployment-pr-version.yaml
patches:
- target:
group: bootstrap.cluster.x-k8s.io
version: v1alpha4
kind: KubeadmConfigTemplate
name: .*-md-0
namespace: default
path: patches/kubeadm-bootstrap.yaml
- target:
group: controlplane.cluster.x-k8s.io
version: v1alpha4
kind: KubeadmControlPlane
name: .*-control-plane
path: patches/kubeadm-controlplane-bootstrap.yaml
Loading

0 comments on commit 44efade

Please sign in to comment.