-
Notifications
You must be signed in to change notification settings - Fork 107
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
only the first manifest is applied #271
Comments
@simonebenati You need to load the file with I haven't tested this, however, I'm assuming this will work for you: # pass the content to kubectl_file_documents. https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/kubectl_file_documents
data "kubectl_file_documents" "helm-template-manifest" {
content = data.helm_template.argocd_template.manifest
}
# Use kubectl_file_documents to split multi-document into the kubectl_manifest resource
resource "kubectl_manifest" "apply_argocd" {
for_each = data.kubectl_file_documents.helm-template-manifest.manifests
yaml_body = each.value
} |
FYI work-around i did is to divide yaml to multiple manifests with each one having only 1 after |
@DrkCloudStrife Hi, I haven't tested your solution yet because I've been working on different things but I'll ask a colleague to try it out. @janibashamd I don't think this can be a solution for very long manifests of operators and such to divide everything into smaller manifests it's a super tedious manual job.. |
I haven't had any luck with the method of using a for_each or count on a kubectl data resource. Terraform complains that it doesn't know the length beforehand and it would need to be applied by targeting it. I got it working with this method:
|
I am aware that this has been answered already here:
kubectl/issues/52
But I tried to set up the solution it was provided but it doesn't work for me.
At the moment I have the argocd template file downloaded with helm, I then am using
Like in the issue #52 it only applies the first manifest. How can I apply everything skipping the ignoring the "---" ?
The text was updated successfully, but these errors were encountered: