Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Implements usage of the
tpldir
SLS variable to make formula function independent of absolute path on the salt fileserverMotivation
Our salt fileserver has a pretty strict layout, and all formulas must go to
salt://formulas/...
. This formula currently has some hard-references that expect it to exist atsalt://datadog
, which meant it wouldn't work out-of-the-box for us. Rather than update the hardcoded paths, I decided to implement this in a way that would work regardless of where it's deployed.Additional Notes
Thanks for taking the time to put this together and publish it! Having even a starting point is great. Would love to see it updated to support Windows installs, I may take a crack at that later as time allows.
Describe your test plan
I tested this locally in my lab, applying to a Ubuntu 20.04 machine from both
salt://formulas/datadog
andsalt://datadog
. In both cases it worked for me, but having a test in CI to make sure it works from multiple paths would ensure this behavior remains. I'm not familiar enough with CircleCI to be comfortable implementing it without any conversation.