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

Compilation fails with compose-node-name option #1018

Closed
roman8422 opened this issue Jul 21, 2023 · 1 comment · Fixed by #1020
Closed

Compilation fails with compose-node-name option #1018

roman8422 opened this issue Jul 21, 2023 · 1 comment · Fixed by #1020
Assignees

Comments

@roman8422
Copy link
Contributor

I'm trying to use compose-node-name option introduced here #933 and compile is failing.

To Reproduce
I used inventory from examples/terraform directory in this repo

  1. cd into terraform example dir
    cd kapitan/examples/terraform
  2. Update reclass-config
    sed -i '' 's/compose_node_name: false/compose_node_name: true/' inventory/reclass-config.yml
  3. run kapitan compile (I used docker)
docker run -t --rm -u $(id -u) -v $(pwd):/src:delegated kapicorp/kapitan:v0.32.0 compile

Target "project1" is missing the corresponding yml file in /src/inventory/targets
Target name should match the name of the target yml file in inventory

Expected behavior
Compilation is finished without errors.

Not sure if this is a bug or some additional inventory changes are needed. Any help is appreciated.

@MatteoVoges
Copy link
Contributor

Hey @roman8422 ,
I see two potential errors from here.

  1. You have to pass the --compose-node-name as an compile argument to enable the compose-node-name behavior in kapitan as well.
  2. I looked into the examples/terraform/classes/type.yml file and noticed that the kapitan.vars.target is hardcoded, so reclass has no possibility to modify the targetname. This is actually bad style, so I'm gonna fix it in a PR. With setting that value to ${_reclass_:name:full} the correct (composed) target name gets passed into kapitan.

I hope that this helps you. Let me know if you have some more questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants