-
Notifications
You must be signed in to change notification settings - Fork 85
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
refactor(naming): reserve 'pkg' as name of packaging dict #137
refactor(naming): reserve 'pkg' as name of packaging dict #137
Conversation
So if I understand, imagine I have a main program and plugins, I could have something like: program:
pkg:
name: the-program
use_upstream_repo: true
repo:
name: deb {{ repo.official }}/debian-{{ repo.release }}/ {{ grains.oscodename }} main
humanname: Something Debian Repository
plugins:
an-external-plugin:
pkg:
name: a-cool-plugin
use_upstream_repo: true
repo:
name: deb https://example.net/repo/a-cool-plugin/ {{ grains.oscodename }} stable
humanname: Debian reposiory for a cool plugin
key_url: https://example.net/repo/a-cool-plugin/project/gpg_key.pub
gpgcheck: 1 Actually, I found several formulas using program:
pkg: something
use_upstream_repo: true
repo:
name: deb {{ repo.official }}/debian-{{ repo.release }}/ {{ grains.oscodename }} main
humanname: Something Debian Repository
plugins:
an-external-plugin:
pkg: a-cool-plugin
use_upstream_repo: true
repo:
name: deb https://example.net/repo/a-cool-plugin/ {{ grains.oscodename }} stable
humanname: Debian reposiory for a cool plugin
key_url: https://example.net/repo/a-cool-plugin/project/gpg_key.pub
gpgcheck: 1 I like your proposal because it produce meanful The cons would be the additional level, let see if the SaltStack community prefer the flatter one. |
If this is to be merged, this is a breaking changes and should be announce in the commit message. |
@noelmcloughlin not sure I completely understand the problem, but if I do, my comment is: if a formula manages package installation, it should have default values to indicate for example repo, package name, etc. Then those values are populated in the jinja files (osmap...), then they can be override with the |
Hi @baby-gnu My 1st implementation in cloudfoundry-formula looks like your examples. I added an extra (perhaps superfluous) level.
My related "pkg:archive" implementation (the extra level was to allow
Good point about breaking change - I'll update the commit message. |
Hi @daks, yes that correct. The intention of this PR was small breaking change to convert |
Hello @noelmcloughlinx The extra sublevel maybe superfluous, but we should make sure to be able to use For me,
I don't get the point about Why pkg:
archive:
source: https://packages.cloudfoundry.org/stable?release=linux64-binary&version=6.44.1&source=github-rel
extracted:
name: /usr/local/bin
source: /tmp/cloudfoundry/cf-cli.tgz
source_hash: b986a55fef4bd6f580d7a070f4592362309fe009ffdd9489b9d3b871aed07aa3
trim_output: True
enforce_toplevel: False is better than pkg:
archive:
name: /usr/local/bin
source: https://packages.cloudfoundry.org/stable?release=linux64-binary&version=6.44.1&source=github-rel
source_hash: b986a55fef4bd6f580d7a070f4592362309fe009ffdd9489b9d3b871aed07aa3
archive_format: tar
trim_output: True
enforce_toplevel: False For me, it avoid managing Regards. |
OK. Does it needs to be done in |
It should be done here template formula in my opinion - i.e. change pkg to dict. |
Thanks @baby-gnu @daks this was the item related to this PR.
This PR is an enabler only. |
Here are derived implementations based on this pkg dict ... |
BREAKING CHANGE: the parameter `pkg` is now a dictionary. References to `template.pkg` should be changed to `template.pkg.name`.
Related issue: #135. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with this pull request.
The failed build is not related to the changes here.
🎉 This PR is included in version 3.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
prometheus on centos needs a repo setup. I've studied how best to incorporate this into this formula and the result is here. My method involved introducing a pkg dictionary to collect packaging related details. That provided the model on which to propose handling package repos. The problem is that "pkg" variable is already in use.
This PR is to reclaim "pkg" variable as dict. Let me know if you like the approach.
The followup PR will be to to add repo support to both template and then prometheus formulas.