-
Notifications
You must be signed in to change notification settings - Fork 63
produced an unexpected new value: .object: wrong final value type: attribute "apiVersion": string required. #110
Comments
I have exact same problem with a Steps to reproduce:
apiVersion: v1
kind: Service
metadata:
name: dummy-test
namespace: ${NAMESPACE}
spec:
type: ClusterIP
selector:
name: app
ports:
- protocol: TCP
port: 80
targetPort: 8080
terraform {
required_version = ">= 0.13"
required_providers {
kubernetes-alpha = {
source = "hashicorp/kubernetes-alpha"
}
}
}
provider "kubernetes-alpha" {
config_path = "~/.kube/config"
}
resource "kubernetes_manifest" "dummy_test" {
provider = kubernetes-alpha
manifest = yamldecode(templatefile("service.yaml", {
NAMESPACE = "default",
}))
} Error output:
|
Hi all, Unfortunately this is a known issue specific to ClusterIP type services. The problem is the extra "clusterIP" attribute returned by the API server where the value of the IP is set. This will be resolved when the local planning mode is completed, which is type-complete to the Kubernetes API spec and all attributes will be accounted for at plan time. It's being worked on here: #41 In the mean time, the workaround is to set the value for "clusterIP" in the TF manifest, like this:
|
Thank you @alexsomesan for the explanation. |
I just resorted to temporarily using the main kubernetes provider for services. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Terraform Version and Provider Version
2020/09/05 09:02:52 [INFO] Terraform version: 0.13.0
2020/09/05 09:02:52 [INFO] Go runtime version: go1.14.2
2020/09/05 09:02:52 [INFO] CLI args: []string{"//bin/terraform", "-v"}
2020/09/05 09:02:52 [DEBUG] Attempting to open CLI config file: //.terraformrc
2020/09/05 09:02:52 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/09/05 09:02:52 [DEBUG] checking for credentials in "//.terraform.d/plugins"
2020/09/05 09:02:52 [DEBUG] checking for credentials in "//.terraform.d/plugins/darwin_amd64"
2020/09/05 09:02:52 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2020/09/05 09:02:52 [DEBUG] will search for provider plugins in //.terraform.d/plugins
2020/09/05 09:02:52 [DEBUG] ignoring non-existing provider search directory //Library/Application Support/io.terraform/plugins
2020/09/05 09:02:52 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2020/09/05 09:02:52 [INFO] CLI command args: []string{"version", "-v"}
Your version of Terraform is out of date! The latest version
is 0.13.2. You can update by downloading from https://www.terraform.io/downloads.html
Terraform v0.13.0
Kubernetes Version
kubectl version
Client Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.6-beta.0", GitCommit:"e7f962ba86f4ce7033828210ca3556393c377bcc", GitTreeState:"clean", BuildDate:"2020-01-15T08:26:26Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"15+", GitVersion:"v1.15.12-gke.2", GitCommit:"fb7add51f767aae42655d39972210dc1c5dbd4b3", GitTreeState:"clean", BuildDate:"2020-06-01T22:20:10Z", GoVersion:"go1.12.17b4", Compiler:"gc", Platform:"linux/amd64"}
Server Version
1.17.9-gke.1503
Affected Resource(s)
Terraform Configuration Files
Debug Output
Error: Provider produced inconsistent result after apply
When applying changes to
module.app.kubernetes_manifest.service_rabbitmq_instance_rabbitmq_svc,
provider "registry.terraform.io/hashicorp/kubernetes-alpha" produced an
unexpected new value: .object: wrong final value type: attribute "apiVersion":
string required.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.
2020-09-05T08:56:57.662-0700 [DEBUG] plugin: plugin process exited: path=.terraform/plugins/registry.terraform.io/hashicorp/kubernetes-alpha/0.2.0/darwin_amd64/terraform-provider
-kubernetes-alpha_v0.2.0_x5 pid=80172
2020-09-05T08:56:57.662-0700 [DEBUG] plugin: plugin exited
The text was updated successfully, but these errors were encountered: