hashicorp / terraform-provider-kubernetes

Terraform Kubernetes provider
https://www.terraform.io/docs/providers/kubernetes/
Mozilla Public License 2.0
1.56k stars 963 forks source link

kubernetes_manifest flag to skip validation during plan #2509

Open DanielHaba opened 1 month ago

DanielHaba commented 1 month ago

Description

The common walkaround for missing CRDs is to use other providers like kubectl_manifest or helm_release. The deferred flag on kubernetes_manifest will be more elegant solution, with the same downsides.

Acceptance tests

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'

...

Release Note

Release note for CHANGELOG:

...

References

Community Note

hashicorp-cla-app[bot] commented 1 month ago

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


Daniel Haba seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

alexsomesan commented 1 month ago

Hi Daniel,

I hate to be a spoiler here, but this approach is not going to work. The kubernetes_manifest resource doesn't just do validation during the plan, it actually retrieves the schema for the resource from the OpenAPI definition available on the cluster API. Even if you could get away with what this PR proposes, there still is a need for schema information. There is no way to work around that, as Terraform requires a uniform and consistent resource structure throughout the lifecycle of the resource.

Just wanted to let you know that we can't merge this kind of change. I do agree the internals of the kubernetes_manifest should be better documented from a developer POV in order to avoid wasting effort like this.