Open xfirestyle2k opened 2 months ago
│ .object.spec.version: was cty.StringVal("15.7"), but now cty.StringVal("15.7+vmware.v2.1.0-rc.40").
Hi @xfirestyle2k you'll want to refer to our docs regarding computed_fields. This would solve your inconsistent result since the value comes from server side. https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/manifest#computed-fields
Apply this and let us know if this solved your issue. We can close this afterwards.
I try to deploy a Postgres DB via Data Services Manager, it actually does work and the DB will be deployed, however, because of the error I receive, I think Terraform doesn't recognise it correctly and want to delete and recreate the DB after re-appling the terraform script
│ Error: Provider produced inconsistent result after apply │ │ When applying changes to kubernetes_manifest.terra-pg-cluster, provider "provider[\"registry.terraform.io/hashicorp/kubernetes\"]" produced an unexpected new value: │ .object.spec.version: was cty.StringVal("15.7"), but now cty.StringVal("15.7+vmware.v2.1.0-rc.40"). │ │ This is a bug in the provider, which should be reported in the provider's own issue tracker.
Terraform Version, Provider Version and Kubernetes Version
➜ ~ terraform -v Terraform v1.9.2 on darwin_arm64 Kubernetes provider version: kubernetes v2.31.0
Affected Resource(s)
Terraform Configuration Files
terraform apply
--> Terraform will perform the following actions:kubernetes_manifest.terra-pg-cluster will be created
resource "kubernetes_manifest" "terra-pg-cluster" {
manifest = {
object = {
timeouts {
wait {
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions? Terraform will perform the actions described above. Only 'yes' will be accepted to approve.
Enter a value: yes kubernetes_manifest.terra-pg-cluster: Creating... kubernetes_manifest.terra-pg-cluster: Still creating... [10s elapsed] kubernetes_manifest.terra-pg-cluster: Still creating... [20s elapsed] kubernetes_manifest.terra-pg-cluster: Still creating... [30s elapsed] kubernetes_manifest.terra-pg-cluster: Still creating... [40s elapsed] kubernetes_manifest.terra-pg-cluster: Still creating... [50s elapsed] kubernetes_manifest.terra-pg-cluster: Still creating... [1m0s elapsed]
Expected Behavior
What should have happened?
The Postgres Database will be deployed successfully, however I think based on the error Terraform expect the DB as fault and by re-apply the terraform script it wants to destroy the deployed DB and recreate.
Actual Behavior
➜ DSM_User terraform apply kubernetes_manifest.terra-pg-cluster: Refreshing state...
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: -/+ destroy and then create replacement
Terraform will perform the following actions:
kubernetes_manifest.terra-pg-cluster is tainted, so must be replaced
-/+ resource "kubernetes_manifest" "terra-pg-cluster" { ~ object = { ~ metadata = { ~ annotations = {
(1 unchanged attribute hidden)
~ spec = { ~ adminPasswordRef = {
secretName = (known after apply) } ~ version = "15.7+vmware.v2.1.0-rc.40" -> "15.7"
(7 unchanged attributes hidden)
}
Plan: 1 to add, 0 to change, 1 to destroy.
Do you want to perform these actions? Terraform will perform the actions described above. Only 'yes' will be accepted to approve.
Enter a value: yes
Community Note