-
Notifications
You must be signed in to change notification settings - Fork 22
feat: allow validation
to be used with option
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Danny Kopping <[email protected]>
Signed-off-by: Danny Kopping <[email protected]>
Signed-off-by: Danny Kopping <[email protected]>
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 example here as well.
Signed-off-by: Danny Kopping <[email protected]>
Signed-off-by: Danny Kopping <[email protected]>
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!
Addresses coder/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.