Skip to content

Commit

Permalink
Document users need to set x-kubernetes-list-type on their own
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Bernauer <sebastian.bernauer@stackable.de>
  • Loading branch information
sbernauer committed May 2, 2024
1 parent 7d8b782 commit c64c3d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kube-core/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ impl Visitor for StructuralSchemaRewriter {

// As of version 1.30 Kubernetes does not support setting `uniqueItems` to `true`,
// so we need to remove this fields.
// TODO: Ideally we would set `x-kubernetes-list-type` instead, but the question is
// to what value (set or map) we should set it, see https://kubernetes.io/docs/reference/using-api/server-side-apply/
// for details.
// Users can still set `x-kubernetes-list-type=set` in case they want the apiserver
// to do validation, but we can't make an assumption about the Set contents here.
// See https://kubernetes.io/docs/reference/using-api/server-side-apply/ for details.
if let Some(array) = &mut schema.array {
array.unique_items = None;
}
Expand Down

0 comments on commit c64c3d0

Please sign in to comment.