Skip to content

Commit

Permalink
Use --experimental-patches for older versions less than 1.22; use --p…
Browse files Browse the repository at this point in the history
…atches >= 1.22

Co-authored-by: Lubomir I. Ivanov <[email protected]>
Signed-off-by: Paco Xu <[email protected]>
  • Loading branch information
pacoxu and neolit123 committed Aug 10, 2021
1 parent 43c8781 commit 0270caa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kinder/pkg/cluster/manager/actions/kubeadm-upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ func kubeadmUpgradeApply(c *status.Cluster, cp1 *status.Node, upgradeVersion *K8
}
if patchesDir != "" {
if cp1.MustKubeadmVersion().LessThan(constants.V1_22) {
applyArgs = append(applyArgs, "--experimental-patches", constants.PatchesDir)
} else {
applyArgs = append(applyArgs, "--patches", constants.PatchesDir)
}
}
Expand Down Expand Up @@ -158,7 +160,11 @@ func kubeadmUpgradeNode(c *status.Cluster, n *status.Node, upgradeVersion *K8sVe
"upgrade", "node", fmt.Sprintf("--v=%d", vLevel),
}
if patchesDir != "" {
nodeArgs = append(nodeArgs, fmt.Sprintf("--patches=%s", constants.PatchesDir))
if n.MustKubeadmVersion().LessThan(constants.V1_22) {
nodeArgs = append(nodeArgs, fmt.Sprintf("--experimental-patches=%s", constants.PatchesDir))
} else {
nodeArgs = append(nodeArgs, fmt.Sprintf("--patches=%s", constants.PatchesDir))
}
}
if err := n.Command(
"kubeadm", nodeArgs...,
Expand Down

0 comments on commit 0270caa

Please sign in to comment.