From 78fa58530ea747f991c0c09ede72ecd873dbcc9f Mon Sep 17 00:00:00 2001 From: Madhuri Yechuri Date: Fri, 12 Feb 2016 15:32:21 -0800 Subject: [PATCH 1/4] Delete S3 bucket after Client Node is setup. --- admin/installer/setup_client.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin/installer/setup_client.sh b/admin/installer/setup_client.sh index 73fe3e605b..a228acd4c5 100644 --- a/admin/installer/setup_client.sh +++ b/admin/installer/setup_client.sh @@ -55,5 +55,8 @@ ${DOCKER_CERT_HOME}/createclient.exp # Copy Docker Certificates directory to Ubuntu's home directory. cp -r ${DOCKER_CERT_HOME} ${UBUNTU_HOME} +# Cleanup S3 bucket used by CloudFormation so that subsequent stack destroy attempt succeeds. +s3cmd_wrapper del --recursive --config=/root/.s3cfg s3://${s3_bucket} + # Signal successful stack creation. curl ${SUCCESS_SIGNAL_URL} || echo "Failed to report success to ClusterHQ" From 06245e6753025b1768dc8db746eb63501652edcd Mon Sep 17 00:00:00 2001 From: Madhuri Yechuri Date: Fri, 12 Feb 2016 15:49:44 -0800 Subject: [PATCH 2/4] Delete S3 bucket. --- admin/installer/setup_client.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/admin/installer/setup_client.sh b/admin/installer/setup_client.sh index a228acd4c5..223b8eff2a 100644 --- a/admin/installer/setup_client.sh +++ b/admin/installer/setup_client.sh @@ -55,8 +55,12 @@ ${DOCKER_CERT_HOME}/createclient.exp # Copy Docker Certificates directory to Ubuntu's home directory. cp -r ${DOCKER_CERT_HOME} ${UBUNTU_HOME} -# Cleanup S3 bucket used by CloudFormation so that subsequent stack destroy attempt succeeds. +# Clear out S3 bucket used by CloudFormation so that subsequent stack destroy attempt succeeds. s3cmd_wrapper del --recursive --config=/root/.s3cfg s3://${s3_bucket} +# Delete S3 bucket with CloudFormation configuration. +s3cmd_wrapper rb --config=/root/.s3cfg s3://${s3_bucket} + + # Signal successful stack creation. curl ${SUCCESS_SIGNAL_URL} || echo "Failed to report success to ClusterHQ" From a3a7db4dc31448ff835d877aee6a8d28dba3aae5 Mon Sep 17 00:00:00 2001 From: Madhuri Yechuri Date: Fri, 12 Feb 2016 16:15:38 -0800 Subject: [PATCH 3/4] No need to remove S3 bucket in test_installer anymore. --- flocker/acceptance/endtoend/test_installer.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/flocker/acceptance/endtoend/test_installer.py b/flocker/acceptance/endtoend/test_installer.py index 248c1b599c..a89cd6cca8 100644 --- a/flocker/acceptance/endtoend/test_installer.py +++ b/flocker/acceptance/endtoend/test_installer.py @@ -176,13 +176,6 @@ def delete_cloudformation_stack(stack_id): :param unicode stack_id: The AWS cloudformation stack ID. :returns: A ``Deferred`` which fires when the stack has been deleted. """ - result = get_stack_report(stack_id) - outputs = result['Outputs'] - s3_bucket_name = get_output(outputs, 'S3Bucket') - check_output( - ['aws', 's3', 'rb', 's3://{}'.format(s3_bucket_name), '--force'] - ) - check_output( ['aws', 'cloudformation', 'delete-stack', '--stack-name', stack_id] From 74b9b6e43255f2598e3325891d0bb251902c682f Mon Sep 17 00:00:00 2001 From: Madhuri Yechuri Date: Fri, 12 Feb 2016 16:32:05 -0800 Subject: [PATCH 4/4] Remove S3 bucket name from CloudFormation Outputs tab. --- admin/installer/cloudformation.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/admin/installer/cloudformation.py b/admin/installer/cloudformation.py index 2a12bbc4f8..fc53125fce 100644 --- a/admin/installer/cloudformation.py +++ b/admin/installer/cloudformation.py @@ -391,9 +391,4 @@ def _validate_cluster_size(size): Value="export DOCKER_TLS_VERIFY=1", Description="Client config: Enable TLS client for Swarm." )) -template.add_output(Output( - "S3Bucket", - Value=Ref(s3bucket), - Description="Name of S3 bucket to hold cluster configuration files." -)) print(template.to_json())