@@ -98,8 +98,8 @@ deficiencies:
98
98
Use the existing go structs to construct an apply configuration, serialize
99
99
it to JSON, and pass it to ` Patch ` . This can cause zero valued required
100
100
fields being accientally included in the apply configuration resulting
101
- in fields being accidentally set to incorrect values and/or fields accidentally
102
- being accidentally being clamed as owned.
101
+ in fields being accidentally set to incorrect values and/or fields
102
+ accidentally being clamed as owned.
103
103
104
104
Both sig-api-machinery and wg-api-expression agree that this enhancement is
105
105
required for server side apply to be promoted to GA.
@@ -126,7 +126,8 @@ Validate this enhancement meets the needs of developers:
126
126
### Non-Goals
127
127
128
128
Enhancements to client-go's dynamic client. The client-go dynamic client already
129
- supports Apply via Patch, which is adequate for the dynamic client.
129
+ supports Apply via Patch, which is adequate for the dynamic client for GA. In
130
+ the future, a nicer mechanism can be proposed separate from this KEP.
130
131
131
132
Protobuf support. Apply does not support protobuf, and it will not be added with
132
133
this enhancement.
@@ -142,7 +143,7 @@ representation, which will need to be generated for this purpose.
142
143
#### Poor adoption
143
144
144
145
Risk: Developers adoption is poor, either because the aesthetics/ergonomics are
145
- not to their liking or the functinality is insufficient to do what they need to
146
+ not to their liking or the functionality is insufficient to do what they need to
146
147
do with it. This could lead to (a) poor server side apply adoption, and/or (b)
147
148
developers building alternate solutions.
148
149
@@ -158,7 +159,9 @@ take an aligned approach to adding apply to clients in a typesafe way.
158
159
The client-go typed clients will be extended to include Apply functions, e.g.:
159
160
160
161
``` go
161
- func (c *deployments ) Apply (ctx Context , fieldManager string , deployment *appsv1apply .Deployment , opts metav1 .ApplyOptions , subresources ...string ) (*Deployment , error )
162
+ func (c *deployments ) Apply (ctx Context , fieldManager string , deployment *appsv1apply .Deployment , opts metav1 .ApplyOptions ) (*Deployment , error )
163
+ func (c *deployments) ApplyStatus(ctx Context, fieldManager string, deployment *appsv1apply.Deployment, opts metav1.ApplyOptions) (*Deployment, error)
164
+ func (c *deployments) ApplyScale(ctx Context, fieldManager string, deployment *appsv1apply.Deployment, opts metav1.ApplyOptions) (*Deployment, error)
162
165
```
163
166
164
167
`ApplyOptions` will be added to metav1 even though `PatchOptions` will continue
@@ -174,6 +177,30 @@ type ApplyOptions struct {
174
177
func (ApplyOptions ) ToPatchOptions (fieldManager string ) PatchOptions
175
178
```
176
179
180
+ <<[UNRESOLVED @jpbetz ]>>
181
+
182
+ Should fieldManager be a parameter of Apply or should it be optional?
183
+
184
+ The main reason this KEP proposes fieldmanager be a required parameter
185
+ for Apply is that some controllers have multiple code paths that
186
+ update the same same object, but that update different field sets. If
187
+ they used apply and the same field manager, fields could be
188
+ accidentally removed or disowned.
189
+
190
+ Create and Update methods default the fieldmanager to a user-agent
191
+ based string. But unlike Apply, Updates succeed even if there are
192
+ conflicts, so the fieldmanager name is almost entirely
193
+ informational. For Apply, the fieldmanager name matters a lot more,
194
+ and a user-agent string is almost certainly not a good default
195
+ fieldmanager for Apply.
196
+
197
+ If we require fieldManager, an alternative to making fieldManager a
198
+ required parameter of `Apply` functions would be have a constructor
199
+ for Apply options like `NewApplyOptions(fieldManager, force)` that
200
+ makes the required field clear.
201
+
202
+ <<[/UNRESOLVED]>>
203
+
177
204
<<[UNRESOLVED @jpbetz ]>>
178
205
Should the Force field also be made a required field like fieldManager is?
179
206
@lavalamp pointed out that user things typically want false but
@@ -196,14 +223,6 @@ client.Deployments().BeginApply("field-manager-name", options).Body(
196
223
Apply will combine the `fieldManager` argument with `ApplyOptions` to create the
197
224
`PatchOptions`.
198
225
199
- Each apply call will be required to provide a fieldmanager name. We will not
200
- provide a a way for the fieldmanager name to be set for the entire
201
- clientset. The main reason for this is that if a client has multiple code paths
202
- where it makes apply requests to the same object, but with different field sets,
203
- they must use different field manager names. If they use the same field manager
204
- name they will cause fields to be accidentally removed or disowned. This is a
205
- potential foot gun we would like to avoid.
206
-
207
226
### Generated apply configuration types
208
227
209
228
All fields present in an apply configuration become owned by the applier after
0 commit comments