Panfactum / stack

The Panfactum Stack
https://panfactum.com
Other
9 stars 4 forks source link

[Bug]: kube_bastion module fails to apply #27

Closed jlevydev closed 3 weeks ago

jlevydev commented 3 weeks ago

Prior Search

What happened?

The kube_bastion module fails to apply with the error below. All other modules are running the latest greatest and I believe I am on the latest greatest flake as well. Let me know what other debugging information might be helpful! image

Version

main (development branch)

What primary components of the stack are you seeing the problem on?

terraform

Relevant log output

No response

Code of Conduct

fullykubed commented 3 weeks ago

Resolved in the latest commit.

fullykubed commented 3 weeks ago

Still occurring.

fullykubed commented 3 weeks ago

So this one was a little complex.

Essentially what kubernetes_manifest does is run the equivalent of kubectl apply under the hood. Unfortunately, this is an upsert operation for certain fields and in this case it won't delete already-present template annotations. However, the tf plan thinks that it will, and thus tf becomes confused when the returned manifest does not have annotations deleted.

This is the same behavior that occurs with the primary metadata.annotations for the kubernetes_manifest resource, and my workaround was to mark them as computed fields. I simply extended this pattern to the template annotations.

This resolves the issue because tf will no longer care if the returned field values differ from what was planned.