We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Some charts include multiple crd resources in one file. eg: https://raw.githubusercontent.com/Kong/charts/kong-2.13.1/charts/kong/crds/custom-resource-definitions.yaml
This seems to be not possible with your module. What I did as a workaround:
variable "crds_urls" { type = list(object({ count = string url = string })) description = <<-EOF List of the URLs including the count of the crds per file (due to terraform limitation) EOF } variable "server_side_apply" { type = bool default = false description = "Optional. Allow using server-side-apply method. Default false." } data "http" "yaml_file" { for_each = toset(var.crds_urls[*].url) url = each.value lifecycle { postcondition { condition = contains([200, 201, 204], self.status_code) error_message = "Status code invalid" } } } data "kubectl_file_documents" "crds" { for_each = toset(var.crds_urls[*].url) content = data.http.yaml_file[each.value].response_body } locals { crds = flatten([ for crd_url in var.crds_urls : data.kubectl_file_documents.crds[crd_url.url].documents ]) crd_count = sum(var.crds_urls[*].count) } resource "kubectl_manifest" "crd" { count = local.crd_count # depends_on = [null_resource.status_check] yaml_body = local.crds[count.index] server_side_apply = var.server_side_apply }
But this needs the count to be known before the apply so it's not perfect. Any idea how to implement this?
The text was updated successfully, but these errors were encountered:
Hi Abdul, thanks for your patience on this.
Nothing simple comes to my mind, but it could be indeed an interesting feature. If somebody has any idea, please share it 😄
If I find a simple solution, I'll implement it.
Sorry, something went wrong.
Ran into this issue while using the module to install cert-manager crds. Threw for a bit of a loop.
No branches or pull requests
Some charts include multiple crd resources in one file.
eg: https://raw.githubusercontent.com/Kong/charts/kong-2.13.1/charts/kong/crds/custom-resource-definitions.yaml
This seems to be not possible with your module.
What I did as a workaround:
But this needs the count to be known before the apply so it's not perfect.
Any idea how to implement this?
The text was updated successfully, but these errors were encountered: