Skip to content

Commit

Permalink
Adds fieldValidation field to create, patch, and update request options
Browse files Browse the repository at this point in the history
  • Loading branch information
dlipovetsky committed Jun 20, 2024
1 parent 8290d13 commit 2c61cfe
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions pkg/client/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,25 @@ type CreateOptions struct {
// this request. It must be set with server-side apply.
FieldManager string

// 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.
// +optional
FieldValidation string

// Raw represents raw CreateOptions, as passed to the API server.
Raw *metav1.CreateOptions
}
Expand Down Expand Up @@ -679,6 +698,25 @@ type UpdateOptions struct {
// this request. It must be set with server-side apply.
FieldManager string

// 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.
// +optional
FieldValidation string

// Raw represents raw UpdateOptions, as passed to the API server.
Raw *metav1.UpdateOptions
}
Expand Down Expand Up @@ -745,6 +783,25 @@ type PatchOptions struct {
// this request. It must be set with server-side apply.
FieldManager string

// 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.
// +optional
FieldValidation string

// Raw represents raw PatchOptions, as passed to the API server.
Raw *metav1.PatchOptions
}
Expand Down

0 comments on commit 2c61cfe

Please sign in to comment.