-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix snapshot restoration and add integration test
- Loading branch information
1 parent
46e0d1f
commit 93981b3
Showing
4 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: snapshots-pvc | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
updateConfigurationOnChange: true | ||
snapshotRestoration: | ||
enabled: true | ||
pvcName: snapshots-pvc | ||
# To be supplied via --set | ||
snapshots: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Inspired by https://github.com/qdrant/qdrant/blob/v1.6.1/tests/snapshots/snapshots-recovery.sh | ||
|
||
QDRANT_URL="http://qdrant.qdrant-helm-integration:6333" | ||
|
||
setup_file() { | ||
# Create the PVC, then helm upgrade with no snapshots so that the PVC gets mounted | ||
kubectl apply -f test/integration/assets/snapshot-pvc.yaml -n qdrant-helm-integration | ||
helm upgrade --install qdrant charts/qdrant -n qdrant-helm-integration -f test/integration/assets/snapshot-values.yaml --set snapshotRestoration.snapshots=null --wait | ||
kubectl rollout status statefulset qdrant -n qdrant-helm-integration | ||
|
||
# Create the test data and create a snapshot | ||
helm test qdrant -n qdrant-helm-integration --logs | ||
SNAPSHOT_NAME=$(kubectl exec -n default curl -- curl -X POST "$QDRANT_URL/collections/test_collection/snapshots" | grep -o 'test_collection.*\.snapshot') | ||
} | ||
|
||
|
||
@test "snapshot restoration works" { | ||
kubectl exec -n default curl -- curl -X DELETE "$QDRANT_URL/collections/test_collection?wait" | ||
|
||
helm upgrade --install qdrant charts/qdrant -n qdrant-helm-integration -f test/integration/assets/snapshot-values.yaml --set snapshotRestoration.snapshots="{/qdrant/snapshots/test_collection/$SNAPSHOT_NAME\:test_collection}" --wait | ||
kubectl rollout status statefulset qdrant -n qdrant-helm-integration | ||
# Wait for snapshot restoration step to finish | ||
sleep 2 | ||
run kubectl exec -n default curl -- curl -s $QDRANT_URL/collections/test_collection/points/6 --fail-with-body | ||
[ $status -eq 0 ] | ||
[[ "${output}" =~ .*\"Mumbai\".* ]] | ||
} |