I’m getting an unexpected error when creating a ValidatingWebhookConfiguration with an uppercase character in the service path:
The ValidatingWebhookConfiguration “datasetdeployment-validator” is invalid:
webhooks[0].clientConfig.service.path
: Invalid value:"/DatasetDeployment/validate"
:segment[0]
: a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, ‘-’ or ‘.’, and must start and end with an alphanumeric character (e.g. ‘example.com’, regex used for validation is'[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'
)
This doesn’t seem like the right validation to be performing on this field – paths can contain uppercase characters, and a load of other symbols. On the other hand, I can’t find anyone else having raised an issue in the 7+ years this code appears to have been around so it seems like I must have missed something?
More information
Here’s the start of the resource YAML I’m trying to upload:
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: datasetdeployment-validator
webhooks:
- name: datasetdeployment-validator.alicederyn.example.com
admissionReviewVersions:
- v1
clientConfig:
service:
name: streaming-controller
namespace: default
path: /DatasetDeployment/validate
And here’s where I think the error is coming from: kubernetes/staging/src/k8s.io/apiserver/pkg/util/webhook/validation.go at bd8532054c13d053eb2cbdc072e282459584c987 · kubernetes/kubernetes · GitHub
Cluster information:
Kubernetes version: v1.30.1+k3s1
Cloud being used: bare-metal
Installation method: k3d
Host OS: RHEL
CNI and version: Flannel (k3d)
CRI and version: docker 25.0.2