-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Support Debian 11 #108
Draft
FlorentPoinsaut
wants to merge
10
commits into
master
Choose a base branch
from
FlorentPoinsaut-patch-2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Support Debian 11 #108
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8599229
Support Debian 11
FlorentPoinsaut 8543460
Use versioncmp instead of >=
FlorentPoinsaut dad103b
add debian version and bareos version compatibility check
FlorentPoinsaut 812ae9f
Merge branch 'master' into FlorentPoinsaut-patch-2
FlorentPoinsaut 7d5719c
Add Debian 11 compatibility mention
FlorentPoinsaut 16c5559
fix unit test
FlorentPoinsaut 50bca89
Fix Debian 11 unit test
FlorentPoinsaut 2e42adb
add release param depends on OS version
FlorentPoinsaut cbb7ca5
add compatibility of Debian 11 with Bareos 20
FlorentPoinsaut fbaa120
Merge branch 'master' into FlorentPoinsaut-patch-2
FlorentPoinsaut File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,8 @@ | |
"operatingsystem": "Debian", | ||
"operatingsystemrelease": [ | ||
"9", | ||
"10" | ||
"10", | ||
"11" | ||
] | ||
}, | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,22 +33,38 @@ | |
end | ||
end | ||
when 'Debian' | ||
case facts[:operatingsystemmajrelease] | ||
when '20' | ||
context 'with subscription: true, username: "test", password: "test"' do | ||
let(:params) do | ||
{ | ||
subscription: true, | ||
username: 'test', | ||
password: 'test' | ||
} | ||
case facts[:operatingsystem] | ||
when 'Debian' | ||
case facts[:operatingsystemmajrelease] | ||
when '11' | ||
context 'with release: "19.2"' do | ||
let(:params) do | ||
{ | ||
release: '19.2' | ||
} | ||
end | ||
|
||
it { is_expected.to compile.and_raise_error(%r{Bareos 19.2 is not distributed for Debian 11}) } | ||
end | ||
end | ||
when 'Ubuntu' | ||
case facts[:operatingsystemmajrelease] | ||
when '20' | ||
context 'with subscription: true, username: "test", password: "test"' do | ||
let(:params) do | ||
{ | ||
subscription: true, | ||
username: 'test', | ||
password: 'test' | ||
} | ||
end | ||
|
||
it { is_expected.to compile } | ||
it { is_expected.to compile } | ||
|
||
it do | ||
expect(subject).to contain_apt__source('bareos'). | ||
with_location('http://test:[email protected]/bareos/release/latest/xUbuntu_20.04') | ||
it do | ||
expect(subject).to contain_apt__source('bareos'). | ||
with_location('http://test:[email protected]/bareos/release/latest/xUbuntu_20.04') | ||
end | ||
end | ||
end | ||
end | ||
|
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.
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 wondering if that's required. Do we allow people to use this class directly or should it be marked private? the init.pp calls bareos::repository, that means
$bareos::repo_release
should work.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 think we can continue to allow people to use this class directly.
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.
in that case we maybe should inherit from bareos instead? that would be a common pattern. Otherwise you end up in situations where people set bareos::repo_release in hiera but that won't be picked up by this class.
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.
As it is, it is impossible because init.pp invoque
bareos::repository
class.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.
Then we can use this default parameter (no
params
component):No need for inheriting, we can even remove the parameter and use the
$bareos::repo_release
variable directly, and make the class private without impacting end-users 😉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 sorry but I don't understand what is the advantage of making the
param
class private.What is the problem to allow user to only add Bareos repository and nothing else?
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 am not speaking about the
params
class sorry… As you said,bareos::repository
cannot be declared by the end-user because thebareos
class declares it. So the user has no possibility to pass custom parameters unless using hiera which is not a good idea, it is some implementation detail internal to the module.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.
Ooohh no, my bad, I write
param
instead ofrepository
. I'm sorry.This scenario is true only if
bareos::repository
inherit ofbareos
but we have no problem ifbareos::repository
inherit ofbareos::param
as I wrote in code.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 believe that @smortex is suggesting to reference the
repo_release
parameter of thebareos
class and no inheritance is needed.