Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

update variable min/max to single variable #49

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

tlinkin
Copy link

@tlinkin tlinkin commented Jul 4, 2019

Given the repeatability of the cluster size changing to a single value to also maintain coherence with the consul module seems like a good idea.

@tlinkin tlinkin requested review from autero1 and brikis98 as code owners July 4, 2019 12:34
Copy link
Collaborator

@brikis98 brikis98 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I agree this is probably the right change.

How did you test this? As far as I can see, the root main.tf has not been updated to use this new input variable...

@tlinkin
Copy link
Author

tlinkin commented Jul 6, 2019

We are using the module from git::https://github.com/tlinkin/terraform-aws-nomad.git//modules/nomad-cluster?ref=tf12 in Terraform Enterprise 0.12.3 and our environment is stable.

I will have a look at main.tf so the unit test work properly after merging.

@brikis98
Copy link
Collaborator

Thanks! Kicking off tests now.

main.tf Outdated Show resolved Hide resolved
@brikis98
Copy link
Collaborator

Re-running the tests

@brikis98
Copy link
Collaborator

This time, two tests failed again:

TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: �[31m
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: �[1m�[31mError: �[0m�[0m�[1mUnsupported argument�[0m
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: 
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: �[0m  on main.tf line 177, in module "nomad_clients":
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158:  177:   �[4mmin_size�[0m         = var.num_nomad_clients
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: �[0m
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: An argument named "min_size" is not expected here.
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: �[0m�[0m
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: �[31m
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: �[1m�[31mError: �[0m�[0m�[1mUnsupported argument�[0m
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: 
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: �[0m  on main.tf line 178, in module "nomad_clients":
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158:  178:   �[4mmax_size�[0m         = var.num_nomad_clients
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: �[0m
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: An argument named "max_size" is not expected here.
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: �[0m�[0m
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: �[31m
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: �[1m�[31mError: �[0m�[0m�[1mUnsupported argument�[0m
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: 
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: �[0m  on main.tf line 179, in module "nomad_clients":
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158:  179:   �[4mdesired_capacity�[0m = var.num_nomad_clients
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: �[0m
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: An argument named "desired_capacity" is not expected here.
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-11T15:15:27Z command.go:158: �[0m�[0m

Looks like you forgot to update some examples? Please test more thoroughly.

@tlinkin
Copy link
Author

tlinkin commented Jul 11, 2019

We never used the default example, but our module is running in production quite successfully. It is rather hard to test as I do not have any access to the output of your CircleCI and if all contributors are expected to spin up the test example scripts on their own and all the testing this would lead to rather stale development in my opinion.

Anyway the client example is exactly the same as the server example, which passes the test and runs in our production environment. I cannot see where the error is, if you can please point me in the right direction and I will fix it.

@tlinkin
Copy link
Author

tlinkin commented Jul 11, 2019

Anyway I found the error in the separate example. Fixed it.

@tlinkin tlinkin changed the base branch from tf12 to master July 11, 2019 21:10
@brikis98
Copy link
Collaborator

It is rather hard to test as I do not have any access to the output of your CircleCI and if all contributors are expected to spin up the test example scripts on their own and all the testing this would lead to rather stale development in my opinion.

The tests are automated. Docs are here: https://github.com/hashicorp/terraform-aws-nomad/tree/master/test

Anyway I found the error in the separate example. Fixed it.

Thanks. I'll kick off the tests again shortly.

@brikis98
Copy link
Collaborator

TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-18T13:35:43Z command.go:158: �[1m�[31mError: �[0m�[0m�[1mReference to undeclared input variable�[0m
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-18T13:35:43Z command.go:158: 
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-18T13:35:43Z command.go:158: �[0m  on main.tf line 168, in module "nomad_clients":
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-18T13:35:43Z command.go:158:  168:   cluster_size  = �[4mvar.num_clients�[0m
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-18T13:35:43Z command.go:158: �[0m
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-18T13:35:43Z command.go:158: An input variable with the name "num_clients" has not been declared. This
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-18T13:35:43Z command.go:158: variable can be declared with a variable "num_clients" {} block.
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-18T13:35:43Z command.go:158: �[0m�[0m
TestNomadConsulClusterSeparateAmazonLinuxAmi 2019-07-18T13:35:43Z retry.go:80: Returning due to fatal error: FatalError{Underlying: exit status 1}
--

@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants