Skip to content

Commit

Permalink
chore: deprecate local-mode on the command level (#6827)
Browse files Browse the repository at this point in the history
* chore: deprecate local-mode on the command level

* docs: re-generate docs
  • Loading branch information
vvagaytsev authored Feb 10, 2025
1 parent 97782db commit 9fae18c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
9 changes: 9 additions & 0 deletions core/src/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { gardenEnv } from "../constants.js"
import type { DeployAction } from "../actions/deploy.js"
import { watchParameter, watchRemovedWarning } from "./util/watch-parameter.js"
import { styles } from "../logger/styles.js"
import { reportDeprecatedFeatureUsage } from "../util/deprecations.js"

export const deployArgs = {
names: new StringsParameter({
Expand Down Expand Up @@ -172,6 +173,14 @@ export class DeployCommand extends Command<Args, Opts> {
async action(params: CommandParams<Args, Opts>): Promise<CommandResult<ProcessCommandResult>> {
const { garden, log, args, opts } = params

if (opts["local-mode"] !== undefined) {
reportDeprecatedFeatureUsage({
apiVersion: garden.projectApiVersion,
log,
deprecation: "localMode",
})
}

this.garden = garden
const commandLog = log.createLog({ name: "garden" })

Expand Down
1 change: 1 addition & 0 deletions core/src/commands/dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Use ${styles.bold("up/down")} arrow keys to scroll through your command history.

override async action(params: ActionParams): Promise<CommandResult> {
const { log } = params

this.setProps(params.garden.sessionId, params.cli?.plugins || [])

const logger = log.root
Expand Down
9 changes: 9 additions & 0 deletions core/src/commands/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import type { GardenPluginReference } from "../plugin/plugin.js"
import { CommandError, ParameterError, isEAddrInUseException, isErrnoException } from "../exceptions.js"
import { styles } from "../logger/styles.js"
import { getCloudDistributionName } from "../cloud/util.js"
import { reportDeprecatedFeatureUsage } from "../util/deprecations.js"

export const defaultServerPort = 9777

Expand Down Expand Up @@ -97,6 +98,14 @@ export class ServeCommand<
const sessionId = garden.sessionId
this.setProps(sessionId, cli?.plugins || [])

if (opts["local-mode"] !== undefined) {
reportDeprecatedFeatureUsage({
apiVersion: garden.projectApiVersion,
log,
deprecation: "localMode",
})
}

const projectConfig = await findProjectConfig({ log, path: garden.projectRoot })

const manager = this.getManager(log, undefined)
Expand Down
6 changes: 6 additions & 0 deletions core/src/util/deprecations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ export function getDeprecations(style: (s: string) => string = styles.highlight)
hadolintPlugin: makePluginDeprecation("hadolint", style),
octantPlugin: makePluginDeprecation("octant", style),
conftestPlugin: makePluginDeprecation("conftest", style),
localMode: {
contextDesc: "Local mode",
featureDesc: `The ${style("local mode")} feature for container, kubernetes and helm deploys`,
hint: "Please do not use this in Garden 0.14",
hintReferenceLink: null,
},
} as const
}

Expand Down
8 changes: 7 additions & 1 deletion docs/guides/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,10 @@ This plugin is still enabled by default in Garden 0.13, but will be removed in G

<h3 id="conftestPlugin">The plugin `conftest`</h3>

This plugin is still enabled by default in Garden 0.13, but will be removed in Garden 0.14. Do not use this plugin explicitly in Garden 0.14.
This plugin is still enabled by default in Garden 0.13, but will be removed in Garden 0.14. Do not use this plugin explicitly in Garden 0.14.

## Local mode

<h3 id="localMode">The `local mode` feature for container, kubernetes and helm deploys</h3>

Please do not use this in Garden 0.14

0 comments on commit 9fae18c

Please sign in to comment.