Skip to content

Commit

Permalink
Merge pull request #1250 from evrardjp/cherry-pick-master-patches-for…
Browse files Browse the repository at this point in the history
…-migration

Cherry pick master patches for migration
  • Loading branch information
jordimassaguerpla authored Jul 14, 2020
2 parents 279e6df + 90c5556 commit 04784c1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
1 change: 0 additions & 1 deletion ci/packaging/suse/skuba_spec_template
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ Summary: Utility to automatically refresh and update a skuba cluster
Group: System/Management
Requires: python3-setuptools
Requires: zypper >= 1.14.15
Requires: kubernetes-client
Requires: lsof
BuildArch: noarch
%{?systemd_requires}
Expand Down
18 changes: 14 additions & 4 deletions internal/pkg/skuba/deployments/ssh/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func kubernetesFreshInstallAllPkgs(t *Target, data interface{}) error {
pkgs = append(pkgs, fmt.Sprintf("+kubernetes-%s-kubelet", current))
pkgs = append(pkgs, fmt.Sprintf("+kubernetes-%s-client", current))
pkgs = append(pkgs, fmt.Sprintf("+cri-o-%s*", current))
pkgs = append(pkgs, fmt.Sprintf("+cri-tools-%s*", current))

_, _, err = t.zypperInstall(pkgs...)
return err
Expand All @@ -113,9 +114,16 @@ func kubernetesUpgradeStageOne(t *Target, data interface{}) error {
// 1.17 is the last version included in CaaSP4. It's the tipping
// point where we changed our packaging.
// On 1.17 we can't remove kubernetes-1.17-kubeadm, because it doesn't exist.
// Removing kubeadm keeps kubelet alive.
// The rest needs to be removed on the next stage.
pkgs = append(pkgs, "-patterns-caasp-Node-1.17", "-\"kubernetes-kubeadm<1.18\"", "-caasp-config")
// We are removing kubeadm while keeping kubelet alive to its version 1.17.
// For the initial migration we need to update crio kubeadm
// to 1.18 in stage1, due to conflict resolution: the caasp4
// cri-o-kubeadm-criconfig requires kubernetes-kubeadm which is
// not provided anymore (when we remove kubernetes-kubeadm, and
// because we don't want to have the same provides: on the new
// package to avoid upgrade during zypper migration).
// we need to remove cri-o in stage2 else 1.17 kubelet could
// complain about cri-runtime being absent.
pkgs = append(pkgs, "-patterns-caasp-Node-1.17", "-\"kubernetes-kubeadm<1.18\"", "-caasp-config", "-cri-o-kubeadm-criconfig")
} else {
pkgs = append(pkgs, fmt.Sprintf("-kubernetes-%s-kubeadm", currentV))
}
Expand Down Expand Up @@ -144,15 +152,17 @@ func kubernetesUpgradeStageTwo(t *Target, data interface{}) error {
pkgs = append(pkgs, "-\"kubernetes-kubelet<1.18\"")
pkgs = append(pkgs, "-kubernetes-common")
pkgs = append(pkgs, "-\"kubernetes-client<1.18\"")
pkgs = append(pkgs, "-cri-o*")
pkgs = append(pkgs, "-\"cri-o<1.18\"")
} else {
pkgs = append(pkgs, fmt.Sprintf("-kubernetes-%s-*", currentV))
pkgs = append(pkgs, fmt.Sprintf("-cri-o-%s*", currentV))
pkgs = append(pkgs, fmt.Sprintf("-cri-tools-%s*", currentV))
}

pkgs = append(pkgs, fmt.Sprintf("+kubernetes-%s-client", nextV))
pkgs = append(pkgs, fmt.Sprintf("+kubernetes-%s-kubelet", nextV))
pkgs = append(pkgs, fmt.Sprintf("+cri-o-%s*", nextV))
pkgs = append(pkgs, fmt.Sprintf("+cri-tools-%s*", nextV))
_, _, err = t.zypperInstall(pkgs...)
return err
}
Expand Down

0 comments on commit 04784c1

Please sign in to comment.