From 4e303c9a34d9006ac8c9c21f5223d2eb1c279896 Mon Sep 17 00:00:00 2001 From: lsviben Date: Mon, 29 Jan 2024 10:17:22 +0100 Subject: [PATCH] add migration example for toFieldPath Signed-off-by: lsviben (cherry picked from commit e591f32d6b908e3df5bf5388def5a4abb2348b69) --- .../deprecated/patches-from-resource.yaml | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 examples/object/deprecated/patches-from-resource.yaml diff --git a/examples/object/deprecated/patches-from-resource.yaml b/examples/object/deprecated/patches-from-resource.yaml new file mode 100644 index 00000000..c2821c6c --- /dev/null +++ b/examples/object/deprecated/patches-from-resource.yaml @@ -0,0 +1,33 @@ +--- +apiVersion: kubernetes.crossplane.io/v1alpha1 +kind: Object +metadata: + name: foo +spec: + references: + # Use patchesFrom to patch field from other k8s resource to this object + - patchesFrom: + apiVersion: v1 + kind: ConfigMap + name: bar + namespace: default + fieldPath: data.sample-key + toFieldPath: data.sample-key-from-bar + forProvider: + manifest: + apiVersion: v1 + kind: ConfigMap + metadata: + namespace: default + data: + sample-key: sample-value + providerConfigRef: + name: kubernetes-provider +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: bar + namespace: default +data: + sample-key: sample-value