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

template: Create a my alias for the current pack #221

Merged
merged 3 commits into from
Mar 14, 2022
Merged

Conversation

angrycub
Copy link
Contributor

@angrycub angrycub commented Mar 10, 2022

Description

Currently a pack's variables are accessed through a variable with the packs name. For example, the simple_service
pack's job_name value is accessed in templates using .simple_service.job_name. This PR creates an alias—my
that can also be used to refer to the current pack's variables. In this same example, a template of simple_service
can also access the job_name value using .my.job_name.

This can facilitate template reuse between packs with less editing.

Commits

  • Add my alias to pack variables
  • Add test

Reminders

  • Add CHANGELOG.md entry

@angrycub angrycub added type/enhancement theme/template/variable Relates to the variables passed to templates labels Mar 10, 2022
@angrycub angrycub self-assigned this Mar 10, 2022
@angrycub angrycub force-pushed the f-alias-pack-as-my branch 2 times, most recently from 7a8fb14 to 1de8429 Compare March 10, 2022 19:31
@angrycub angrycub force-pushed the f-alias-pack-as-my branch from 1de8429 to f9e27ce Compare March 11, 2022 01:29
@angrycub angrycub changed the title WIP: template: Create a my alias for the current pack template: Create a my alias for the current pack Mar 11, 2022
@angrycub angrycub marked this pull request as ready for review March 11, 2022 01:33
@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@DerekStrickland DerekStrickland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests for this fail after pull. Should they?

Click for test output ``` internal/cli/api_test.go:9:2: github.com/hashicorp/nomad@v1.2.7-0.20220223202307-7bcf0afd810b: invalid version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /Users/derekstrickland/go/pkg/mod/cache/vcs/911d2abcaf3e75a0404250248d67881ab48f5b0fce3b832faf67761fee0fe0f2: exit status 128: error: Could not read e6814c08afe92af1e3e09ae9653fd3130d5d893a error: Could not read d7edf9b2e42348865908735996359c7869fb16b5 error: Could not read 80185938a8bda74a28e4f8b381c677f87ffb13a4 error: Could not read b7248824cf2e3e9889e506f384bb585f03452939 error: Could not read 2a6beed6dab27c55fcc5106fadae6a81274dffb2 error: Could not read b511af94e6aa4bad62a5552f7c33581ede65b0d5 error: Could not read d496f7b030a5544fd07e79ae5f9a20720dfc3437 error: Could not read fcd42f639221c537c126b6f7d556de421a612d58 error: Could not read e8a418b1ecad109ca8834ef6ed22fe27b1c46164 error: Could not read 9d4ff89eaff3ef4f32df90b00e1c56b5a280e2ea error: Could not read 4c40d62f684e96c0ff20616d93044de681ad48d6 error: Could not read 6b43ecb4250450e5939fad6238fe2bbbba3192b8 error: Could not read d28bf3231ecf59dba16bdc74da91611fef1c7c68 error: Could not read 72b9b879e521124e8ce097f00fb424358ac8007d error: Could not read f3c944aaf585ca2abc630e4be00e170af9b6759c error: Could not read 4cac8448726749d859890a0752f255a39ec5a5f2 error: Could not read f75f5c9b3b30c82085bafd068a5bb4c48236b167 error: Could not read 97d03887c767c0e9c78a2cdd15825544c2010dbe error: Could not read f95749f1cacad532f97875ea2e68e3315e5872ae error: Could not read 069455c0e414e3824db121634d0074729e233e55 error: Could not read bb8ce73cc7bc998f879a3420cb28c3de4f6a5630 error: Could not read 858e98cea0bd623279652c9886364f28d3b8c13f error: Could not read 6708a0ccc9032010eb6ac34c07463b8dedaffd58 error: Could not read e87d9cc8a689685e0a346f9b7dc71ef3d53c6cdc error: Could not read 8920d56212835e09cad3def7b4f77d4ebb813bd1 error: Could not read 382bbbe29fac9341b639f7dfcfe10b9084a4e853 error: Could not read 058a8daac3913c673fc39ff9af452bc37f8e0a90 error: Could not read 0ecda992317d3300e1c1da05170f8bba18410357 error: Could not read 855caf72328e02ef7b20292872bd892f3eb5d5c5 error: Could not read 4b070e8e18228ff8dc60d9a1d74a99630b3c26d7 error: Could not read cafdcc9216bc5af0d7db97de12807a0f504e7c88 error: Could not read 830c0b16d2ed3d1e3ac17caf683a64aafdbcfba1 ```

Copy link
Contributor

@DerekStrickland DerekStrickland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@angrycub angrycub merged commit e3fedb1 into main Mar 14, 2022
@angrycub angrycub deleted the f-alias-pack-as-my branch March 14, 2022 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/template/variable Relates to the variables passed to templates type/enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants