Skip to content

flux build kustomization fails on Windows #5673

@alexanderlinne

Description

@alexanderlinne

Describe the bug

flux build kustomization fails on Windows when using a --path other than .. On Linux, all invocations with ., a relative path or an absolute path for --path succeed and correctly render the manifests.

Steps to reproduce

  1. Create a local folder test with a kustomization.yaml
    kind: Kustomization
    
    resources:
    - test.yaml
    
  2. Create test.yaml in the test folder with some test manifest like:
    kind: Pod
    metadata:
      name: test-pod
      namespace: default
    spec:
      containers:
      - name: test-container
        image: nginx:latest
    
  3. Create a test.yaml with:
    kind: Kustomization
    metadata:
      name: test
      namespace: default
    
  4. cd into the test folder on Windows and run flux build kustomization test --namespace default --kustomization-file ..\test.yaml --path . --dry-run
  5. The commands succeeds and prints the pod manifest
  6. cd .. and then flux build kustomization test --namespace default --kustomization-file .\test.yaml --path .\test\ --dry-run
  7. Observe the error ✗ failed to generate kustomization.yaml: failed to save original kustomization.yaml: open test\test\kustomization.yaml.original: The system cannot find the path specified. <nil> <nil>
  8. Run flux build kustomization test --namespace default --kustomization-file C:\<absolute-path>\test.yaml --path C:\<absolute-path>\test\ --dry-run
  9. Observe the error ✗ failed to generate kustomization.yaml: failed to save original kustomization.yaml: open C:\<absolute-path>\test\C:\<absolute-path>\test\kustomization.yaml.original: The filename, directory name, or volume label syntax is incorrect. <nil> <nil>

Expected behavior

All invocations with ., a relative path or an absolute path return the rendered manifest

Screenshots and recordings

No response

OS / Distro

Windows 11

Flux version

v2.7.5

Flux check

N/A

Git provider

No response

Container Registry provider

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions