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

fix: change the data structure of the ips output #354

Merged
merged 3 commits into from
Aug 4, 2023
Merged

Conversation

Aashiq-J
Copy link
Member

@Aashiq-J Aashiq-J commented Aug 2, 2023

Description

Any insertion / deletion in list at https://github.com/terraform-ibm-modules/terraform-ibm-vpe-module/blob/f0ca43341640f18bfbf54431c84eaae0c039c704/variables.tf#L61C28-L61C28 results in the VPE IP changing for the services after the modification in the list.

This is problematic for consumers that have an expectation of IP stability. See whether we could come up with a data structure here that does not result in this issue - eg: a map.
Issue: #343

Types of changes in this PR

Changes that affect the core Terraform module or submodules

  • Bug fix
  • New feature
  • Dependency update

Changes that don't affect the core Terraform module or submodules

  • Examples or tests (addition or updates of examples or tests)
  • Documentation update
  • CI-related update (pipeline, etc.)
  • Other

Release required?

Identify the type of release. For information about the changes in a semantic versioning release, see Release versioning.

  • No release
  • Patch release (x.x.X)
  • Minor release (x.X.x)
  • Major release (X.x.x)
Release notes content

Update to the data structure of the vpe_ips output. Added the gateway name as the key for each list of objects. This will help in differentiating the IPs for each gateways. For example:

  • Older versions:
[
   [
       {
           address       = "10.10.10.5"
           id            = "xxxx-xxxxx-xxxxxx-xxxxx"
           name          = "sandbank-disports-sleeve-dugout"
           resource_type = "subnet_reserved_ip"
           subnet        = ""
        },
       {
           address       = "10.20.10.5"
           id            = "xxxx-xxxxx-xxxxxx-xxxxx"
           name          = "bannister-food-quarrel-concept"
           resource_type = "subnet_reserved_ip"
           subnet        = ""
        },
    ],
   [
       {
           address       = "10.10.10.4"
           id            = "xxxx-xxxxx-xxxxxx-xxxxx"
           name          = "haunt-tank-recital-princess"
           resource_type = "subnet_reserved_ip"
           subnet        = ""
        },
       {
           address       = "10.20.10.6"
           id            = "xxxx-xxxxx-xxxxxx-xxxxx"
           name          = "vigorous-tarantula-cash-reverse"
           resource_type = "subnet_reserved_ip"
           subnet        = ""
        },
    ],
]
  • Newer versions:
{
    test-vpc-instance-account-management      = [
        {
            address       = "10.30.10.5"
            id            = "xxxx-xxxxx-xxxxxx-xxxxx"
            name          = "handwoven-poem-retention-mantis"
            resource_type = "subnet_reserved_ip"
            subnet        = ""
         },
        {
            address       = "10.10.10.12"
            id            = "xxxx-xxxxx-xxxxxx-xxxxx"
            name          = "smog-dastardly-bountiful-calf"
            resource_type = "subnet_reserved_ip"
            subnet        = ""
         },
     ]
    test-vpc-instance-billing                 = [
        {
            address       = "10.10.10.16"
            id            = "xxxx-xxxxx-xxxxxx-xxxxx"
            name          = "daffy-outfield-scrambled-showy"
            resource_type = "subnet_reserved_ip"
            subnet        = ""
         },
        {
            address       = "10.20.10.22"
            id            = "xxxx-xxxxx-xxxxxx-xxxxx"
            name          = "frogman-deflector-foe-deem"
            resource_type = "subnet_reserved_ip"
            subnet        = ""
         },
     ],
}

Run the pipeline

If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.

Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:

/run pipeline

Checklist for reviewers

  • If relevant, a test for the change is included or updated with this PR.
  • If relevant, documentation for the change is included or updated with this PR.

Merge actions for mergers

  • Use a relevant conventional commit message that is based on the PR contents and any release notes provided by the PR author. The commit message determines whether a new version of the module is needed, and if so, which semver increment to use (major, minor, or patch).
  • Merge by using "Squash and merge".

@Aashiq-J
Copy link
Member Author

Aashiq-J commented Aug 2, 2023

/run pipeline

@Aashiq-J Aashiq-J marked this pull request as ready for review August 2, 2023 08:47
@Aashiq-J
Copy link
Member Author

Aashiq-J commented Aug 2, 2023

/run pipeline

@ocofaigh ocofaigh requested a review from shemau August 2, 2023 16:20
@ocofaigh
Copy link
Member

ocofaigh commented Aug 2, 2023

@shemau Want to make you aware of this change, since you mentioned issues with this output in scrum today

Copy link
Contributor

@shemau shemau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good.

@ocofaigh
Copy link
Member

ocofaigh commented Aug 3, 2023

@Aashiq-J Can you please fill in the release notes section, and include a sample of what the new output looks like vs the old so consumers know how to consume in the new version

@Aashiq-J
Copy link
Member Author

Aashiq-J commented Aug 4, 2023

/run pipeline

@Aashiq-J
Copy link
Member Author

Aashiq-J commented Aug 4, 2023

@ocofaigh , Updated the release notes.
Thanks

@ocofaigh ocofaigh merged commit f864fbb into main Aug 4, 2023
2 checks passed
@ocofaigh ocofaigh deleted the ip-output branch August 4, 2023 09:37
@terraform-ibm-modules-ops
Copy link
Contributor

🎉 This PR is included in version 2.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

None yet

4 participants