Change:
}, } <ins> topologyDupValues := []api.TopologySelectorTerm{ { MatchLabelExpressions: []api.TopologySelectorLabelRequirement{ { Key:    "kubernetes.io/hostname", Values: []string{"node1", "node1"}, }, }, }, } topologyMultiValues := []api.TopologySelectorTerm{ { MatchLabelExpressions: []api.TopologySelectorLabelRequirement{ { Key:    "kubernetes.io/hostname", Values: []string{"node1", "node2"}, }, }, }, } topologyEmptyMatchLabelExpressions := []api.TopologySelectorTerm{ { MatchLabelExpressions: nil, }, } topologyDupKeys := []api.TopologySelectorTerm{ { MatchLabelExpressions: []api.TopologySelectorLabelRequirement{ { Key:    "kubernetes.io/hostname", Values: []string{"node1"}, }, { Key:    "kubernetes.io/hostname", Values: []string{"node2"}, }, }, }, } topologyMultiTerm := []api.TopologySelectorTerm{ { MatchLabelExpressions: []api.TopologySelectorLabelRequirement{ { Key:    "kubernetes.io/hostname", Values: []string{"node1"}, }, }, }, { MatchLabelExpressions: []api.TopologySelectorLabelRequirement{ { Key:    "kubernetes.io/hostname", Values: []string{"node2"}, }, }, }, } topologyDupTermsIdentical := []api.TopologySelectorTerm{ { MatchLabelExpressions: []api.TopologySelectorLabelRequirement{ { Key:    "failure-domain.beta.kubernetes.io/zone", Values: []string{"zone1"}, }, { Key:    "kubernetes.io/hostname", Values: []string{"node1"}, }, }, }, { MatchLabelExpressions: []api.TopologySelectorLabelRequirement{ { Key:    "failure-domain.beta.kubernetes.io/zone", Values: []string{"zone1"}, }, { Key:    "kubernetes.io/hostname", Values: []string{"node1"}, }, }, }, } topologyExprsOneSameOneDiff := []api.TopologySelectorTerm{ { MatchLabelExpressions: []api.TopologySelectorLabelRequirement{ { Key:    "failure-domain.beta.kubernetes.io/zone", Values: []string{"zone1"}, }, { Key:    "kubernetes.io/hostname", Values: []string{"node1"}, }, }, }, { MatchLabelExpressions: []api.TopologySelectorLabelRequirement{ { Key:    "failure-domain.beta.kubernetes.io/zone", Values: []string{"zone1"}, }, { Key:    "kubernetes.io/hostname", Values: []string{"node2"}, }, }, }, } topologyValuesOneSameOneDiff := []api.TopologySelectorTerm{ { MatchLabelExpressions: []api.TopologySelectorLabelRequirement{ { Key:    "kubernetes.io/hostname", Values: []string{"node1", "node2"}, }, }, }, { MatchLabelExpressions: []api.TopologySelectorLabelRequirement{ { Key:    "kubernetes.io/hostname", Values: []string{"node1", "node3"}, }, }, }, } topologyDupTermsDiffExprOrder := []api.TopologySelectorTerm{ { MatchLabelExpressions: []api.TopologySelectorLabelRequirement{ { Key:    "kubernetes.io/hostname", Values: []string{"node1"}, }, { Key:    "failure-domain.beta.kubernetes.io/zone", Values: []string{"zone1"}, }, }, }, { MatchLabelExpressions: []api.TopologySelectorLabelRequirement{ { Key:    "failure-domain.beta.kubernetes.io/zone", Values: []string{"zone1"}, }, { Key:    "kubernetes.io/hostname", Values: []string{"node1"}, }, }, }, } topologyDupTermsDiffValueOrder := []api.TopologySelectorTerm{ { MatchLabelExpressions: []api.TopologySelectorLabelRequirement{ { Key:    "failure-domain.beta.kubernetes.io/zone", Values: []string{"zone1", "zone2"}, }, }, }, { MatchLabelExpressions: []api.TopologySelectorLabelRequirement{ { Key:    "failure-domain.beta.kubernetes.io/zone", Values: []string{"zone2", "zone1"}, }, }, }, } </ins> cases := map[string]bindingTest{ "no topology": { class:         makeClass(nil, nil),

Discussion:
<!-- This form is for bug reports and feature requests ONLY! If you're looking for help check and the . If the matter is security related, please disclose it privately via --/kind feature The field essentially has the type , but currently there is no validation for set and map semantics, i.e. unique elements / keys. Having this validation at API level removes logic to validate at the volume plugin level. edit: this check will not be in cases where this makes it difficult to add other fields and make this field optional. /sig api-machinery /sig storage
/assign
Thanks for catching this. Would you be able to implement this for this release? We want to try to go beta if we can, and we won't be able to strengthen validation once that happens.
Yes will do!