You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/README.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -754,3 +754,32 @@ spec:
754
754
additionalManifests:
755
755
name: additional-manifests
756
756
```
757
+
758
+
## Patching provider manifests
759
+
760
+
Provider manifests can be patched using JSON merge patches. This can be useful when you need to modify the provider manifests that are fetched from the repository.
761
+
762
+
```yaml
763
+
---
764
+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
765
+
kind: CoreProvider
766
+
metadata:
767
+
name: cluster-api
768
+
namespace: capi-system
769
+
spec:
770
+
resourcePatches:
771
+
- |
772
+
apiVersion: v1
773
+
kind: Service
774
+
metadata:
775
+
labels:
776
+
test-label: test-value
777
+
```
778
+
779
+
There couple rules for the patch to match a manifest:
780
+
781
+
- The `kind` field must match the target object.
782
+
- If `apiVersion` is specified it will only be applied to matching objects.
783
+
- If `metadata.name` and `metadata.namespace` not specified, the patch will be applied to all objects of the specified kind.
784
+
- If `metadata.name` is specified, the patch will be applied to the object with the specified name. This is for cluster scoped objects.
785
+
- If both `metadata.name` and `metadata.namespace` are specified, the patch will be applied to the object with the specified name and namespace.
0 commit comments