diff --git a/workspaces/controller/api/v1beta1/workspace_types.go b/workspaces/controller/api/v1beta1/workspace_types.go index ee5ba99a..5b513902 100644 --- a/workspaces/controller/api/v1beta1/workspace_types.go +++ b/workspaces/controller/api/v1beta1/workspace_types.go @@ -45,7 +45,7 @@ type WorkspaceSpec struct { // the WorkspaceKind to use //+kubebuilder:validation:MinLength:=2 //+kubebuilder:validation:MaxLength:=63 - //+kubebuilder:validation:Pattern:=^[a-z0-9][-a-z0-9]*[a-z0-9]$ + //+kubebuilder:validation:Pattern:=^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ //+kubebuilder:validation:XValidation:rule="self == oldSelf",message="Workspace 'kind' is immutable" //+kubebuilder:example="jupyterlab" Kind string `json:"kind"` @@ -85,7 +85,7 @@ type WorkspacePodVolumes struct { //+kubebuilder:validation:Optional //+kubebuilder:validation:MinLength:=2 //+kubebuilder:validation:MaxLength:=63 - //+kubebuilder:validation:Pattern:=^[a-z0-9][-a-z0-9]*[a-z0-9]$ + //+kubebuilder:validation:Pattern:=^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ //+kubebuilder:example="my-home-pvc" Home *string `json:"home,omitempty"` @@ -104,7 +104,7 @@ type PodVolumeMount struct { // the name of the PVC to mount //+kubebuilder:validation:MinLength:=2 //+kubebuilder:validation:MaxLength:=63 - //+kubebuilder:validation:Pattern:=^[a-z0-9][-a-z0-9]*[a-z0-9]$ + //+kubebuilder:validation:Pattern:=^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ //+kubebuilder:example="my-data-pvc" PVCName string `json:"pvcName"` diff --git a/workspaces/controller/config/crd/bases/kubeflow.org_workspaces.yaml b/workspaces/controller/config/crd/bases/kubeflow.org_workspaces.yaml index 201d595b..38f6fc89 100644 --- a/workspaces/controller/config/crd/bases/kubeflow.org_workspaces.yaml +++ b/workspaces/controller/config/crd/bases/kubeflow.org_workspaces.yaml @@ -55,7 +55,7 @@ spec: example: jupyterlab maxLength: 63 minLength: 2 - pattern: ^[a-z0-9][-a-z0-9]*[a-z0-9]$ + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ type: string x-kubernetes-validations: - message: Workspace 'kind' is immutable @@ -130,7 +130,7 @@ spec: example: my-data-pvc maxLength: 63 minLength: 2 - pattern: ^[a-z0-9][-a-z0-9]*[a-z0-9]$ + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ type: string readOnly: default: false @@ -154,7 +154,7 @@ spec: example: my-home-pvc maxLength: 63 minLength: 2 - pattern: ^[a-z0-9][-a-z0-9]*[a-z0-9]$ + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ type: string type: object required: