You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've started exploring nomad-packs recently and I'm testing whats possible with the current set of features and Im running into some basic, yet important components that I cant get to work.
What I'm trying to do is fairly standard and not that strange.
Have a separate pack that would be used across everything and we import it as dependency and use the templates from the common pack.
Simple right?
I've made that part of the setup:
dependency "shared-packs" {
alias = "sp"
source = "git@<>:dkyanakiev/shared-packs.git//packs/common"
}
Note: The alias is not a thing yet but thats the last test I had from one of the open MRs I was looking at
I reference a template I have like so: [[ template "constraints" .sp ]]
And it works - however the problem I'm running is that variables I have in my main pack are not passed down to my dependency template.
For example: I have a variable called environment which has logic built around it.
I have that variable set in my main pack but the dependency pack never finds that variable. I know for a fact the logic works because when I play with the default variables in the shared-pack I can see how the template renders correctly but not when I actually expect to get the variable from the main template.
I tried setting the variable as default in the main pack or running with a var file - same result.
Documentation is limited so I cant follow if this is me missing something or this not working yet
The text was updated successfully, but these errors were encountered:
Well you don't need to explicitly pass them when using the version from master
[[ template "region" . ]]
and
[[ define "region" -]]
[[- if not (eq .my.region "") -]]
region = [[ .my.region | quote]]
[[- end -]]
[[- end -]]
With the region being imported via dependency - works like a charm. I was testing a build from - #403 since it looks like a good merge candidate and it had features in I wanted to look but ran into the issue above
Hi,
I've started exploring nomad-packs recently and I'm testing whats possible with the current set of features and Im running into some basic, yet important components that I cant get to work.
What I'm trying to do is fairly standard and not that strange.
Have a separate pack that would be used across everything and we import it as dependency and use the templates from the common pack.
Simple right?
I've made that part of the setup:
Note: The alias is not a thing yet but thats the last test I had from one of the open MRs I was looking at
I reference a template I have like so:
[[ template "constraints" .sp ]]
And it works - however the problem I'm running is that variables I have in my main pack are not passed down to my dependency template.
For example: I have a variable called
environment
which has logic built around it.I have that variable set in my main pack but the dependency pack never finds that variable. I know for a fact the logic works because when I play with the default variables in the shared-pack I can see how the template renders correctly but not when I actually expect to get the variable from the main template.
I tried setting the variable as default in the main pack or running with a var file - same result.
Documentation is limited so I cant follow if this is me missing something or this not working yet
The text was updated successfully, but these errors were encountered: