Merge "Fix Version Catalogue replacement for Clusterctl"

This commit is contained in:
Zuul 2020-11-09 18:50:49 +00:00 committed by Gerrit Code Review
commit c99ccb6f7b
3 changed files with 103 additions and 12 deletions

View File

@ -23,7 +23,7 @@ files:
images:
capm3: # Images specific to the camp3 function; etc.
manager: quay.io/metal3-io/cluster-api-provider-metal3
manager: quay.io/metal3-io/cluster-api-provider-metal3:v0.3.2
auth_proxy: gcr.io/kubebuilder/kube-rbac-proxy:v0.4.0
cacpk:
manager: us.gcr.io/k8s-artifacts-prod/cluster-api/kubeadm-control-plane-controller:v0.3.7
@ -31,6 +31,9 @@ images:
cabpk:
manager: us.gcr.io/k8s-artifacts-prod/cluster-api/kubeadm-bootstrap-controller:v0.3.7
auth_proxy: gcr.io/kubebuilder/kube-rbac-proxy:v0.4.1
capd:
manager: gcr.io/k8s-staging-cluster-api/capd-manager:v20201019-v0.3.10-86-gc1647481f
auth_proxy: gcr.io/kubebuilder/kube-rbac-proxy:v0.4.0
capi:
manager: us.gcr.io/k8s-artifacts-prod/cluster-api/cluster-api-controller:v0.3.7
auth_proxy: gcr.io/kubebuilder/kube-rbac-proxy:v0.4.1

View File

@ -1,4 +1,4 @@
# These rules inject versioned artifacts into the k8scontrol function.
# These rules inject versioned artifacts into the clusterctl function.
apiVersion: airshipit.org/v1alpha1
kind: ReplacementTransformer
metadata:
@ -8,24 +8,109 @@ metadata:
container:
image: quay.io/airshipit/replacement-transformer:dev
replacements:
# Replace the Kubernetes version in the KubeadmControlPlane
# Replace capm3 versions
- source:
objref:
kind: VariableCatalogue
name: versions-airshipctl
fieldref: "{.kubernetes}"
fieldref: "{.images.capm3.manager}"
target:
objref:
kind: KubeadmControlPlane
name: cluster-controlplane
fieldrefs: ["{.spec.version}"]
# Replace the controlplane disk image in the Metal3MachineTemplate
kind: Clusterctl
name: clusterctl_init
fieldrefs: ["{.additional-vars.CONTAINER_CAPM3_MANAGER}"]
- source:
objref:
kind: VariableCatalogue
name: versions-airshipctl
fieldref: "{.files.k8scontrol.cluster_controlplane_image}"
fieldref: "{.images.capm3.auth_proxy}"
target:
objref:
kind: Metal3MachineTemplate
name: cluster-controlplane
fieldrefs: ["{.spec.template.spec.image}"]
kind: Clusterctl
name: clusterctl_init
fieldrefs: ["{.additional-vars.CONTAINER_CAPM3_AUTH_PROXY}"]
# Replace cacpk versions
- source:
objref:
kind: VariableCatalogue
name: versions-airshipctl
fieldref: "{.images.cacpk.manager}"
target:
objref:
kind: Clusterctl
name: clusterctl_init
fieldrefs: ["{.additional-vars.CONTAINER_CACPK_MANAGER}"]
- source:
objref:
kind: VariableCatalogue
name: versions-airshipctl
fieldref: "{.images.cacpk.auth_proxy}"
target:
objref:
kind: Clusterctl
name: clusterctl_init
fieldrefs: ["{.additional-vars.CONTAINER_CACPK_AUTH_PROXY}"]
# Replace cabpk versions
- source:
objref:
kind: VariableCatalogue
name: versions-airshipctl
fieldref: "{.images.cabpk.manager}"
target:
objref:
kind: Clusterctl
name: clusterctl_init
fieldrefs: ["{.additional-vars.CONTAINER_CABPK_MANAGER}"]
- source:
objref:
kind: VariableCatalogue
name: versions-airshipctl
fieldref: "{.images.cabpk.auth_proxy}"
target:
objref:
kind: Clusterctl
name: clusterctl_init
fieldrefs: ["{.additional-vars.CONTAINER_CABPK_AUTH_PROXY}"]
# Replace capd versions
- source:
objref:
kind: VariableCatalogue
name: versions-airshipctl
fieldref: "{.images.capd.manager}"
target:
objref:
kind: Clusterctl
name: clusterctl_init
fieldrefs: ["{.additional-vars.CONTAINER_CAPD_MANAGER}"]
- source:
objref:
kind: VariableCatalogue
name: versions-airshipctl
fieldref: "{.images.capd.auth_proxy}"
target:
objref:
kind: Clusterctl
name: clusterctl_init
fieldrefs: ["{.additional-vars.CONTAINER_CAPD_AUTH_PROXY}"]
# Replace capi versions
- source:
objref:
kind: VariableCatalogue
name: versions-airshipctl
fieldref: "{.images.capi.manager}"
target:
objref:
kind: Clusterctl
name: clusterctl_init
fieldrefs: ["{.additional-vars.CONTAINER_CAPI_MANAGER}"]
- source:
objref:
kind: VariableCatalogue
name: versions-airshipctl
fieldref: "{.images.capi.auth_proxy}"
target:
objref:
kind: Clusterctl
name: clusterctl_init
fieldrefs: ["{.additional-vars.CONTAINER_CAPI_AUTH_PROXY}"]

View File

@ -4,5 +4,8 @@ resources:
- executors.yaml
- cluster-map.yaml
- ../function/clusterctl
- ../function/airshipctl-base-catalogues
patchesStrategicMerge:
- clusterctl_init_options.yaml
transformers:
- ../function/clusterctl/replacements