-
Notifications
You must be signed in to change notification settings - Fork 267
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
Environment substitution replaces env vars in the topology file that are not set #2160
Comments
Hi @lostdave The way it works with junos is an disk with the startup-config is mounted to the VM, and junos should read the config from it https://github.com/hellt/vrnetlab/blob/master/vjunosswitch/docker/make-config.sh I suppose you should check the contents of that disk to verify that the encrypted string is there as it was in the yaml file |
buuuut, I think what could have happened is that containerlab tried to expand variables :D Would you mind to try using the startup-config with a file, and not as embedded multiline string to confirm this theory? |
Sorry ....slow to get back to this one..travel and training stuff.... |
Yes, the issue stems from the fact that the https://github.com/a8m/envsubst package that we use to replace env vards in the topology file replaces the env vars that are not set or empty. This leads to Unfortunately, the original package maintainer stopped maintaining the package and this particular feature request left dangling - a8m/envsubst#56 I made a fork of a fork by @dnitsch that added some parts of this functionality, but it doesn't work when the env var is set with the default in the template. To demonstrate this use case I added a test case that currently fails: Looking for brave contributors to see if they can crack it |
Steps to reproduce:
Created a topology that included some Junos vSwitch images -> Added a block config in the topology file -> the resultant encrypted password (if if contained
.
or/
characters) would truncate.What winds up happening is the encrypted password appears as
".QdM.Nvz1fDDYhnwb27cMSXJmXxS23ti50z/liD3obqPRYs5UKHVbKFRtqZO.AoXJIVR6Um17RFfSwWm1"
ContainerLab Version 0.56.0
The text was updated successfully, but these errors were encountered: