Skip to content

Commit 6f650ea

Browse files
committed
Update name limit
1 parent 11e9c6c commit 6f650ea

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

pkg/apis/postgres-operator.crunchydata.com/v1beta1/postgrescluster_types.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -546,11 +546,10 @@ type AdditionalVolume struct {
546546
// Volumes are mounted in the pods at `volumes/<NAME>`
547547
// Must be unique.
548548
// ---
549-
// The `Name` field is a `DNS1123Subdomain` type to enforce
550-
// the max length and also allow us to more easily transition
551-
// to CPK-provisioned volumes.
549+
// The `Name` field is a `DNS1123Label` type to enforce
550+
// the max length.
552551
// +required
553-
Name DNS1123Subdomain `json:"name"`
552+
Name DNS1123Label `json:"name"`
554553

555554
// A reference to a preexisting PVC.
556555
// ---

pkg/apis/postgres-operator.crunchydata.com/v1beta1/shared_types.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ type ConfigDataKey = string
3232
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?([.][a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
3333
type DNS1123Subdomain = string
3434

35+
// ---
36+
// https://pkg.go.dev/k8s.io/apimachinery/pkg/util/validation#IsDNS1123Label
37+
// https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Format
38+
//
39+
// +kubebuilder:validation:MinLength=1
40+
// Max length is less than max 63 to allow prepending `volumes-` to name
41+
// +kubebuilder:validation:MaxLength=55
42+
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
43+
type DNS1123Label = string
44+
3545
// ---
3646
// Duration represents a string accepted by the Kubernetes API in the "duration"
3747
// [format]. This format extends the "duration" [defined by OpenAPI] by allowing

0 commit comments

Comments
 (0)