-
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.
Don't use alpine image for file permission updates (#69)
Using an additional image makes compliance validations harder. This also adds a test if the upgrade from root to nonRoot works correctly.
- Loading branch information
1 parent
afdec2c
commit 70f9d16
Showing
2 changed files
with
26 additions
and
2 deletions.
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,24 @@ | ||
setup_file() { | ||
kubectl create namespace qdrant-helm-integration | ||
kubectl create serviceaccount default -n qdrant-helm-integration || true | ||
} | ||
|
||
teardown_file() { | ||
helm uninstall qdrant -n qdrant-helm-integration | ||
kubectl delete serviceaccount default -n qdrant-helm-integration | ||
kubectl delete namespace qdrant-helm-integration | ||
} | ||
|
||
@test "update without security context to security context corrects file permissions" { | ||
helm install qdrant charts/qdrant --set-json 'podSecurityContext=false,containerSecurityContext=false' -n qdrant-helm-integration --wait | ||
kubectl rollout status statefulset qdrant -n qdrant-helm-integration | ||
user=$(kubectl exec qdrant-0 -n qdrant-helm-integration -- id -u) | ||
[ "${user}" = "0" ] | ||
user=$(kubectl exec qdrant-0 -n qdrant-helm-integration -- whoami) | ||
[ "${user}" = "root" ] | ||
helm upgrade --reset-values qdrant charts/qdrant -n qdrant-helm-integration --wait | ||
kubectl rollout status statefulset qdrant -n qdrant-helm-integration | ||
user=$(kubectl exec qdrant-0 -n qdrant-helm-integration -- id -u) | ||
[ "${user}" = "1000" ] | ||
|
||
} |