Skip to content

Commit

Permalink
fix(k8s): enable microk8s addons sequentially
Browse files Browse the repository at this point in the history
To avoid deprecation warning like this:

WARNING: Do not enable or disable multiple addons in one command.
This form of chained operations on addons will be DEPRECATED in the future.
Please, {action} one addon at a time: 'microk8s {action} <addon>'
  • Loading branch information
vvagaytsev committed Jul 20, 2023
1 parent 42842ed commit 1a715f9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/src/plugins/kubernetes/local/microk8s.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { exec } from "../../../util/util"
import { containerHelpers } from "../../container/helpers"
import { ContainerBuildAction } from "../../container/moduleConfig"
import chalk from "chalk"
import { naturalList, deline } from "../../../util/string"
import { deline, naturalList } from "../../../util/string"
import { ExecaReturnValue } from "execa"
import { PluginContext } from "../../../plugin-context"
import { parse as parsePath } from "path"
Expand Down Expand Up @@ -55,7 +55,11 @@ export async function configureMicrok8sAddons(log: Log, addons: string[]) {

if (missingAddons.length > 0) {
microK8sLog.info(`enabling required addons (${missingAddons.join(", ")})`)
await exec("microk8s", ["enable"].concat(missingAddons))
// It's recommended to enable microk8s addons sequentially instead of using chained operations.
// Otherwise, a deprecation warning will be printed.
for (const missingAddon of missingAddons) {
await exec("microk8s", ["enable", missingAddon])
}
}
}

Expand Down

0 comments on commit 1a715f9

Please sign in to comment.