-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
In order to migrate away from the deprecated Apply patch, which we have been using to perform SSA requests with the controller-runtime client, we need the FieldValidation
option on ApplyOptions
. Is there any reason why it's missing, or is it just an oversight?
controller-runtime/pkg/client/options.go
Lines 768 to 784 in fc84a60
// fieldValidation instructs the server on how to handle | |
// objects in the request (POST/PUT/PATCH) containing unknown | |
// or duplicate fields. Valid values are: | |
// - Ignore: This will ignore any unknown fields that are silently | |
// dropped from the object, and will ignore all but the last duplicate | |
// field that the decoder encounters. This is the default behavior | |
// prior to v1.23. | |
// - Warn: This will send a warning via the standard warning response | |
// header for each unknown field that is dropped from the object, and | |
// for each duplicate field that is encountered. The request will | |
// still succeed if there are no other errors, and will only persist | |
// the last of any duplicate fields. This is the default in v1.23+ | |
// - Strict: This will fail the request with a BadRequest error if | |
// any unknown fields would be dropped from the object, or if any | |
// duplicate fields are present. The error returned from the server | |
// will contain all unknown and duplicate fields encountered. | |
FieldValidation string |
This came up when I asked if Flux could set fieldValidation to Strict in its SSA requests, ref. fluxcd/pkg#1016.
stefanprodan
Metadata
Metadata
Assignees
Labels
No labels