-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mitchell Friedman
committed
Mar 23, 2020
1 parent
90980a6
commit 823a596
Showing
3 changed files
with
74 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
garden-service/test/integ/src/plugins/kubernetes/commands/pull-image.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (C) 2018-2020 Garden Technologies, Inc. <[email protected]> | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
import { pullFromInClusterRegistry } from "../../../../../../src/plugins/kubernetes/commands/pull-image" | ||
import { Garden } from "../../../../../../src/garden" | ||
import { ConfigGraph } from "../../../../../../src/config-graph" | ||
import { getContainerTestGarden } from "../container/container" | ||
import { k8sBuildContainer } from "../../../../../../src/plugins/kubernetes/container/build" | ||
import { PluginContext } from "../../../../../../src/plugin-context" | ||
import { KubernetesProvider, KubernetesPluginContext } from "../../../../../../src/plugins/kubernetes/config" | ||
import { Module } from "../../../../../../src/types/module" | ||
|
||
describe("pull-image plugin command", () => { | ||
let garden: Garden | ||
let graph: ConfigGraph | ||
let provider: KubernetesProvider | ||
let ctx: PluginContext | ||
|
||
after(async () => { | ||
if (garden) { | ||
await garden.close() | ||
} | ||
}) | ||
|
||
const init = async (environmentName: string) => { | ||
garden = await getContainerTestGarden(environmentName) | ||
graph = await garden.getConfigGraph(garden.log) | ||
provider = <KubernetesProvider>await garden.resolveProvider("local-kubernetes") | ||
ctx = garden.getPluginContext(provider) | ||
} | ||
|
||
context("using the in cluster registry", () => { | ||
let module: Module | ||
|
||
before(async () => { | ||
await init("cluster-docker") | ||
|
||
module = await graph.getModule("simple-service") | ||
// build the image | ||
await garden.buildDir.syncFromSrc(module, garden.log) | ||
|
||
await k8sBuildContainer({ | ||
ctx, | ||
log: garden.log, | ||
module, | ||
}) | ||
}) | ||
|
||
it("should pull the image", async () => { | ||
await pullFromInClusterRegistry(ctx as KubernetesPluginContext, module, garden.log) | ||
}) | ||
}) | ||
}) |