Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
name: pgdog
version: v0.82
version: v0.83
appVersion: "v0.1.58"
3 changes: 3 additions & 0 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ spec:
spec:
accessModes:
- ReadWriteOnce
{{- if hasKey .Values.statefulSet.walPvc "storageClassName" }}
storageClassName: {{ .Values.statefulSet.walPvc.storageClassName | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.statefulSet.walPvc.size | quote }}
Expand Down
18 changes: 18 additions & 0 deletions test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,23 @@ else
exit 1
fi

echo ""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as last PR, let's stop adding tests here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh my bad i missed the comment on the last pr!

echo "==> Validating WAL PVC StorageClass selection..."
wal_pvc_storage_class() {
helm template test-release "$CHART_DIR" -f "$1" "${@:2}" \
| yq -r 'select(.kind == "StatefulSet") | .spec.volumeClaimTemplates[0].spec.storageClassName'
}

default_class=$(wal_pvc_storage_class "$TEST_DIR/values-statefulset.yaml")
custom_class=$(wal_pvc_storage_class "$TEST_DIR/values-statefulset-storage-class.yaml")
no_class=$(wal_pvc_storage_class "$TEST_DIR/values-statefulset.yaml" --set 'statefulSet.walPvc.storageClassName=')

if [ "$default_class" = "null" ] && [ "$custom_class" = "balanced-storage" ] && [ -z "$no_class" ]; then
echo " WAL PVC uses the default, specified, or disabled StorageClass as requested"
else
echo " FAIL: unexpected WAL PVC StorageClass (default=$default_class, custom=$custom_class, disabled=$no_class)"
exit 1
fi

echo ""
echo "==> All tests passed!"
6 changes: 6 additions & 0 deletions test/values-statefulset-storage-class.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Pin WAL volumes to a StorageClass compatible with the PgDog node pool.
statefulSet:
enabled: true
walPvc:
enabled: true
storageClassName: balanced-storage
3 changes: 3 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ statefulSet:
walPvc:
enabled: false
size: 1Gi
# Set to a StorageClass compatible with the nodes running PgDog.
# Omit to use the cluster default; set to "" to disable dynamic provisioning.
# storageClassName: balanced-storage

# env allows setting custom environment variables on the pgdog container
# Note: NODE_ID is automatically generated and cannot be overridden
Expand Down
Loading