From a3e73373f003db33df8592ec7c9dab7ae5ae0f86 Mon Sep 17 00:00:00 2001 From: Anurag Mittal Date: Wed, 18 Dec 2024 12:57:49 +0100 Subject: [PATCH] COSI-75: re-organize-greenfield-custom-resources --- .github/scripts/cleanup_cosi_resources.sh | 8 ++++---- .github/scripts/e2e_tests_greenfield_use_case.sh | 16 ++++++++-------- cosi-examples/{ => greenfield}/bucketaccess.yaml | 0 .../{ => greenfield}/bucketaccessclass.yaml | 0 .../bucketclaim-deletion-policy.yaml | 0 cosi-examples/{ => greenfield}/bucketclaim.yaml | 0 .../bucketclass-deletion-policy.yaml | 0 cosi-examples/{ => greenfield}/bucketclass.yaml | 0 docs/driver-params.md | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) rename cosi-examples/{ => greenfield}/bucketaccess.yaml (100%) rename cosi-examples/{ => greenfield}/bucketaccessclass.yaml (100%) rename cosi-examples/{ => greenfield}/bucketclaim-deletion-policy.yaml (100%) rename cosi-examples/{ => greenfield}/bucketclaim.yaml (100%) rename cosi-examples/{ => greenfield}/bucketclass-deletion-policy.yaml (100%) rename cosi-examples/{ => greenfield}/bucketclass.yaml (100%) diff --git a/.github/scripts/cleanup_cosi_resources.sh b/.github/scripts/cleanup_cosi_resources.sh index c2d6cef..e83ff46 100755 --- a/.github/scripts/cleanup_cosi_resources.sh +++ b/.github/scripts/cleanup_cosi_resources.sh @@ -52,12 +52,12 @@ for BUCKET_NAME in $BUCKET_NAMES; do done log_and_run echo "Deleting Bucket Access Class..." -log_and_run kubectl delete -f cosi-examples/bucketaccessclass.yaml --all || { echo "No BucketAccessClass resources found." | tee -a "$LOG_FILE"; } +log_and_run kubectl delete -f cosi-examples/greenfield/bucketaccessclass.yaml --all || { echo "No BucketAccessClass resources found." | tee -a "$LOG_FILE"; } log_and_run echo "Deleting Bucket Class and Bucket Claim..." -log_and_run kubectl delete -f cosi-examples/bucketclass.yaml || { echo "Bucket Class not found." | tee -a "$LOG_FILE"; } -log_and_run kubectl delete -f cosi-examples/bucketclaim.yaml || { echo "Bucket Claim not found." | tee -a "$LOG_FILE"; } -log_and_run kubectl delete -f cosi-examples/bucketclass-delete-on-claim-removal.yaml || { echo "Bucket Class not found." | tee -a "$LOG_FILE"; } +log_and_run kubectl delete -f cosi-examples/greenfield/bucketclass.yaml || { echo "Bucket Class not found." | tee -a "$LOG_FILE"; } +log_and_run kubectl delete -f cosi-examples/greenfield/bucketclaim.yaml || { echo "Bucket Claim not found." | tee -a "$LOG_FILE"; } +log_and_run kubectl delete -f cosi-examples/greenfield/bucketclass-deletion-policy.yaml || { echo "Bucket Class not found." | tee -a "$LOG_FILE"; } log_and_run echo "Deleting s3-secret-for-cosi secret..." log_and_run kubectl delete secret s3-secret-for-cosi --namespace=default || { echo "Secret s3-secret-for-cosi not found." | tee -a "$LOG_FILE"; } diff --git a/.github/scripts/e2e_tests_greenfield_use_case.sh b/.github/scripts/e2e_tests_greenfield_use_case.sh index 2ea0a08..9f87580 100755 --- a/.github/scripts/e2e_tests_greenfield_use_case.sh +++ b/.github/scripts/e2e_tests_greenfield_use_case.sh @@ -83,19 +83,19 @@ EOF # Step 4: Apply Bucket Class log_and_run echo "Applying Bucket Class..." -log_and_run kubectl apply -f cosi-examples/bucketclass.yaml +log_and_run kubectl apply -f cosi-examples/greenfield/bucketclass.yaml # Step 5: Apply Bucket Claim log_and_run echo "Applying Bucket Claim..." -log_and_run kubectl apply -f cosi-examples/bucketclaim.yaml +log_and_run kubectl apply -f cosi-examples/greenfield/bucketclaim.yaml # Step 6: Apply Bucket Access Class log_and_run echo "Applying Bucket Access Class..." -log_and_run kubectl apply -f cosi-examples/bucketaccessclass.yaml +log_and_run kubectl apply -f cosi-examples/greenfield/bucketaccessclass.yaml # Step 7: Apply Bucket Access log_and_run echo "Applying Bucket Access..." -log_and_run kubectl apply -f cosi-examples/bucketaccess.yaml +log_and_run kubectl apply -f cosi-examples/greenfield/bucketaccess.yaml # Step 8: Verify Bucket Creation with Retry log_and_run echo "Listing all S3 buckets before verification..." @@ -213,7 +213,7 @@ fi # Step 11: Delete Bucket Access Resource log_and_run echo "Deleting Bucket Access Resource..." -log_and_run kubectl delete -f cosi-examples/bucketaccess.yaml +log_and_run kubectl delete -f cosi-examples/greenfield/bucketaccess.yaml # Step 12: Verify IAM User Deletion log_and_run echo "Verifying IAM user '$IAM_USER_NAME' deletion..." @@ -230,8 +230,8 @@ fi # Step 13: Test deletion bucket with deletion policy set log_and_run echo "Applying Bucket Class with deletion policy and respective Bucket Claim..." -log_and_run kubectl apply -f cosi-examples/bucketclass-deletion-policy.yaml -log_and_run kubectl apply -f cosi-examples/bucketclaim-deletion-policy.yaml +log_and_run kubectl apply -f cosi-examples/greenfield/bucketclass-deletion-policy.yaml +log_and_run kubectl apply -f cosi-examples/greenfield/bucketclaim-deletion-policy.yaml log_and_run echo "Listing all S3 buckets before deletion..." log_and_run aws s3 ls --endpoint-url "$S3_ENDPOINT" @@ -259,7 +259,7 @@ if [ -z "$BUCKET_TO_BE_DELETED" ]; then fi log_and_run echo "Deleting Bucket Claim..." -log_and_run kubectl delete -f cosi-examples/bucketclaim-deletion-policy.yaml +log_and_run kubectl delete -f cosi-examples/greenfield/bucketclaim-deletion-policy.yaml # Check if the bucket with name $BUCKET_TO_BE_DELETED exists by doing a head bucket. # If bucket exists, retry with ATTEMPTS and DELAY. If bucket is not found, test success. diff --git a/cosi-examples/bucketaccess.yaml b/cosi-examples/greenfield/bucketaccess.yaml similarity index 100% rename from cosi-examples/bucketaccess.yaml rename to cosi-examples/greenfield/bucketaccess.yaml diff --git a/cosi-examples/bucketaccessclass.yaml b/cosi-examples/greenfield/bucketaccessclass.yaml similarity index 100% rename from cosi-examples/bucketaccessclass.yaml rename to cosi-examples/greenfield/bucketaccessclass.yaml diff --git a/cosi-examples/bucketclaim-deletion-policy.yaml b/cosi-examples/greenfield/bucketclaim-deletion-policy.yaml similarity index 100% rename from cosi-examples/bucketclaim-deletion-policy.yaml rename to cosi-examples/greenfield/bucketclaim-deletion-policy.yaml diff --git a/cosi-examples/bucketclaim.yaml b/cosi-examples/greenfield/bucketclaim.yaml similarity index 100% rename from cosi-examples/bucketclaim.yaml rename to cosi-examples/greenfield/bucketclaim.yaml diff --git a/cosi-examples/bucketclass-deletion-policy.yaml b/cosi-examples/greenfield/bucketclass-deletion-policy.yaml similarity index 100% rename from cosi-examples/bucketclass-deletion-policy.yaml rename to cosi-examples/greenfield/bucketclass-deletion-policy.yaml diff --git a/cosi-examples/bucketclass.yaml b/cosi-examples/greenfield/bucketclass.yaml similarity index 100% rename from cosi-examples/bucketclass.yaml rename to cosi-examples/greenfield/bucketclass.yaml diff --git a/docs/driver-params.md b/docs/driver-params.md index f9b8b74..c9c56bd 100644 --- a/docs/driver-params.md +++ b/docs/driver-params.md @@ -9,7 +9,7 @@ The table below details the configuration parameters for BucketClass, which dete | `objectStorageSecretName` | The name of the Kubernetes secret containing S3 credentials and configuration. | `string` | Yes | | `objectStorageSecretNamespace` | The namespace in which the secret is located (e.g., `default`). | `string` (e.g., `default`) | Yes | -[Example](../cosi-examples/bucketclass.yaml) +[Example](../cosi-examples/greenfield/bucketclass.yaml) ## Configuration Parameters for Kubernetes secret containing S3 credentials and configuration