Skip to content

Commit f11c400

Browse files
benjaminjbcbandy
andauthored
Apply suggestions from code review
Co-authored-by: Chris Bandy <bandy.chris@gmail.com>
1 parent c34c682 commit f11c400

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/controller/postgrescluster/instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@ func (r *Reconciler) reconcileInstance(
12541254
}
12551255

12561256
// mount additional volumes to the Postgres instance containers
1257-
if err == nil && spec.Volumes != nil && spec.Volumes.Additional != nil {
1257+
if err == nil && spec.Volumes != nil && len(spec.Volumes.Additional) > 0 {
12581258
addAdditionalVolumesToSpecifiedContainers(&instance.Spec.Template, spec.Volumes.Additional)
12591259
}
12601260

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ type PostgresVolumesSpec struct {
538538
// +listType=map
539539
// +listMapKey=name
540540
// +kubebuilder:validation:MaxItems=10
541-
Additional []*AdditionalVolume `json:"additional,omitempty"`
541+
Additional []AdditionalVolume `json:"additional,omitempty"`
542542
}
543543

544544
type AdditionalVolume struct {
@@ -549,8 +549,8 @@ type AdditionalVolume struct {
549549
// The `Name` field is a `DNS1123Subdomain` type to enforce
550550
// the max length and also allow us to more easily transition
551551
// to CPK-provisioned volumes.
552-
// +kubebuilder:validation:Required
553-
Name DNS1123Subdomain `json:"name,omitempty"`
552+
// +required
553+
Name DNS1123Subdomain `json:"name"`
554554

555555
// A reference to a preexisting PVC.
556556
// ---

0 commit comments

Comments
 (0)