Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

No valid OpenAPI definition warning #243

Open
Vrtak-CZ opened this issue Jun 23, 2021 · 1 comment
Open

No valid OpenAPI definition warning #243

Vrtak-CZ opened this issue Jun 23, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@Vrtak-CZ
Copy link

Vrtak-CZ commented Jun 23, 2021

I'm creating this issue because the original issue was solved and closed. But current version still reporting there is no OpenAPI definition even when the schema is defined.

Terraform, Provider, Kubernetes versions

Terraform version: 1.0.0
Provider version: 0.5.0
Kubernetes version: 1.20.x

Affected Resource(s)

  • kubernetes_manifest

Terraform Configuration Files

resource "kubernetes_manifest" "app_admin_ssm_envs" {
  manifest = {
    apiVersion = "kubernetes-client.io/v1"
    kind       = "ExternalSecret"

    metadata = {
      name      = "admin-ssm-envs"
      namespace = var.environment
    }

    spec = {
      backendType = "systemManager"
      region      = var.aws_region

      data = [
        {
          key  = aws_ssm_parameter.apps_admin_sentry_dsn.name
          name = "SENTRY_DSN"
        }
      ]
    }
  }
}

Steps to Reproduce

  1. terraform apply

Expected Behavior

There should be no warning.

Actual Behavior

╷
│ Warning: This custom resource does not have an associated OpenAPI schema.
│ 
│   with kubernetes_manifest.app_admin_ssm_envs,
│   on apps_admin.tf line 71, in resource "kubernetes_manifest" "app_admin_ssm_envs":
│   71: resource "kubernetes_manifest" "app_admin_ssm_envs" {
│ 
│ We could not find an OpenAPI schema for this custom resource. Updates to
│ this resource will cause a forced replacement.
│ 
│ (and 7 more similar warnings elsewhere)
╵

Important Factoids

This CRD has OpenAPI definition

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@Vrtak-CZ Vrtak-CZ added the bug Something isn't working label Jun 23, 2021
@dracut5
Copy link

dracut5 commented Jul 5, 2021

I have faced with the same issue: terraform shows this warning, but the resource is able to be created.
The more actual problem is I cannot update this resource or even run terraform plan after creation without errors:

terraform plan
Acquiring state lock. This may take a few moments...
kubernetes_manifest.elasticsearch: Refreshing state...
╷
│ Warning: This custom resource does not have an associated OpenAPI schema.
│ 
│   with kubernetes_manifest.elasticsearch,
│   on main.tf line 1, in resource "kubernetes_manifest" "elasticsearch":
│    1: resource "kubernetes_manifest" "elasticsearch" {
│ 
│ We could not find an OpenAPI schema for this custom resource. Updates to this resource will cause a forced replacement.
╵
╷
│ Error: Dry-run failed for non-structured resource
│ 
│   with kubernetes_manifest.elasticsearch,
│   on main.tf line 1, in resource "kubernetes_manifest" "elasticsearch":
│    1: resource "kubernetes_manifest" "elasticsearch" {
│ 
│ A dry-run apply was performed for this resource but was unsuccessful: Apply failed with 1 conflict: conflict with "elastic-operator" using elasticsearch.k8s.elastic.co/v1: .spec.nodeSets
╵

Terraform, Provider, Kubernetes versions

Terraform version: 1.0.0
Provider version: 0.5.0
Kubernetes(EKS) version: 1.20.x

Terraform resource

resource "kubernetes_manifest" "elasticsearch" {
  provider = kubernetes-alpha
  manifest = {
    "apiVersion" = "elasticsearch.k8s.elastic.co/v1"
    "kind"       = "Elasticsearch"
    "metadata" = {
      "name" = "es-test"
      "namespace" = data.terraform_remote_state.operator.outputs.namespace
    }
    "spec" = {
      "nodeSets" = [
        {
          "config" = {
            "node.store.allow_mmap" = false
          }
          "count" = 3
          "name"  = "default"
        },
      ]
      "version" = "7.13.2"
    }
  }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants