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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Cloud Databases): remove bluemix-go dependency for allowlist #4222

Merged
merged 2 commits into from Dec 6, 2022

Conversation

alexhemard
Copy link
Collaborator

@alexhemard alexhemard commented Dec 6, 2022

Related Issue: #4220

This PR:

  • Removes the bluemix-go sdk dependency for supporting the deprecated whitelist attribute
  • Uses PUT /v5/ibm/deployments/{id}/allowlists/ip_addresses endpoint for setting allowlists

Community Note

  • Please vote on this pull request by adding a 馃憤 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #0000

Output from acceptance testing:

make testacc TEST=./ibm/service/database TESTARGS='-run=TestAccIBMDatabaseInstance'

...
PASS: TestAccIBMDatabaseInstanceElasticsearchImport 
PASS: TestAccIBMDatabaseInstanceEtcdImport 
PASS: TestAccIBMDatabaseInstanceMongodbBasic 
PASS: TestAccIBMDatabaseInstancePostgresAllowlistMigration 
PASS: TestAccIBMDatabaseInstancePostgresBasic 
PASS: TestAccIBMDatabaseInstancePostgresGroup
PASS: TestAccIBMDatabaseInstancePostgresGroupMigration 
PASS: TestAccIBMDatabaseInstancePostgresImport 
PASS: TestAccIBMDatabaseInstancePostgresNode 
PASS: TestAccIBMDatabaseInstance_Elasticsearch_Basic 
PASS: TestAccIBMDatabaseInstance_Elasticsearch_Group 
PASS: TestAccIBMDatabaseInstance_Elasticsearch_Node 
PASS: TestAccIBMDatabaseInstance_Etcd_Basic 
PASS: TestAccIBMDatabaseInstance_Rabbitmq_Basic 
PASS: TestAccIBMDatabaseInstance_Redis_Basic
PASS: TestAccIBMDatabaseInstance_Cassandra_Node
PASS: TestAccIBMDatabaseDataSource_basic

Comment on lines +1573 to 1577
if hasWhitelist {
ipAddresses = d.Get("whitelist").(*schema.Set)
} else {
ipAddresses = d.Get("allowlist").(*schema.Set)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since we are moving on to allowlist should that get preference here?
ie,

		if hasAllowlist {
			ipAddresses = d.Get("allowlist").(*schema.Set)
		} else {
			ipAddresses = d.Get("whitelist").(*schema.Set)
		}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@obai-1 Only one will be set since these attributes conflict with each other

Copy link
Collaborator

Choose a reason for hiding this comment

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

Gotcha

Comment on lines +1884 to 1888
if hasWhitelist {
d.Set("whitelist", flex.FlattenAllowlist(allowlist.IPAddresses))
} else {
d.Set("allowlist", flex.FlattenAllowlist(allowlist.IPAddresses))
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Comment on lines +2231 to +2234
if hasWhitelist {
_, entries = d.GetChange("whitelist")
} else if hasAllowlist {
_, entries = d.GetChange("allowlist")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

@obai-1 obai-1 left a comment

Choose a reason for hiding this comment

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

LGTM

@obai-1 obai-1 merged commit e4be24c into IBM-Cloud:master Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants