diff --git a/garden-service/package-lock.json b/garden-service/package-lock.json index 1250fb90a9..b18a1497a9 100644 --- a/garden-service/package-lock.json +++ b/garden-service/package-lock.json @@ -5603,8 +5603,7 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.2.0", @@ -5625,14 +5624,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5647,20 +5644,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -5777,8 +5771,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -5790,7 +5783,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5805,7 +5797,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5813,14 +5804,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -5839,7 +5828,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -5920,8 +5908,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -5933,7 +5920,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -6019,8 +6005,7 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -6056,7 +6041,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -6076,7 +6060,6 @@ "version": "3.0.1", "bundled": true, "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -6120,14 +6103,12 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true } } }, @@ -11383,8 +11364,7 @@ "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" }, "slice-ansi": { "version": "3.0.0", diff --git a/garden-service/package.json b/garden-service/package.json index d8d1377929..38371fa07c 100644 --- a/garden-service/package.json +++ b/garden-service/package.json @@ -107,6 +107,7 @@ "recursive-readdir": "^2.2.2", "request": "^2.88.2", "request-promise": "^4.2.5", + "slash": "^3.0.0", "source-map-support": "^0.5.16", "split": "^1.0.1", "split2": "^3.1.1", diff --git a/garden-service/src/plugins/conftest/conftest-kubernetes.ts b/garden-service/src/plugins/conftest/conftest-kubernetes.ts index a66b593712..2057d8e094 100644 --- a/garden-service/src/plugins/conftest/conftest-kubernetes.ts +++ b/garden-service/src/plugins/conftest/conftest-kubernetes.ts @@ -7,6 +7,7 @@ */ import Bluebird from "bluebird" +import slash from "slash" import { createGardenPlugin } from "../../types/plugin/plugin" import { ConftestProvider } from "./conftest" import { relative, resolve } from "path" @@ -65,7 +66,8 @@ export const gardenPlugin = createGardenPlugin({ ? [".rendered.yaml"] : module.include || ["*.yaml", "**/*.yaml", "*.yml", "**/*.yml"] - const policyPath = relative(module.path, resolve(ctx.projectRoot, provider.config.policyPath)) + // Make sure the policy path is valid POSIX on Windows + const policyPath = slash(relative(module.path, resolve(ctx.projectRoot, provider.config.policyPath))) return { kind: "Module", diff --git a/garden-service/src/plugins/conftest/conftest.ts b/garden-service/src/plugins/conftest/conftest.ts index 4d89f12346..8186e5e58d 100644 --- a/garden-service/src/plugins/conftest/conftest.ts +++ b/garden-service/src/plugins/conftest/conftest.ts @@ -19,6 +19,7 @@ import { baseBuildSpecSchema } from "../../config/module" import { matchGlobs, listDirectory } from "../../util/fs" import { PluginError } from "../../exceptions" import { getModuleTypeUrl, getGitHubUrl, getProviderUrl } from "../../docs/common" +import slash from "slash" export interface ConftestProviderConfig extends ProviderConfig { policyPath: string @@ -135,7 +136,8 @@ export const gardenPlugin = createGardenPlugin({ const provider = ctx.provider as ConftestProvider const defaultPolicyPath = relative(module.path, resolve(ctx.projectRoot, provider.config.policyPath)) - const policyPath = resolve(module.path, module.spec.policyPath || defaultPolicyPath) + // Make sure the policy path is valid POSIX on Windows + const policyPath = slash(resolve(module.path, module.spec.policyPath || defaultPolicyPath)) const namespace = module.spec.namespace || provider.config.namespace const buildPath = module.spec.sourceModule