Skip to content

Commit 97ba45c

Browse files
committed
Update language on struct
1 parent 3ad136e commit 97ba45c

File tree

2 files changed

+31
-63
lines changed

2 files changed

+31
-63
lines changed

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

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -541,54 +541,6 @@ type PostgresVolumesSpec struct {
541541
Temp *VolumeClaimSpec `json:"temp,omitempty"`
542542
}
543543

544-
// ---
545-
// Only one applier should be managing each volume definition.
546-
// https://docs.k8s.io/reference/using-api/server-side-apply#merge-strategy
547-
// +structType=atomic
548-
type AdditionalVolume struct {
549-
// Name of an existing PersistentVolumeClaim.
550-
// ---
551-
// https://pkg.go.dev/k8s.io/kubernetes/pkg/apis/core/validation#ValidatePersistentVolumeClaim
552-
// https://pkg.go.dev/k8s.io/kubernetes/pkg/apis/core/validation#ValidatePersistentVolumeName
553-
//
554-
// +required
555-
ClaimName DNS1123Subdomain `json:"claimName"`
556-
557-
// The names of containers in which to mount this volume.
558-
// The default mounts the volume in *all* containers. An empty list does not mount the volume to any containers.
559-
// ---
560-
// These are matched against [corev1.Container.Name] in a PodSpec, which is a [DNS1123Label].
561-
// https://pkg.go.dev/k8s.io/kubernetes/pkg/apis/core/validation#ValidatePodSpec
562-
//
563-
// Container names are unique within a Pod, so this list can be, too.
564-
// +listType=set
565-
//
566-
// +kubebuilder:validation:MaxItems=10
567-
// +optional
568-
Containers []DNS1123Label `json:"containers"`
569-
570-
// The name of the directory in which to mount this volume.
571-
// Volumes are mounted in containers at `/volumes/{name}`.
572-
// ---
573-
// This also goes into the [corev1.Volume.Name] field, which is a [DNS1123Label].
574-
// https://pkg.go.dev/k8s.io/kubernetes/pkg/apis/core/validation#ValidatePodSpec
575-
// https://pkg.go.dev/k8s.io/kubernetes/pkg/apis/core/validation#ValidateVolumes
576-
//
577-
// We prepend "volumes-" to avoid collisions with other [corev1.PodSpec.Volumes],
578-
// so the maximum is 8 less than the inherited 63.
579-
// +kubebuilder:validation:MaxLength=55
580-
//
581-
// +required
582-
Name DNS1123Label `json:"name"`
583-
584-
// When true, mount the volume read-only, otherwise read-write. Defaults to false.
585-
// ---
586-
// [corev1.VolumeMount.ReadOnly]
587-
//
588-
// +optional
589-
ReadOnly bool `json:"readOnly,omitempty"`
590-
}
591-
592544
type TablespaceVolume struct {
593545
// This value goes into
594546
// a. the name of a corev1.PersistentVolumeClaim,

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

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -257,34 +257,50 @@ func (meta *Metadata) GetAnnotationsOrNil() map[string]string {
257257
return meta.Annotations
258258
}
259259

260+
// ---
261+
// Only one applier should be managing each volume definition.
262+
// https://docs.k8s.io/reference/using-api/server-side-apply#merge-strategy
263+
// +structType=atomic
260264
type AdditionalVolume struct {
261-
// A reference to a preexisting PVC.
265+
// Name of an existing PersistentVolumeClaim.
262266
// ---
267+
// https://pkg.go.dev/k8s.io/kubernetes/pkg/apis/core/validation#ValidatePersistentVolumeClaim
268+
// https://pkg.go.dev/k8s.io/kubernetes/pkg/apis/core/validation#ValidatePersistentVolumeName
269+
//
263270
// +required
264271
ClaimName DNS1123Subdomain `json:"claimName"`
265272

266-
// The containers to attach this volume to.
267-
// An omitted `Containers` field matches all containers.
268-
// An empty `Containers` field matches no containers.
273+
// The names of containers in which to mount this volume.
274+
// The default mounts the volume in *all* containers. An empty list does not mount the volume to any containers.
269275
// ---
270-
// +optional
271-
// +listType=atomic
276+
// These are matched against [corev1.Container.Name] in a PodSpec, which is a [DNS1123Label].
277+
// https://pkg.go.dev/k8s.io/kubernetes/pkg/apis/core/validation#ValidatePodSpec
278+
//
279+
// Container names are unique within a Pod, so this list can be, too.
280+
// +listType=set
281+
//
272282
// +kubebuilder:validation:MaxItems=10
273-
Containers []string `json:"containers,omitempty"`
283+
// +optional
284+
Containers []DNS1123Label `json:"containers"`
274285

275-
// The name of the volume used for mounting path.
276-
// Volumes are mounted in the pods at `volumes/<NAME>`
277-
// Must be unique.
286+
// The name of the directory in which to mount this volume.
287+
// Volumes are mounted in containers at `/volumes/{name}`.
278288
// ---
279-
// The `Name` field is a `DNS1123Label` type to enforce
280-
// the max length.
281-
// +required
282-
// Max length is less than max 63 to allow prepending `volumes-` to name
289+
// This also goes into the [corev1.Volume.Name] field, which is a [DNS1123Label].
290+
// https://pkg.go.dev/k8s.io/kubernetes/pkg/apis/core/validation#ValidatePodSpec
291+
// https://pkg.go.dev/k8s.io/kubernetes/pkg/apis/core/validation#ValidateVolumes
292+
//
293+
// We prepend "volumes-" to avoid collisions with other [corev1.PodSpec.Volumes],
294+
// so the maximum is 8 less than the inherited 63.
283295
// +kubebuilder:validation:MaxLength=55
296+
//
297+
// +required
284298
Name DNS1123Label `json:"name"`
285299

286-
// Sets the write/read mode of the volume
300+
// When true, mount the volume read-only, otherwise read-write. Defaults to false.
287301
// ---
302+
// [corev1.VolumeMount.ReadOnly]
303+
//
288304
// +optional
289305
ReadOnly bool `json:"readOnly,omitempty"`
290306
}

0 commit comments

Comments
 (0)