cluster.dev icon indicating copy to clipboard operation
cluster.dev copied to clipboard

The kubernetes unit does not find the source file if it is above the current directory

Open kinseii opened this issue 1 year ago • 2 comments

Problem: The kubernetes unit does not find the source file if it is above the current directory (with relative path ../):

---
kind: StackTemplate
name: service
units:
  - name: test-configmap
    type: kubernetes
    provider_conf:
      config_context: {{ .variables.cluster_name }}
    source: ../../_templates/test-configmap/test-configmap.yaml

Error output:

19:25:12 [FATAL] Fatal error: load project configuration: read units: stack 'qwerty-aks-us-1', reading units: reading kubernetes unit 'qwerty-aks-us-1.test-configmap': reading kubernetes manifests form source '../../_templates/test-configmap/test-configmap.yaml': stat ../../_templates/test-configmap/test-configmap.yaml: no such file or directory
Unit data:
name: test-configmap
provider_conf:
    config_context: qwerty-aks-us-1
source: ../../_templates/test-configmap/test-configmap.yaml
type: kubernetes

If you don't use exit above the current directory, everything works. Example:

kind: StackTemplate
name: service
units:
  - name: test-configmap
    type: kubernetes
    provider_conf:
      config_context: {{ .variables.cluster_name }}
    source: ./test-configmap/test-configmap.yaml

Cluster.dev Version: cdev version v0.9.5

kinseii avatar Aug 02 '24 02:08 kinseii

Successfully works from the current directory with ./, thus: source: ./../../_templates/test-configmap/test-configmap.yaml. But it may be worthwhile to provide for operation without specifying ./.

kinseii avatar Aug 09 '24 08:08 kinseii

Bug. Thanks for report.

romanprog avatar Aug 19 '24 11:08 romanprog

Should work correct in https://github.com/shalb/cluster.dev/releases/tag/v0.9.6 Check pls

romanprog avatar Sep 11 '24 09:09 romanprog

Worked, thanx!

kinseii avatar Sep 11 '24 21:09 kinseii