Skip to content

Commit

Permalink
COSI-75: re-organize-greenfield-custom-resources
Browse files Browse the repository at this point in the history
  • Loading branch information
anurag4DSB committed Dec 20, 2024
1 parent 921135b commit a3e7337
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .github/scripts/cleanup_cosi_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"; }
Expand Down
16 changes: 8 additions & 8 deletions .github/scripts/e2e_tests_greenfield_use_case.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down Expand Up @@ -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..."
Expand All @@ -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"
Expand Down Expand Up @@ -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.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/driver-params.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a3e7337

Please sign in to comment.