You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got when defining medium HugePages-2Mi: │ Error: "spec.0.template.0.spec.0.volume.2.empty_dir.0.medium" must contain a value from []string{"", "Memory"}, got "HugePages-2Mi"
Hi @trunet, The reason this is throwing an error is because implementing validateAttributeValueIsInAndContain in this way may be too imprecise as values that should match exactly might match as sub-strings and vice versa. Ideally the ValidateFunc should take two lists as arguments: one for exact matches and one for prefix (not sub-string) matches. For prefixes, it's good to ensure that they actually use prefix matches instead of strings.
As defined here:
terraform-provider-kubernetes/kubernetes/schema_pod_spec.go
Line 676 in 32a58d2
I got when defining medium HugePages-2Mi:
│ Error: "spec.0.template.0.spec.0.volume.2.empty_dir.0.medium" must contain a value from []string{"", "Memory"}, got "HugePages-2Mi"
This is allowed as showed here: https://kubernetes.io/docs/tasks/manage-hugepages/scheduling-hugepages/
Terraform Version, Provider Version and Kubernetes Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Steps to Reproduce
terraform apply
Expected Behavior
It should create /dev/hugepages
Actual Behavior
It fails to apply
Important Factoids
References
Community Note
The text was updated successfully, but these errors were encountered: