kbst / terraform-provider-kustomization

Terraform provider for Kustomize
https://www.kubestack.com
Apache License 2.0
270 stars 53 forks source link

failed: json: unknown field "components" #248

Closed minherz closed 6 months ago

minherz commented 10 months ago

Description

When trying to use the component with the kustomization.yaml file that uses components I get the following error message:

Error: kustomizationBuild: Kustomizer Run for path '/home/user/workdir/provisioning/kustomize/test' failed: json: unknown field "components"
│ 
│   with data.kustomization.test,
│   on test.tf line 58, in data "kustomization" "test":
│   58: data "kustomization" "test" {

The folder /home/user/workdir/provisioning/kustomize has only one file: kustomization.yaml that looks like the following:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- github.com/GoogleCloudPlatform/microservices-demo/kustomize/base?version=v0.8.1
components:
- github.com/GoogleCloudPlatform/microservices-demo/kustomize/components/google-cloud-operations?version=v0.8.1

The file test.tf looks like the following:

data "kustomization" "test" {
  provider = kustomization

  path = var.filepath_manifest
}

resource "kustomization_resource" "test" {
  provider = kustomization

  for_each = data.kustomization.test.ids
  manifest = data.kustomization.test.manifests[each.value]
}

where the filepath_manifst input variable has the value /home/user/workdir/provisioning/kustomize.

System Info

Terraform version: Terraform v1.5.7 on linux_amd64 Provider version: 0.2.0-beta.3

pst commented 6 months ago

Provider version: 0.2.0-beta.3

Maybe do not use a many years old beta version? https://registry.terraform.io/providers/kbst/kustomization/latest

minherz commented 6 months ago

Provider version: 0.2.0-beta.3

Maybe do not use a many years old beta version? https://registry.terraform.io/providers/kbst/kustomization/latest

I assume that in this rude manner you was trying to hint that the latest version does not have this problem. Thank you for letting know. It can be more useful to avoid sarcastic statements and just provide emotionless instructions.

pst commented 6 months ago

I make something useful available to you for free. Since there are thousands of users and only a single maintainer, the only sustainable way forward is if users make an effort before opening issues. And you clearly did not make any since you couldn't even be arsed to check the releases page. It's that simple.

minherz commented 6 months ago

There are 19 contributors in this project. Be humble -- it helps to karma.