airshipctl/manifests/function/k8scontrol/replacements/versions.yaml
Pallav Gupta 30691affe8 Added Image Repositories replacement for KCP
Change-Id: I454f5e9b92290d0c5b24830621a396f07354f90b
2021-06-23 17:48:40 +00:00

44 lines
1.3 KiB
YAML

# These rules inject versioned artifacts into the k8scontrol function.
apiVersion: airshipit.org/v1alpha1
kind: ReplacementTransformer
metadata:
name: k8scontrol-versions-replacements
annotations:
config.kubernetes.io/function: |-
container:
image: localhost/replacement-transformer
replacements:
# Replace the Kubernetes version in the KubeadmControlPlane
- source:
objref:
kind: VersionsCatalogue
name: versions-airshipctl
fieldref: "{.spec.kubernetes}"
target:
objref:
kind: KubeadmControlPlane
name: cluster-controlplane
fieldrefs: ["{.spec.version}"]
# Replace the controlplane disk image in the Metal3MachineTemplate
- source:
objref:
kind: VersionsCatalogue
name: versions-airshipctl
fieldref: "{.spec.files.k8scontrol.cluster_controlplane_image}"
target:
objref:
kind: Metal3MachineTemplate
name: cluster-controlplane
fieldrefs: ["{.spec.template.spec.image}"]
# Replace the imageRepository in the KubeadmControlPlane
- source:
objref:
kind: VersionsCatalogue
name: versions-airshipctl
fieldref: "{.spec.image_repositories}"
target:
objref:
kind: KubeadmControlPlane
name: cluster-controlplane
fieldrefs: ["{.spec.kubeadmConfigSpec.clusterConfiguration.imageRepository}"]