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

Use correct apt release on Debian/Ubuntu #338

Merged
merged 2 commits into from
Dec 11, 2019

Conversation

aptituz
Copy link
Contributor

@aptituz aptituz commented Sep 6, 2019

The kubernetes Debian repositories do not make use of codename-specific repositories. Instead a version for all supported releases is available in the "kubernetes-xenial" component.

This change hardcodes this component name as the default accordingly. Of course this might break in the future, but since the value can be overriden via a parameter and this change makes the defaults work on a larger set of distributions (e.g. Ubuntu Bionic but probably also Debian) it seems to be a viable solution anyway.

Fixes: #335

Patrick Schönfeld added 2 commits September 6, 2019 11:58
The kubernetes Debian repositories do not make use of codename-specific repositories. Instead a version for all supported releases is available in the "kubernetes-xenial" component. 

This change hardcodes this component name as the default accordingly. Of course this might brake in the future, but since the value can be overriden via a parameter and this change makes the default work on more distributions (e.g. Ubuntu Bionic) it seems to be a viable solution anyway.
@sheenaajay
Copy link
Contributor

@aptituz Thanks for submitting the PR.

$codename = fact('os.distro.codename')

Tried to check the value returned by the fact on Debian box and it returns xenial

$codename = fact('os.distro.codename')

oot@t5ecem6o15ipket:~# facter os.distro.codename
xenial
root@t5ecem6o15ipket:

But In Ubuntu it returns
trusty

root@i8gocvgpq7qj4fb:~# facter os.distro.codename
trusty

@@ -28,7 +28,7 @@
apt::source { 'kubernetes':
location => pick($kubernetes_apt_location,'http://apt.kubernetes.io'),
repos => pick($kubernetes_apt_repos,'main'),
release => pick($kubernetes_apt_release,"kubernetes-${codename}"),
release => pick($kubernetes_apt_release,'kubernetes-xenial'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of hardcoding the value can we just assign the value to a variable and use the variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's the benefit of assigning it to a variable if its not used in any other place?

@sheenaajay
Copy link
Contributor

Thanks @aptituz for submitting the PR. Ran the adhoc jobs and they ran clean. Thank you.

@sheenaajay sheenaajay merged commit 8d049ec into puppetlabs:master Dec 11, 2019
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.

Wrong default for kubernetes::kubernetes_apt_release
2 participants