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: fixes the 'type' property of 'user' varaible #226

Merged
merged 9 commits into from
Aug 1, 2024
Merged

Conversation

Khuzaima05
Copy link
Member

@Khuzaima05 Khuzaima05 commented Jul 12, 2024

Description

Fixd the users variable to make type property optional as per documentation

issue: #219

Release required?

  • 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.

@Khuzaima05
Copy link
Member Author

/run pipeline

variables.tf Outdated
password = string # pragma: allowlist secret
type = string # "type" is required to generate the connection string for the outputs.
password = string # pragma: allowlist secret
type = optional(string) # "type" is required to generate the connection string for the outputs.
Copy link
Member

Choose a reason for hiding this comment

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

hmm, we are now contradicting what that code comment says: "type" is required to generate the connection string for the outputs.

@Khuzaima05 @imprateeksh @shemau if type is made optional, do we break the outputs if its not passed?

Copy link
Contributor

Choose a reason for hiding this comment

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

The provider should default the value to database, so this should probably never have been required. If there was a dependency (to make it required) with users this was likely removed by the work to make it use the administrator account automatically created during the database creation.

So I am pretty certain this is not going to cause issues. This should probably be tested/validated at least manually before merging.

The comment should be removed and the change should be made to all 8 databases if it is made to 1.

Copy link
Member

Choose a reason for hiding this comment

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

@Khuzaima05 can you do some testing and report findings? If we are good remove the comment.
And as Steve said, we will want to do this to all ICD modules

Copy link
Member Author

Choose a reason for hiding this comment

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

@ocofaigh , When i try to test for optional value for type.

I have set value for var.users in complete example as :

users = [ {
name = "Khuzaima"
password = "Khuzaima8953153811"
} ]

I was getting this error

elasticsearch_cluster_settings.global: Creating...
elasticsearch_index.test: Creating...
╷
│ Error: Head "https://fbed8076-2806-4c7c-b31a-df85f0606ac7.c13paqsd05a0ept695ng.databases.appdomain.cloud:30750": context deadline exceeded
│ 
│   with elasticsearch_index.test,
│   on main.tf line 75, in resource "elasticsearch_index" "test":
│   75: resource "elasticsearch_index" "test" {
│ 
╵
╷
│ Error: Head "https://fbed8076-2806-4c7c-b31a-df85f0606ac7.c13paqsd05a0ept695ng.databases.appdomain.cloud:30750": context deadline exceeded
│ 
│   with elasticsearch_cluster_settings.global,
│   on main.tf line 83, in resource "elasticsearch_cluster_settings" "global":
│   83: resource "elasticsearch_cluster_settings" "global" {

Then I try to run complete example in main branch without any change.

There also i am getting same error during terraform apply:

time_sleep.wait: Still creating... [10s elapsed]
time_sleep.wait: Creation complete after 15s [id=2024-07-18T06:53:23Z]
elasticsearch_cluster_settings.global: Creating...
elasticsearch_index.test: Creating...
╷
│ Error: Head "https://849fdfc8-4eb2-4da0-b0e5-fcb5f56813f4.c5km1ted03t0e8geevf0.databases.appdomain.cloud:31300": context deadline exceeded
│ 
│   with elasticsearch_index.test,
│   on main.tf line 75, in resource "elasticsearch_index" "test":
│   75: resource "elasticsearch_index" "test" {
│ 
╵
╷
│ Error: Head "https://849fdfc8-4eb2-4da0-b0e5-fcb5f56813f4.c5km1ted03t0e8geevf0.databases.appdomain.cloud:31300": context deadline exceeded
│ 
│   with elasticsearch_cluster_settings.global,
│   on main.tf line 83, in resource "elasticsearch_cluster_settings" "global":
│   83: resource "elasticsearch_cluster_settings" "global" {
│ 
╵

@Khuzaima05
Copy link
Member Author

@shemau @daniel-butler-irl

While working on this PR, I am encountering this error while running complete example:

time_sleep.wait: Still creating... [10s elapsed]
time_sleep.wait: Creation complete after 15s [id=2024-07-18T06:53:23Z]
elasticsearch_cluster_settings.global: Creating...
elasticsearch_index.test: Creating...
╷
│ Error: Head "https://849fdfc8-4eb2-4da0-b0e5-fcb5f56813f4.c5km1ted03t0e8geevf0.databases.appdomain.cloud:31300": context deadline exceeded
│ 
│   with elasticsearch_index.test,
│   on main.tf line 75, in resource "elasticsearch_index" "test":
│   75: resource "elasticsearch_index" "test" {
│ 
╵
╷
│ Error: Head "https://849fdfc8-4eb2-4da0-b0e5-fcb5f56813f4.c5km1ted03t0e8geevf0.databases.appdomain.cloud:31300": context deadline exceeded
│ 
│   with elasticsearch_cluster_settings.global,
│   on main.tf line 83, in resource "elasticsearch_cluster_settings" "global":
│   83: resource "elasticsearch_cluster_settings" "global" {
│ 
╵

Its a generic error i am getting irrespective of this issue

@daniel-butler-irl
Copy link
Member

/run pipeline

@ocofaigh
Copy link
Member

/run pipeline

@Khuzaima05
Copy link
Member Author

/run pipeline

Copy link
Member

@ocofaigh ocofaigh left a comment

Choose a reason for hiding this comment

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

@Khuzaima05 you forgot to update the DA

@Khuzaima05
Copy link
Member Author

/run pipeline

@Khuzaima05
Copy link
Member Author

/run pipeline

@ocofaigh ocofaigh merged commit a3c39f8 into main Aug 1, 2024
2 checks passed
@ocofaigh ocofaigh deleted the issue_9937 branch August 1, 2024 15:46
@terraform-ibm-modules-ops
Copy link
Contributor

🎉 This issue has been resolved in version 1.15.2 🎉

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.

5 participants