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

fix(suse): Fix support to install compose from PackageHub on SLES 15 #296

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ypid-geberit
Copy link

@ypid-geberit ypid-geberit commented Aug 5, 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

Describe the changes you're proposing

Pillar / config required to test the proposed changes

Debug log showing how the proposed changes work

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

To actually install the packages, you need to set the following in your pillar because the PackageHub repos are not enabled by default on SLES.

docker:
  pkg:
    docker:
      use_upstream: 'package'
    compose:
      use_upstream: 'package'

@ypid-geberit ypid-geberit changed the title fix(suse): Fix support for SLES 15 fix(suse): Fix support to install compose from PackageHub on SLES 15 Aug 5, 2021
@noelmcloughlin
Copy link
Member

Thanks, very much @ypid-geberit Two Suse checks are failing.

     ×  File /usr/local/bin/docker-compose is expected to be symlink
     expected `File /usr/local/bin/docker-compose.symlink?` to be truthy, got false
     ×  File /usr/local/bin/docker-compose is expected to be file
     expected `File /usr/local/bin/docker-compose.file?` to be truthy, got false

On SUSE this should be /usr/local/bin/python-docker-compose so you may need an IF condition and variable.

Can you update https://github.com/saltstack-formulas/docker-formula/blob/master/test/integration/archive/controls/archive_spec.rb and can be merged afterwards.

@ypid-geberit
Copy link
Author

Thanks looking at this! I am new to Test Kitchen and tried to see how to do this now. I found https://kitchen.ci/docs/getting-started/writing-test/ and https://github.com/ssplatt/filebeat-formula/blob/master/test/integration/helpers/serverspec/spec_helper.rb

I am not sure how to best test for the openSUSE version. I found https://docs.chef.io/inspec/resources/os/. Can you give me a hint?

@noelmcloughlin
Copy link
Member

I can never remember syntax. I looked at prometheus-formula as reference and suggest this example is probably close to what is needed. Hopefully 'suse' is valid.

control 'docker components' do
  title 'this is just example'

  case platform[:family]
  when 'suse'
    compose_bin = '/usr/local/bin/python-docker-compose'
  else
    compose_bin = '/usr/local/bin/docker-compose'
  end

  describe file("#{compose_bin}") do
    it { should exist }
    its('group') { should eq 'root' }
    its('mode') { should cmp '0644' }
  end

@ypid-geberit ypid-geberit force-pushed the fix/suse branch 2 times, most recently from 8401b2f to 56b4080 Compare August 24, 2021 15:30
@noelmcloughlin
Copy link
Member

My mistake, I see "opensuse" is used in nginx-formula.

# Override by OS
case os[:name]
when 'redhat', 'centos', 'fedora'
  server_available = '/etc/nginx/conf.d'
  server_enabled   = '/etc/nginx/conf.d'
when 'opensuse'
  server_available = '/etc/nginx/vhosts.d'
  server_enabled   = '/etc/nginx/vhosts.d'
end

@noelmcloughlin
Copy link
Member

Hi @ypid-geberit
Can you amend the commit to lowercase as commitlint is complaining

fix(suse): fix support to install compose from PackageHub on SLES 15

@noelmcloughlin
Copy link
Member

Try disabling Suse in .gitlab-ci due to #313

@ypid-geberit ypid-geberit requested a review from a team as a code owner February 6, 2022 12:26
To actually install the packages, you need to set the following in your
pillar because the PackageHub repos are not enabled by default on SLES.

```YAML
docker:
  pkg:
    docker:
      use_upstream: 'package'
    compose:
      use_upstream: 'package'
```
@ypid-geberit
Copy link
Author

Can you amend the commit to lowercase as commitlint is complaining

All right.

Try disabling Suse in .gitlab-ci due to

I tried that.

PS: Note that I switched jobs and archived this account. I might be slow to respond and it might be quicker when you make those changes directly.

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.

2 participants