Skip to content

Commit

Permalink
fix(k8s): error when running cluster-init command
Browse files Browse the repository at this point in the history
This was introduced in the Helm 3 PR, so users have not been affected.
  • Loading branch information
edvald authored and eysi09 committed Dec 12, 2019
1 parent 10b90e1 commit dd94e05
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions garden-service/src/plugins/kubernetes/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,20 +236,20 @@ export async function prepareSystem({

const remoteCluster = provider.name !== "local-kubernetes"

// Don't attempt to prepare environment when running the uninstall command
if (ctx.command && ctx.command.name === "plugins" && ctx.command.args.command === "uninstall-garden-services") {
// Don't attempt to prepare environment automatically when running the init or uninstall commands
if (
!clusterInit &&
ctx.command?.name === "plugins" &&
(ctx.command?.args.command === "uninstall-garden-services" || ctx.command?.args.command === "cluster-init")
) {
return {}
}

// If we require manual init and system services are ready OR outdated but none are *missing*, we warn
// in the prepareEnvironment handler, instead of flagging as not ready here. This avoids blocking users where
// there's variance in configuration between users of the same cluster, that often doesn't affect usage.
if (!clusterInit && remoteCluster) {
if (
combinedState === "outdated" &&
!serviceStates.includes("missing") &&
!(ctx.command && ctx.command.name === "plugins" && ctx.command.args.command === "cluster-init")
) {
if (combinedState === "outdated" && !serviceStates.includes("missing")) {
log.warn({
symbol: "warning",
msg: chalk.yellow(deline`
Expand Down

0 comments on commit dd94e05

Please sign in to comment.