Skip to content

Commit

Permalink
Support new location for apt repo
Browse files Browse the repository at this point in the history
Node this is a cherry pick of certain parts of
puppetlabs#657

This is stalled due to yum issues and so doing this quick fix for
now to get us going. Once above is merged we can switch back
to upstream.

(cherry picked from commit 07acbc1)
  • Loading branch information
sorrison authored and waipeng committed May 24, 2024
1 parent de4d089 commit e7c5707
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@
String $kubernetes_version = '1.10.2',
String $kubernetes_cluster_name = 'kubernetes',
String $kubernetes_package_version = $facts['os']['family'] ? {
'Debian' => "${kubernetes_version}-00",
'Debian' => "${kubernetes_version}-1.1",
'RedHat' => $kubernetes::kubernetes_version,
},
String $container_runtime = 'docker',
Expand Down
13 changes: 8 additions & 5 deletions manifests/repos.pp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#
class kubernetes::repos (
String $container_runtime = $kubernetes::container_runtime,
Optional[String] $kubernetes_version = $kubernetes::kubernetes_version,
Optional[String] $kubernetes_apt_location = $kubernetes::kubernetes_apt_location,
Optional[String] $kubernetes_apt_release = $kubernetes::kubernetes_apt_release,
Optional[String] $kubernetes_apt_repos = $kubernetes::kubernetes_apt_repos,
Expand All @@ -60,16 +61,18 @@

) {
if $create_repos {
$parts = split($kubernetes_version, '[.]')
$minor_version = "${parts[0]}.${parts[1]}"
case $facts['os']['family'] {
'Debian': {
$codename = fact('os.distro.codename')
apt::source { 'kubernetes':
location => pick($kubernetes_apt_location,'https://apt.kubernetes.io'),
repos => pick($kubernetes_apt_repos,'main'),
release => pick($kubernetes_apt_release,'kubernetes-xenial'),
location => pick($kubernetes_apt_location,"https://pkgs.k8s.io/core:/stable:/v${minor_version}/deb"),
repos => '',
release => pick($kubernetes_apt_release,'/'),
key => {
'id' => pick($kubernetes_key_id,'A362B822F6DEDC652817EA46B53DC80D13EDEF05'),
'source' => pick($kubernetes_key_source,'https://packages.cloud.google.com/apt/doc/apt-key.gpg'),
'id' => pick($kubernetes_key_id,'DE15B14486CD377B9E876E1A234654DA9A296436'),
'source' => pick($kubernetes_key_source,"https://pkgs.k8s.io/core:/stable:/v${minor_version}/deb/Release.key"),
},
}

Expand Down

0 comments on commit e7c5707

Please sign in to comment.