Skip to content

Commit 7957ba8

Browse files
committed
update comments
1 parent 402c30d commit 7957ba8

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

internal/controller/postgrescluster/postgres.go

-2
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,6 @@ func (r *Reconciler) reconcilePostgresDataVolume(
561561
return pvc, err
562562
}
563563

564-
// TODO think about multiple tablespace volumes
565-
566564
// +kubebuilder:rbac:groups="",resources=persistentvolumeclaims,verbs=create;patch
567565

568566
// reconcileTablespaceVolumes writes the PersistentVolumeClaims for instance's

internal/postgres/config.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -205,15 +205,14 @@ func startupCommand(
205205
version := fmt.Sprint(cluster.Spec.PostgresVersion)
206206
walDir := WALDirectory(cluster, instance)
207207

208-
// If the user requests tablespaces, we want to create and chmod the directories
208+
// If the user requests tablespaces, we want to make sure the directories exist with the
209+
// correct owner and permissions.
209210
tablespaceCmd := ""
210211
if util.DefaultMutableFeatureGate.Enabled(util.TablespaceVolumes) && instance.TablespaceVolumes != nil {
211212
// This command checks if a dir exists and if not, creates it;
212213
// if the dir does exist, then we `recreate` it to make sure the owner is correct;
213214
// but if the dir exists with the wrong owner and is not writeable, we error.
214215
// This is the same behavior we use for the main PGDATA directory.
215-
// The path for tablespaces volumes is /tablespaces/NAME/data
216-
// -- the `data` path is added so that we can arrange the permissions.
217216
checkInstallRecreateCmd := strings.Join([]string{
218217
`if [[ ! -e "${tablespace_dir}" || -O "${tablespace_dir}" ]]; then`,
219218
`install --directory --mode=0700 "${tablespace_dir}"`,
@@ -224,6 +223,8 @@ func startupCommand(
224223
}, "\n")
225224

226225
for _, tablespace := range instance.TablespaceVolumes {
226+
// The path for tablespaces volumes is /tablespaces/NAME/data
227+
// -- the `data` path is added so that we can arrange the permissions.
227228
tablespaceCmd = tablespaceCmd + "\ntablespace_dir=/tablespaces/" + tablespace.Name + "/data" + "\n" +
228229
checkInstallRecreateCmd
229230
}

0 commit comments

Comments
 (0)