NetApp / trident

Storage orchestrator for containers
Apache License 2.0
761 stars 223 forks source link

Restore Kustomize support - rename kustomization_post_1_25.yaml #831

Open mac-chaffee opened 1 year ago

mac-chaffee commented 1 year ago

Describe the bug I install Trident using Kustomize by creating a kustomization.yaml file like this:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- github.com/NetApp/trident/deploy?ref=v22.10.0
- snapshot-class.yaml
- trident-storage-classes.yaml
- trident-orchestrator.yaml

This works since Kustomize supports fetching the root kustomization.yaml file from a git repo at a specific path and ref. However, the file MUST be named "kustomization.yaml" (or similar) or else I get this error:

error: accumulating resources: accumulation err='accumulating resources from '../base': '/Users/mac/code/helm/trident/base' must resolve to a file': recursed accumulation of path '/Users/mac/code/helm/trident/base': accumulating resources: accumulation err='accumulating resources from 'https://github.com/NetApp/trident/deploy?ref=v23.04.0': URL is a git repository': couldn't make target for path '/private/var/folders/qm/l_8rstwn383gwzx2lttl7ll00000gp/T/kustomize-207885862/deploy': unable to find one of 'kustomization.yaml', 'kustomization.yml' or 'Kustomization' in directory '/private/var/folders/qm/l_8rstwn383gwzx2lttl7ll00000gp/T/kustomize-207885862/deploy'

This is because after v23, the kustomization.yaml file was split into kustomization_post_1_25.yaml and kustomization_pre_1_25.yaml, so kustomize doesn't recognize it anymore.

Environment

Expected behavior

If I fork this repo and rename "kustomization_post_1_25.yaml" back to kustomization.yaml, then it works: kustomize recognizes the file, pulls in all the manifests from this repo, and overlays my local changes.