Skip to content
New issue

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

Linter running before template vars are applied #2908

Closed
lennard-pfennig-bruker opened this issue Aug 20, 2024 · 2 comments · Fixed by #2911
Closed

Linter running before template vars are applied #2908

lennard-pfennig-bruker opened this issue Aug 20, 2024 · 2 comments · Fixed by #2911
Labels
bug 🐞 Something isn't working

Comments

@lennard-pfennig-bruker
Copy link

Environment

Device and OS: macOS 14.5 & ubuntu 22
App version: 0.38.2
Kubernetes distro being used: k3s

Steps to reproduce

  1. create zarf.yaml:
kind: ZarfPackageConfig
metadata:
  name: "###ZARF_PKG_TMPL_PACKAGE_NAME###"
components:
  - name: files
    files:
      - source: ./zarf.yaml
        target: zarf.yaml
  1. run zarf package create --confirm --set PACKAGE_NAME="beer"

Expected result

> zarf package create --confirm --set PACKAGE_NAME="beer"   
...
✔  Package saved to "zarf-package-beer-arm64.tar.zst" 

Actual Result

> zarf package create --confirm --set PACKAGE_NAME="beer"                                                                                                                                   Tue Aug 20 14:43:29 2024

 NOTE  Saving log file to
       /var/folders/bx/hywhy9714_g5st9x3lgd3zjh0000gn/T/zarf-2024-08-20-14-44-43-3045695344.log

 NOTE  Using build directory .

 NOTE  Linting package "beer" at .

     Type  | Path           | Message
     Error | .metadata.name | Does not match pattern '^[a-z0-9][a-z0-9\-]*$'

     ERROR:  failed to create package: found errors in schema

Additional Context

the files component is just so the package builds

@lennard-pfennig-bruker
Copy link
Author

lennard-pfennig-bruker commented Aug 20, 2024

proposed solution #2909

@AustinAbro321
Copy link
Contributor

Hello thank you for making this issue, this is an important bug to solve, and I appreciate you making a PR. I created a different PR, #2911, to solve this as the schema is auto generated using go tags on the struct + make docs and schema. We could have edited those tags, but there are a fair amount of regex tags and I thought templating before checking the schema would be simpler.

@salaxander salaxander added this to the v0.39.0 milestone Aug 20, 2024
@salaxander salaxander added this to Zarf Aug 20, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Zarf Aug 20, 2024
@salaxander salaxander moved this from Backlog to In progress in Zarf Aug 20, 2024
@salaxander salaxander moved this from In progress to In review in Zarf Aug 20, 2024
@salaxander salaxander removed this from the v0.39.0 milestone Aug 22, 2024
@github-project-automation github-project-automation bot moved this from In review to Done in Zarf Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
Status: Done
3 participants