@@ -50,7 +50,6 @@ import (
50
50
"github.com/crunchydata/postgres-operator/internal/pgbackrest"
51
51
"github.com/crunchydata/postgres-operator/internal/pki"
52
52
"github.com/crunchydata/postgres-operator/internal/postgres"
53
- "github.com/crunchydata/postgres-operator/internal/util"
54
53
"github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
55
54
)
56
55
@@ -1118,21 +1117,19 @@ func (r *Reconciler) reconcileRestoreJob(ctx context.Context,
1118
1117
volumeMounts = append (volumeMounts , walVolumeMount )
1119
1118
}
1120
1119
1121
- if util .DefaultMutableFeatureGate .Enabled (util .TablespaceVolumes ) {
1122
- for _ , pgtablespaceVolume := range pgtablespaceVolumes {
1123
- tablespaceVolumeMount := postgres .TablespaceVolumeMount (
1124
- pgtablespaceVolume .Labels ["postgres-operator.crunchydata.com/data" ])
1125
- tablespaceVolume := corev1.Volume {
1126
- Name : tablespaceVolumeMount .Name ,
1127
- VolumeSource : corev1.VolumeSource {
1128
- PersistentVolumeClaim : & corev1.PersistentVolumeClaimVolumeSource {
1129
- ClaimName : pgtablespaceVolume .GetName (),
1130
- },
1120
+ for _ , pgtablespaceVolume := range pgtablespaceVolumes {
1121
+ tablespaceVolumeMount := postgres .TablespaceVolumeMount (
1122
+ pgtablespaceVolume .Labels [naming .LabelData ])
1123
+ tablespaceVolume := corev1.Volume {
1124
+ Name : tablespaceVolumeMount .Name ,
1125
+ VolumeSource : corev1.VolumeSource {
1126
+ PersistentVolumeClaim : & corev1.PersistentVolumeClaimVolumeSource {
1127
+ ClaimName : pgtablespaceVolume .GetName (),
1131
1128
},
1132
- }
1133
- volumes = append (volumes , tablespaceVolume )
1134
- volumeMounts = append (volumeMounts , tablespaceVolumeMount )
1129
+ },
1135
1130
}
1131
+ volumes = append (volumes , tablespaceVolume )
1132
+ volumeMounts = append (volumeMounts , tablespaceVolumeMount )
1136
1133
}
1137
1134
1138
1135
restoreJob := & batchv1.Job {}
@@ -1528,12 +1525,9 @@ func (r *Reconciler) reconcilePostgresClusterDataSource(ctx context.Context,
1528
1525
return errors .WithStack (err )
1529
1526
}
1530
1527
1531
- pgtablespaces := []* corev1.PersistentVolumeClaim {}
1532
- if util .DefaultMutableFeatureGate .Enabled (util .TablespaceVolumes ) {
1533
- pgtablespaces , err = r .reconcileTablespaceVolumes (ctx , cluster , instanceSet , fakeSTS , clusterVolumes )
1534
- if err != nil {
1535
- return errors .WithStack (err )
1536
- }
1528
+ pgtablespaces , err := r .reconcileTablespaceVolumes (ctx , cluster , instanceSet , fakeSTS , clusterVolumes )
1529
+ if err != nil {
1530
+ return errors .WithStack (err )
1537
1531
}
1538
1532
1539
1533
// reconcile the pgBackRest restore Job to populate the cluster's data directory
@@ -1626,14 +1620,12 @@ func (r *Reconciler) reconcileCloudBasedDataSource(ctx context.Context,
1626
1620
return errors .WithStack (err )
1627
1621
}
1628
1622
1629
- // TODO(benjaminjb): do we really need this?
1630
- pgtablespaces := []* corev1.PersistentVolumeClaim {}
1631
- if util .DefaultMutableFeatureGate .Enabled (util .TablespaceVolumes ) {
1632
- pgtablespaces , err = r .reconcileTablespaceVolumes (ctx , cluster , instanceSet , fakeSTS , clusterVolumes )
1633
- if err != nil {
1634
- return errors .WithStack (err )
1635
- }
1623
+ // TODO(benjaminjb): do we really need this for cloud-based datasources?
1624
+ pgtablespaces , err := r .reconcileTablespaceVolumes (ctx , cluster , instanceSet , fakeSTS , clusterVolumes )
1625
+ if err != nil {
1626
+ return errors .WithStack (err )
1636
1627
}
1628
+
1637
1629
// The `reconcileRestoreJob` was originally designed to take a PostgresClusterDataSource
1638
1630
// and rather than reconfigure that func's signature, we translate the PGBackRestDataSource
1639
1631
tmpDataSource := & v1beta1.PostgresClusterDataSource {
0 commit comments