Skip to content

Introduce fromrepo support. #209

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

Merged
merged 3 commits into from
May 9, 2018

Conversation

noelmcloughlin
Copy link
Contributor

This PR introduces fromrepo support (replaces #185 and resolves #133). Testing was done on Ubuntu/Centos/Fedora. Comments welcomed.

Copy link
Contributor

@vutny vutny left a comment

Choose a reason for hiding this comment

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

Well done, @noelmcloughlin !
I just have couple of things to address. Despite of that, your changes look solid.

{% set pkg_dev = '' %}
{% else %}
{% set fromrepo = name %}
{% set pkg_dev = 'postgresql-server-dev-all' %}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you want to expose pkg_dev value in the rendered YAML dictionary below, since it would be just gone. Simply because upper level yaml loader does not inherit local variables, especially within macros scope.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for reviewing @vutny I'll have a look at the comments now.

Copy link
Contributor Author

@noelmcloughlin noelmcloughlin May 7, 2018

Choose a reason for hiding this comment

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

I just realized pkg_dev was already fixed in osfamilymap.yaml by #200. I think we could remove pkg_dev from codenamemap.yaml?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, definitely.

pkg_repo:
name: 'deb http://apt.postgresql.org/pub/repos/apt {{ name }}-pgdg main {{ repo.version }}'
name: 'deb http://apt.postgresql.org/pub/repos/apt {{ name }}-pgdg main {{ version }}'
Copy link
Contributor

Choose a reason for hiding this comment

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

Good spot!

@@ -57,6 +57,10 @@ postgres:

bake_image: False

fromrepo:
pkg_repo:
name: []
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a little bit dangerous and I would recommend to avoid setting such defaults. I mean pkg_repo dictionary.

  1. Empty name is meaningless (why the list by the way?) and still will produce sneaky errors if other maps would not set it right.
  2. If use_upstream_repo Pillar is set, the upstream state would always try to provision some repo config, even if that is not applicable for some systems.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the assessment - the from_repo will work for both upstream and distro postgres.
do you think this stanza is unnecessary in defaults.yaml? Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Only the pkg_repo is harmful, because it would interfere with repository config handling logic.
Keeping the fromrepo is safe and necessary though.

@noelmcloughlin
Copy link
Contributor Author

These are resolved now.

Copy link
Contributor

@vutny vutny left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks @noelmcloughlin

@noelmcloughlin
Copy link
Contributor Author

Thanks again @vutny

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing fromrepo on postgresql-server and postgresql-client-libs
2 participants