Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent inconsistent planning #198

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zenobios
Copy link

@zenobios zenobios commented Aug 9, 2022

This PR fixes the issue reported in #162 by resetting yaml_body_parsed and yaml_incluster in case yaml_body has been changed.

@barryib
Copy link

barryib commented Sep 29, 2022

@gavinbunney hope you're doing well. Any chance to review this PR please ?

@nestor-lobo-work
Copy link

@gavinbunney I see this change from @zenobios is still pending from some time ago

Would that be possible to be reviewed in the short term?
I am suffering exact same issue and believe it could be solved with this change in place

Thanks in advance

@AmitKatyal-Sophos
Copy link

@gavinbunney blocked on this issue.
Can we please review it ?
Thanks!

@AmitKatyal-Sophos
Copy link

@zenobios the actual issue is in the terraform ? Why NewValueKnown for the "yaml_body" key is returning false ?
It should have returned true right ?. If any change in the yaml body is not working, then very basic use-case of update of the manifest is not working. Am I missing something here ?

@AmitKatyal-Sophos
Copy link

@nestor-lobo-work creating the resource using the templatefile seems to be working fine.

resource "kubectl_manifest" "argocd_apps" {
for_each = XXXXX
yaml_body = templatefile("${path.module}/manifests/apps.yaml", {
})
wait = "true"
}

@marksumm marksumm mentioned this pull request Jan 18, 2023
@tamirsagi
Copy link

tamirsagi commented Feb 21, 2023

I built it locally including that fix, however it still failed due to inconsistent plan.

@Adphi
Copy link

Adphi commented Sep 19, 2023

Thanks @zenobios for you work on this. It seems to work for me when template variables are updated from other resources.
I've forwarded the pull request here alekc/terraform-provider-kubectl#46

@alekc
Copy link
Contributor

alekc commented Sep 20, 2023

Released in "2.0.3-rc2". Please test if that version covered your usecases.

terraform {
  required_providers {
    kubectl = {
      source = "alekc/kubectl"
      version = "2.0.3-rc2"
    }
  }
}

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants