@@ -119,6 +119,8 @@ use `crossplane beta render`.
119
119
This function has a few small, intentional breaking changes compared to the
120
120
native implementation.
121
121
122
+ # ## New Required fields
123
+
122
124
These fields are now required. This makes P&T configuration less ambiguous :
123
125
124
126
* `resources[i].name`
@@ -127,17 +129,41 @@ These fields are now required. This makes P&T configuration less ambiguous:
127
129
* `resources[i].patches[i].transforms[i].string.type`
128
130
* `resources[i].patches[i].transforms[i].math.type`
129
131
132
+ # ## `mergeOptions` replaced by `toFieldPath`
133
+
130
134
Also, the `resources[i].patches[i].policy.mergeOptions` field is no longer
131
- supported. The same capability can be achieved by setting
132
- `resources[i].patches[i].policy.toFieldPath` to :
133
- - ` MergeObjects` - equivalent to
134
- `resources[i].patches[i].policy.mergeOptions.keepMapValues : true`
135
- - ` MergeObjectsAppendArrays` - equivalent to
136
- `resources[i].patches[i].policy.mergeOptions{keepMapValues : true, appendSlice: true}`
137
- - ` ForceMergeObjects` - equivalent to
138
- `resources[i].patches[i].policy.mergeOptions.keepMapValues : false`
139
- - ` ForceMergeObjectsAppendArrays` - equivalent to
140
- `resources[i].patches[i].policy.mergeOptions.appendSlice : true`
135
+ supported. This functionality has been replaced by the
136
+ ` resources[i].patches[i].policy.toFieldPath` field. The table below outlines
137
+ previous behavior that was possible with `mergeOptions` and how to achieve it
138
+ with the new `toFieldPath` field :
139
+
140
+ | # | `mergeOptions` | `appendSlice`| `keepMapValues` | `toFieldPath` |
141
+ | - | ------------- | ------------ | --------------- | -------------------- |
142
+ | 1 | `nil` | N/A | N/A | `nil` which defaults to `Replace` |
143
+ | 2 | `non-nil` | `nil` or `false` | `true` | `MergeObjects` |
144
+ | 3 | `non-nil` | `true` | `nil` or `false` | `ForceMergeObjectsAppendArrays` |
145
+ | 4 | `non-nil` | `nil` or `false` | `nil` or `false` | `ForceMergeObjects` |
146
+ | 5 | `non-nil` | `true` | `true` | `MergeObjectsAppendArrays` |
147
+
148
+ As an example, a previous configuration using the no longer supported `mergeOptions` :
149
+
150
+ ` ` ` yaml
151
+ policy:
152
+ mergeOptions:
153
+ appendSlice: true
154
+ keepMapValues: true
155
+ ` ` `
156
+
157
+ Should be replaced with :
158
+
159
+ ` ` ` yaml
160
+ policy:
161
+ toFieldPath: MergeObjectsAppendArrays
162
+ ` ` `
163
+
164
+ Starting with Crossplane v1.16.0, the `convert` command in the [Crossplane
165
+ CLI][cli-convert] will automatically convert `mergeOptions` to `toFieldPath` for
166
+ you.
141
167
142
168
# # Developing this function
143
169
@@ -168,3 +194,4 @@ $ crossplane xpkg build -f package --embed-runtime-image=runtime
168
194
[go] : https://go.dev
169
195
[docker] : https://www.docker.com
170
196
[cli] : https://docs.crossplane.io/latest/cli
197
+ [cli-convert] : https://docs.crossplane.io/latest/cli/command-reference/#beta-convert
0 commit comments