Skip to content

Conversation

SamJoan
Copy link
Contributor

@SamJoan SamJoan commented Jul 12, 2021

PR progress checklist (to be filled in by reviewers)

  • Changes to documentation are appropriate (or tick if not required)
  • Changes to tests are appropriate (or tick if not required)
  • Reviews completed

What type of PR is this?

Primary type

  • [build] Changes related to the build system
  • [chore] Changes to the build process or auxiliary tools and libraries such as documentation generation
  • [ci] Changes to the continuous integration configuration
  • [feat] A new feature
  • [fix] A bug fix
  • [perf] A code change that improves performance
  • [refactor] A code change that neither fixes a bug nor adds a feature
  • [revert] A change used to revert a previous commit
  • [style] Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)

Secondary type

  • [docs] Documentation changes
  • [test] Adding missing or correcting existing tests

Does this PR introduce a BREAKING CHANGE?

No.

Related issues and/or pull requests

N/A. No one has documented an attempt to run this formula on debian bullseye (testing) at this stage.

Describe the changes you're proposing

Hi there. Currently, installation on debian bullseye results in a broken APT configuration if use_upstream_repo is set to True. The string "postgresql-repo" string is entered into the /etc/apt/sources.list.d/pgdg.list file. This results in apt being unusable in the target system, which ideally should not happen.

My changes resolve this issue by adding support for debian bullseye (testing)

Pillar / config required to test the proposed changes

postgres:
  use_upstream_repo: True
  fromrepo: bullseye-pgdg
  version: '13'

Debug log showing how the proposed changes work

root@saltmain:/srv/formulas# salt 'unicornbottle-main' state.apply postgres.upstream
unicornbottle-main:
  Name: postgresql-pkg-deps - Function: pkg.installed - Result: Clean Started: - 15:21:26.534113 Duration: 23.875 ms
  Name: deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main - Function: pkgrepo.managed - Result: Changed Started: - 15:21:26.559226 Duration: 6556.887 ms

Summary for unicornbottle-main
------------
Succeeded: 2 (changed=1)
Failed:    0
------------
Total states run:     2
Total run time:   6.581 s

Now configuration is set as follows:

# cat /etc/apt/sources.list.d/pgdg.list
deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main

Documentation checklist

  • Updated the README (e.g. Available states).
  • Updated pillar.example.

Testing checklist

  • Included in Kitchen (i.e. under state_top).
  • Covered by new/existing tests (e.g. InSpec, Serverspec, etc.).
  • Updated the relevant test pillar.

Additional context

This is debian's unstable branch. I'm personally using it to be a little more up to date as stability is not a concern for my current project. If I have any issues I'll update here with additional fixes, however I think that how the project is laid out everything should continue to work as this is a very small change which should not have many repercussions.

@SamJoan SamJoan requested review from myii and vutny as code owners July 12, 2021 22:24
Copy link
Contributor

@myii myii left a comment

Choose a reason for hiding this comment

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

Tested this locally with Kitchen on the new debain-11 pre-salted image that will be pushed out across all repos soon (i.e. default-debian-11-master-py3) -- all working fine, thanks.

@myii myii merged commit d2efe08 into saltstack-formulas:master Jul 15, 2021
@saltstack-formulas-travis

🎉 This PR is included in version 0.42.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants