Conversation
@@ -31,6 +31,7 @@ func GetResourceType(name string) (tftypes.Type, error) { | |||
func GetProviderResourceSchema() map[string]*tfprotov5.Schema { | |||
waitForType := tftypes.Object{ | |||
AttributeTypes: map[string]tftypes.Type{ | |||
"timeout": tftypes.String, |
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.
We need to make this optional, but we're currently blocked because of this: hashicorp/terraform-plugin-go#83 (comment)
&tfprotov5.Diagnostic{ | ||
Severity: tfprotov5.DiagnosticSeverityError, | ||
Detail: err.Error(), | ||
Summary: fmt.Sprintf(`wait_for: timed out waiting on resource %q`, rnn), |
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 wonder if there's some validation that can happen sooner, to prevent this error:
╷
│ Error: wait_for: timed out waiting on resource "default/tf-k8s-test-consul-server"
│ invalid field path "metadata.0.annotations.0.test": :1,10-11: Attribute name required; Dot must be followed by attribute
│ name.
╵
I used this as my config and it exited immediately:
wait_for = {
timeout = "30s"
fields = {
"metadata.0.annotations.0.test" = "true"
}
}
Also, is it possible for me to use an annotation to test this feature?
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.
Hmm, it looks like you need to use []
for indexes. We've documented it in the format you're using though so something must have changed.
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.
But yes – I'll add something to the ValidateResourceTypeConfig func to check for this.
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.
Have added validation so you get an error like this at plan:
╷
│ Error: Invalid "wait_for" configuration
│
│ with kubernetes_manifest.test,
│ on main.tf line 44, in resource "kubernetes_manifest" "test":
│ 44: wait_for = {
│ 45: fields = {
│ 46: "()*^B)*B^()^B)&*#^&$^#*&$TN&*#" = "lol"
│ 47: }
│ 48: }
│
│ invalid field path "()*^B)*B^()^B)&*#^&$^#*&$TN&*#": :1,4-5: Unsupported operator; Bitwise operators are not supported., and
│ 4 other diagnostic(s)
╵
Moved here: hashicorp/terraform-provider-kubernetes#1353 |
Description
Adds a configurable timeout to the wait_for block.
Release Note
Release note for CHANGELOG:
References
Community Note