-
Notifications
You must be signed in to change notification settings - Fork 0
COSI-15: Add bucket creation E2E tests and cleanup #12
Conversation
f672fba
to
f89855f
Compare
Added a commit to improve kube error handling catch. |
@@ -5,7 +5,7 @@ metadata: | |||
namespace: default | |||
type: Opaque | |||
stringData: | |||
COSI_S3_ACCESS_KEY_ID: accessKey1 # Plain text access key | |||
COSI_S3_SECRET_ACCESS_KEY: verySecretKey1 # Plain text secret key | |||
COSI_S3_ACCESS_KEY_ID: PBUOB68AVF39EVVAFNFL # Plain text access key, generated in the CI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will use github variables later for these, for now keeping it simple
to be expanded in https://scality.atlassian.net/browse/OS-882
log_and_run echo "Creating account in Vault container..." | ||
CONTAINER_ID=$(docker ps -qf "name=s3_and_iam_deployment-iam-1") | ||
log_and_run docker exec "$CONTAINER_ID" sh -c "ADMIN_ACCESS_KEY_ID=D4IT2AWSB588GO5J9T00 ADMIN_SECRET_ACCESS_KEY=UEEu8tYlsOGGrgf4DAiSZD6apVNPUWqRiPG0nTB6 ./node_modules/vaultclient/bin/vaultclient create-account --name cosi-account --email [email protected]" | ||
log_and_run docker exec "$CONTAINER_ID" sh -c "ADMIN_ACCESS_KEY_ID=D4IT2AWSB588GO5J9T00 ADMIN_SECRET_ACCESS_KEY=UEEu8tYlsOGGrgf4DAiSZD6apVNPUWqRiPG0nTB6 ./node_modules/vaultclient/bin/vaultclient generate-account-access-key --name=cosi-account --accesskey=PBUOB68AVF39EVVAFNFL --secretkey=P+PK+uMB9spUc21huaQoOexqdJoV00tSnl+pc7t7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will use github variables later for these, for now keeping it simple
to be expanded in https://scality.atlassian.net/browse/OS-882
aws_access_key_id = PBUOB68AVF39EVVAFNFL | ||
aws_secret_access_key = P+PK+uMB9spUc21huaQoOexqdJoV00tSnl+pc7t7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will use github variables later for these, for now keeping it simple
to be expanded in https://scality.atlassian.net/browse/OS-882
COSI_S3_ACCESS_KEY_ID: PBUOB68AVF39EVVAFNFL | ||
COSI_S3_SECRET_ACCESS_KEY: P+PK+uMB9spUc21huaQoOexqdJoV00tSnl+pc7t7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will use github variables later for these, for now keeping it simple
to be expanded in https://scality.atlassian.net/browse/OS-882
d915e23
to
bdcec3e
Compare
f89855f
to
16f0ca6
Compare
re-based with origin |
|
||
# Step 1: Create Account in Vault | ||
log_and_run echo "Creating account in Vault container..." | ||
CONTAINER_ID=$(docker ps -qf "name=s3_and_iam_deployment-iam-1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nit. It seems like the container name is static so you could use that instead of retrieving the container id for exec
Might be some complications I'm not seeing though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used to do that, but then got hurt so many times.
But makes sense here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to create an action for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added in scality/cosi-driver@47119a1
} | ||
|
||
log_and_run echo "Removing COSI driver manifests and namespace..." | ||
log_and_run kubectl delete -k . || echo "COSI driver manifests not found." | tee -a "$LOG_FILE" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure the redirection works the way you indended it to due to priority of operators: here the tee
only receives the output of the echo
command, not the log_and_run
output. If you want to redirect both commands you'd need to group them like
{ log_and_run ... || echo "error..."; } | tee -a "$LOG_FILE"
And if you also want stderr to be redirected:
{ log_and_run ... || echo "error..."; } 2>&1 | tee -a "$LOG_FILE"
The same applies to other commands below.
If you actually intend to only redirect the echo
, then it can make sense to group with { echo .. | tee; }
just for clarity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its meant for the latter.
added in 1e58730
log_and_run kubectl patch bucket "$BUCKET_NAME" -p '{"metadata":{"finalizers":[]}}' --type=merge || echo "Finalizers not found for bucket: $BUCKET_NAME" | tee -a "$LOG_FILE" | ||
done | ||
|
||
log_and_run echo "Deleting Bucket Claim and Bucket Class..." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor, just to avoid surprises in case one command fails, to not wrongly assume that the other was executed:
log_and_run echo "Deleting Bucket Claim and Bucket Class..." | |
log_and_run echo "Deleting Bucket Class and Bucket Claim..." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed in 1e58730
COSI_S3_ACCESS_KEY_ID: PBUOB68AVF39EVVAFNFL | ||
COSI_S3_SECRET_ACCESS_KEY: P+PK+uMB9spUc21huaQoOexqdJoV00tSnl+pc7t7 | ||
COSI_S3_ENDPOINT: http://$HOST_IP:8000 | ||
COSI_S3_REGION: us-west-1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In .aws/config
you used us-east-1
. Does it make any difference ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it doesn't make a difference
Closing this in favor of scality/cosi-driver#1 |
Based on PR: #11
Add bucket creation E2E tests and cleanup for tests