Skip to content
This repository was archived by the owner on Jun 29, 2022. It is now read-only.

Commit c1f853e

Browse files
author
Imran Pochi
authored
Merge pull request #1482 from kinvolk/imran/allow-skip-control-plane-update
cli/cmd/cluster: allow to skip the control plane update
2 parents 7a2f25a + 955edbe commit c1f853e

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

cli/cmd/cluster-apply.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ var (
2626
verbose bool
2727
skipComponents bool
2828
skipPreUpdateHealthCheck bool
29+
skipControlPlaneUpdate bool
2930
upgradeKubelets bool
3031
)
3132

@@ -47,6 +48,8 @@ func init() {
4748

4849
pf.BoolVarP(&skipPreUpdateHealthCheck, "skip-pre-update-health-check", "", false,
4950
"Skip ensuring that cluster is healthy before updating (not recommended)")
51+
pf.BoolVarP(&skipControlPlaneUpdate, "skip-control-plane-update", "", false,
52+
"Skip updating the control plane (not recommended)")
5053

5154
pf.BoolVarP(&upgradeKubelets, "upgrade-kubelets", "", false, "Experimentally upgrade self-hosted kubelets")
5255
}
@@ -62,6 +65,7 @@ func runClusterApply(cmd *cobra.Command, args []string) {
6265
UpgradeKubelets: upgradeKubelets,
6366
SkipComponents: skipComponents,
6467
SkipPreUpdateHealthCheck: skipPreUpdateHealthCheck,
68+
SkipControlPlaneUpdate: skipControlPlaneUpdate,
6569
Verbose: verbose,
6670
ConfigPath: viper.GetString("lokocfg"),
6771
ValuesPath: viper.GetString("lokocfg-vars"),

cli/cmd/cluster/apply.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ type ApplyOptions struct {
3131
UpgradeKubelets bool
3232
SkipComponents bool
3333
SkipPreUpdateHealthCheck bool
34+
SkipControlPlaneUpdate bool
3435
Verbose bool
3536
ConfigPath string
3637
ValuesPath string
@@ -126,7 +127,7 @@ func Apply(contextLogger *log.Entry, options ApplyOptions) error {
126127
}
127128

128129
// Do controlplane upgrades only if cluster already exists and it is not a managed platform.
129-
if exists && !c.platform.Meta().Managed {
130+
if exists && !options.SkipControlPlaneUpdate && !c.platform.Meta().Managed {
130131
fmt.Printf("\nEnsuring that cluster controlplane is up to date.\n")
131132

132133
if err := c.upgradeControlPlane(contextLogger, kubeconfig); err != nil {

docs/cli/lokoctl_cluster_apply.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ lokoctl cluster apply [flags]
2121
--confirm Upgrade cluster without asking for confirmation
2222
-h, --help help for apply
2323
--skip-components Skip applying component configuration
24+
--skip-control-plane-update Skip updating the control plane (not recommended)
2425
--skip-pre-update-health-check Skip ensuring that cluster is healthy before updating (not recommended)
2526
--upgrade-kubelets Experimentally upgrade self-hosted kubelets
2627
-v, --verbose Show output from Terraform

0 commit comments

Comments
 (0)