You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: staging/src/k8s.io/apiserver/pkg/apis/apiserver/validation/validation.go
+23Lines changed: 23 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -355,6 +355,11 @@ func validateClaimMappings(compiler authenticationcel.Compiler, state *validatio
355
355
ifmapping.Key!=strings.ToLower(mapping.Key) {
356
356
allErrs=append(allErrs, field.Invalid(fldPath.Child("key"), mapping.Key, "key must be lowercase"))
357
357
}
358
+
359
+
ifisKubernetesDomainPrefix(mapping.Key) {
360
+
allErrs=append(allErrs, field.Invalid(fldPath.Child("key"), mapping.Key, "k8s.io, kubernetes.io and their subdomains are reserved for Kubernetes use"))
want: `issuer.claimMappings.extra[0].key: Invalid value: "example.k8s.io/foo": k8s.io, kubernetes.io and their subdomains are reserved for Kubernetes use`,
1389
+
},
1390
+
{
1391
+
name: "extra mapping key prefix is kubernetes.io",
want: `issuer.claimMappings.extra[0].key: Invalid value: "kubernetes.io/foo": k8s.io, kubernetes.io and their subdomains are reserved for Kubernetes use`,
want: `issuer.claimMappings.extra[0].key: Invalid value: "example.kubernetes.io/foo": k8s.io, kubernetes.io and their subdomains are reserved for Kubernetes use`,
1413
+
},
1414
+
{
1415
+
name: "extra mapping key prefix with ak8s.io, *.ak8s.io, bkubernetes.io, *.bkubernetes.io are still valid",
0 commit comments