Skip to content

use parameters_json for provision parameters #325

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

Merged
merged 10 commits into from
Oct 30, 2024
Merged

use parameters_json for provision parameters #325

merged 10 commits into from
Oct 30, 2024

Conversation

JunliWang
Copy link
Contributor

@JunliWang JunliWang commented Oct 28, 2024

Description

contribute to: #322
in order to support more complex provision parameters like mirroring.
eg.

parameters_json = jsonencode(
    {
      mirroring = {
        source_crn   = data.ibm_resource_instance.es_instance_source.id
        source_alias = "source-alias"
        target_alias = "target-alias"
        options = {
          topic_name_transform = {
             type = "rename" 
             rename = {
               add_prefix = "add_prefix"
               add_suffix = "add_suffix"
               remove_prefix = "remove_prefix"
               remove_suffix = "remove_suffix"
             }
          }
          group_id_transform = {
            type = "rename" 
            rename = {
              add_prefix = "add_prefix"
              add_suffix = "add_suffix"
              remove_prefix = "remove_prefix"
              remove_suffix = "remove_suffix"
            }
          }
        }
      }
    }
  )

Release required?

this change is not a feature or fix, and it is transparent to users.
and it is a prerequisite for adding mirroring support: #324 which will be a new release.

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

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.

For mergers

  • Use a conventional commit message to set the release level. Follow the guidelines.
  • Include information that users need to know about the PR in the commit message. The commit message becomes part of the GitHub release notes.
  • Use the Squash and merge option.

@JunliWang
Copy link
Contributor Author

/run pipeline

@JunliWang JunliWang changed the title use parameter_json for provision parameters use parameters_json for provision parameters Oct 28, 2024
@JunliWang
Copy link
Contributor Author

/run pipeline

@JunliWang
Copy link
Contributor Author

/run pipeline

@JunliWang
Copy link
Contributor Author

/run pipeline

@JunliWang
Copy link
Contributor Author

/run pipeline

@JunliWang
Copy link
Contributor Author

/run pipeline

@JunliWang
Copy link
Contributor Author

/run pipeline

@JunliWang
Copy link
Contributor Author

/run pipeline

@JunliWang
Copy link
Contributor Author

I used comment SKIP UPGRADE TEST to skip the upgrade test because standard plan instance does not support update parameters.

@ocofaigh
Copy link
Contributor

ocofaigh commented Oct 29, 2024

@JunliWang I'm not comfortable with the upgrade test being skipped. It is there for a reason and that is to ensure there are no breaking changes being introduced. For example what will happen to an instance that a user already has when they upgrade to the module version with the proposed changes in this PR. Will it try to recreate the instance? Update in place?

Looking at the logs from before you skipped it, I see this:

        	Messages:   	Resource(s) identified to be updated 
        	            	Name: es_instance
        	            	Address: module.event_streams.ibm_resource_instance.es_instance
        	            	Actions: [update]
        	            	DIFF:
        	            	  Before: 
        	            		{"parameters":"SECURE_VALUE_HIDDEN_HASH:-1201b12b20dae655c9c7a45820ef41df2fc9d3e58956f6cad94a19c0"}
        	            	  After: 
        	            		{"parameters":"SECURE_VALUE_HIDDEN_HASH:-a03132ff4a763a07877a448acf19f9c4216d9159cb7cbc05ed016279"}

This would seem to indicate that it is an update. Can you confirm this would be a non disruptive update?

@JunliWang
Copy link
Contributor Author

I did manual test with provider code, switching from parameters to parameters_json for Enterprise instance will update the instance in-place.
but I do not understand why the test in this module tests updating parameters for Standard instance, which does not support any provision/update parameters.

@ocofaigh
Copy link
Contributor

/run pipeline

@ocofaigh
Copy link
Contributor

@JunliWang Yea it seems the parameters were being passed regardless of what plan was used. But I guess the service was just ignoring them. Since this update is non disruptive, I approve this PR

@ocofaigh ocofaigh merged commit 88d2e35 into main Oct 30, 2024
2 checks passed
@ocofaigh ocofaigh deleted the parameter-json branch October 30, 2024 17:05
@terraform-ibm-modules-ops
Copy link
Contributor

🎉 This PR is included in version 2.7.0 🎉

The release is available on:

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.

3 participants