Skip to content

Commit

Permalink
fix(template): use stricter context for disabled flag resolution (#…
Browse files Browse the repository at this point in the history
…6295)

Do not allow `this.*` context for `disabled` field.
To avoid unnecessary complexity in passing action mode to the `scanAndAddConfigs()`.
  • Loading branch information
vvagaytsev committed Jul 17, 2024
1 parent 02ef176 commit e8e0b86
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions core/src/garden.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ import {
DefaultEnvironmentContext,
ProjectConfigContext,
RemoteSourceConfigContext,
TemplatableConfigContext,
} from "./config/template-contexts/project.js"
import type { CloudApi, CloudProject } from "./cloud/api.js"
import { getGardenCloudDomain } from "./cloud/api.js"
Expand Down Expand Up @@ -172,7 +173,6 @@ import { styles } from "./logger/styles.js"
import { renderDuration } from "./logger/util.js"
import { getCloudDistributionName, getCloudLogSectionName } from "./util/cloud.js"
import { makeDocsLinkStyled } from "./docs/common.js"
import { ActionConfigContext } from "./config/template-contexts/actions.js"

const defaultLocalAddress = "localhost"

Expand Down Expand Up @@ -1521,16 +1521,7 @@ export class Garden {
return disabledFlag
}

const context = new ActionConfigContext({
garden: this,
config,
thisContextParams: {
name: config.name,
// TODO: resolve this if necessary
mode: "default",
},
variables: this.variables,
})
const context = new TemplatableConfigContext(this, config)

return resolveTemplateString({
string: disabledFlag,
Expand Down

0 comments on commit e8e0b86

Please sign in to comment.