- Notifications
You must be signed in to change notification settings - Fork22
feat: allowvalidation
to be used withoption
s#202
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Yes, the initial implementation just assumed so. I'm sure the constraint can be relaxed now. |
} | ||
} | ||
``` | ||
2. Run `terraform init` and observe a warning like `Warning: Provider development overrides are in effect` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Nice trick!
provider/parameter_test.go Outdated
Config: ` | ||
data "coder_parameter" "region" { | ||
name = "Region" | ||
type = "number" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
nit: formatting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Oh weird, my editor is probably handling tabs in a strange way. Thanks 👍
provider/parameter_test.go Outdated
} | ||
validation { | ||
monotonic = "increasing" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
nit: indent
@@ -424,6 +440,54 @@ data "coder_parameter" "region" { | |||
require.Equal(t, expected, state.Primary.Attributes[key]) | |||
} | |||
}, | |||
}, { | |||
Name: "NumberValidation_MonotonicWithOptions", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I used to drop an examplehere as well.
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Great!
Addressescoder/coder#11579, PR in coder/coder will close
Currently we have a conflict declared between
option
andvalidation
configs incoder_parameter
Terraform resources (@mtojek do you have some historical context as to why that was the case?).This PR removes that conflict since there is nothing inherent in the codebase disallowing them, and we need to allow both to to accommodate the use-case mentioned in the linked issue.
I expanded the tests and added documentation for testing the provider locally.