Skip to content

Commit

Permalink
try to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
welpaolo committed Sep 12, 2024
1 parent 40966da commit 5ef54d7
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion tests/integration/setup-aws-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,38 @@
sudo snap install aws-cli --classic


get_s3_endpoint(){
# Print the endpoint where the S3 bucket is exposed on.
kubectl get service minio -n minio-operator -o jsonpath='{.spec.clusterIP}'
}


get_s3_access_key(){
# Print the S3 Access Key by reading it from K8s secret or by outputting the default value
kubectl get secret -n minio-operator microk8s-user-1
if [ $? -eq 0 ]; then
echo "Use access-key from secret"
access_key=$(kubectl get secret -n minio-operator microk8s-user-1 -o jsonpath='{.data.CONSOLE_ACCESS_KEY}' | base64 -d)
else
echo "use default access-key"
access_key="minio"
fi
echo "$access_key"
}


source ./tests/integration/utils/s3-utils.sh
get_s3_secret_key(){
# Print the S3 Secret Key by reading it from K8s secret or by outputting the default value
kubectl get secret -n minio-operator microk8s-user-1
if [ $? -eq 0 ]; then
echo "Use access-key from secret"
secret_key=$(kubectl get secret -n minio-operator microk8s-user-1 -o jsonpath='{.data.CONSOLE_SECRET_KEY}' | base64 -d)
else
echo "use default access-key"
secret_key="minio123"
fi
echo "$secret_key"
}

wait_and_retry(){
# Retry a command for a number of times by waiting a few seconds.
Expand Down

0 comments on commit 5ef54d7

Please sign in to comment.