Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JUJU-3364] Fix manual aws #15431

Merged
merged 1 commit into from
Apr 6, 2023
Merged

Conversation

jack-w-shaw
Copy link
Member

Previously we would branch on if a vpc has been created. If one already exists, validate it is correctly configured or fail. However, somehow the vpc ends up incorrectly configured. Specifically the subnet disappears

So instead perform each step in setting up the vpc idempotently

Checklist

  • Code style: imports ordered, good names, simple structure, etc
  • Comments saying why design decisions were made
  • [ ] Go unit tests, with comments saying what you're testing
  • Integration tests, with comments saying what you're testing
  • [ ] doc.go added or updated in changed packages

QA steps

Base cases

With a 'clean' aws state (i.e. no vpcs called 'manual-deploy')

Ensure the following succeeds

./main.sh -v -c aws -p aws -R eu-west-2 manual test_deploy_manual

This should contain output:

===> Creating vpc vpc-0987e5dd6fee2d87b
===> Creating igw igw-036ecbd393d8fae51
===> Creating subnet subnet-030d0e55ee07d3870
===> Creating secgroup sg-057e2e3611589c4f6
===> Creating machines in aws

Now that resources have been created, run the suite again

./main.sh -v -c aws -p aws -R eu-west-2 manual test_deploy_manual

This should contain output:

===> Re-using vpc vpc-0987e5dd6fee2d87b
===> Re-using igw igw-036ecbd393d8fae51
===> Re-using subnet subnet-030d0e55ee07d3870
===> Re-using secgroup sg-057e2e3611589c4f6
===> Creating machines in aws

Special cases

Manually delete (detach first) the internet gateway attached to the vpc and re-run the test suite. It should succees and contain:

===> Re-using vpc vpc-0987e5dd6fee2d87b
===> Creating igw igw-036ecbd393d8fae51
===> Re-using subnet subnet-030d0e55ee07d3870
===> Re-using secgroup sg-057e2e3611589c4f6
===> Creating machines in aws

Manually delete the subnet in out vpc and re-run the test suite. It should succees and contain:

===> Re-using vpc vpc-0987e5dd6fee2d87b
===> Re-using igw igw-036ecbd393d8fae51
===> Creating subnet subnet-030d0e55ee07d3870
===> Re-using secgroup sg-057e2e3611589c4f6
===> Creating machines in aws

Manually delete the sec group called ci-manual-deploy and re-run the test suite. It should succees and contain:

===> Re-using vpc vpc-0987e5dd6fee2d87b
===> Re-using igw igw-036ecbd393d8fae51
===> Re-using subnet subnet-030d0e55ee07d3870
===> Creating secgroup sg-057e2e3611589c4f6
===> Creating machines in aws

Previously we would branch on if a vpc has been created. If one already
exists, validate it is correctly configured or fail. However, somehow
the vpc ends up incorrectly configured. Specifically the subnet
disappears

So instead perform each step in setting up the vpc idempotently
@hpidcock hpidcock added the 2.9 label Apr 5, 2023
@hpidcock
Copy link
Member

hpidcock commented Apr 6, 2023

/merge

@jujubot jujubot merged commit ae874f2 into juju:2.9 Apr 6, 2023
@jack-w-shaw jack-w-shaw mentioned this pull request Apr 6, 2023
jujubot added a commit that referenced this pull request Apr 6, 2023
#15442

Forward merge:
- #15423
- #15426
- #15431
- #15437

Some conflicts with tests/suites/deploy/deploy_default_series.sh

NOTE: the cs parts are removed from this test in 3.1
@jack-w-shaw jack-w-shaw mentioned this pull request Apr 6, 2023
jujubot added a commit that referenced this pull request Apr 6, 2023
#15443

Merges:
- #15423
- #15426
- #15431
- #15437
- #15438
- #15442

Trivial conflict with tests/suites/deploy/deploy_default_series.sh
@jack-w-shaw jack-w-shaw mentioned this pull request Apr 6, 2023
jujubot added a commit that referenced this pull request Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants