-
Notifications
You must be signed in to change notification settings - Fork 56
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 unexpected end of JSON input
during planning
#221
fix unexpected end of JSON input
during planning
#221
Conversation
3ca524d
to
84a1c22
Compare
I've tried refactoring to see if there would be any code left after IF-ing everything depending on new value, but there wasn't anything left except loading old manifest, so it's mostly just improved error message and returning early without errors. can I get a review @pst ? |
// dm will always be empty if it's known after apply | ||
if tm == "" { | ||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will have to look into this to fully understand it before I can merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can quite easily replicate the issue by creating something like:
resource "random_id"
data "kustomization_overlay" "prerender"
data "kustomization_overlay" "source"
- make this depend on therandom_id
resource "kustomization_resource"
depending on ids fromprerender
and manifests fromsource
kustomize/resource_kustomization.go
Outdated
if err != nil { | ||
return logError(err) | ||
return logError(fmt.Errorf("failed to parse new manifest: %s [body=%#v]", err, tm)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can not print the manifest to the log. The resource may be a secret, and now you printed that to the CI/CD log. Please remove this part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, I'll stick to the length of the body so there is at least some indicator of issues
84a1c22
to
9e2d87e
Compare
I've noticed the same error happens during update after I delete last-applied config from a resource |
What's the status on this issue? I can see it's being worked, more so trying to get an idea if we need to actually do something or wait for an imminent fix. |
github.com/kbst/terraform-provider-kustomize/kustomize.kustomizationResourceDiff: github.com/kbst/terraform-provider-kustomize/kustomize.(*kManifest).load: json error: unexpected end of JSON input
…pplied-configuration` is missing
c5c4f90
to
ab4126a
Compare
I finally found the time to look into this, and I unfortunately have to tell you that I have decided to not merge this. I don't see any real world situation where this is an issue, your prerender "hack" to work around the If there are valid uses where the provider crashes because of such an issue |
github.com/kbst/terraform-provider-kustomize/kustomize.kustomizationResourceDiff: github.com/kbst/terraform-provider-kustomize/kustomize.(*kManifest).load: json error: unexpected end of JSON input
not sure if it's the right way to go, but my workday is now over and i still want to share the findings
fixes #219