This repository has been archived by the owner on Sep 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #796 from bryanl/remove-component
Remove component in module with
- Loading branch information
Showing
14 changed files
with
166 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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,9 @@ | ||
local params = import '../../components/params.libsonnet'; | ||
|
||
params { | ||
components+: { | ||
"guestbook-ui"+: { | ||
name: 'guestbook-dev', | ||
}, | ||
}, | ||
} |
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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
local params = import '../../components/params.libsonnet'; | ||
|
||
params { | ||
components+: {}, | ||
components+: { | ||
"nested.guestbook-ui"+: { | ||
name: 'guestbook-dev', | ||
}, | ||
}, | ||
} |
29 changes: 29 additions & 0 deletions
29
pkg/component/testdata/delete/components/nested/guestbook-ui.jsonnet
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,29 @@ | ||
local env = std.extVar("__ksonnet/environments"); | ||
local params = std.extVar("__ksonnet/params").components["guestbook-ui"]; | ||
local k = import "k.libsonnet"; | ||
local deployment = k.apps.v1beta1.deployment; | ||
local container = k.apps.v1beta1.deployment.mixin.spec.template.spec.containersType; | ||
local containerPort = container.portsType; | ||
local service = k.core.v1.service; | ||
local servicePort = k.core.v1.service.mixin.spec.portsType; | ||
|
||
local targetPort = params.containerPort; | ||
local labels = {app: params.name}; | ||
|
||
local appService = service | ||
.new( | ||
params.name, | ||
labels, | ||
servicePort.new(params.servicePort, targetPort)) | ||
.withType(params.type); | ||
|
||
local appDeployment = deployment | ||
.new( | ||
params.name, | ||
params.replicas, | ||
container | ||
.new(params.name, params.image) | ||
.withPorts(containerPort.new(targetPort)), | ||
labels); | ||
|
||
k.core.v1.list.new([appService, appDeployment]) |
19 changes: 19 additions & 0 deletions
19
pkg/component/testdata/delete/components/nested/params.libsonnet
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,19 @@ | ||
{ | ||
global: { | ||
// User-defined global parameters; accessible to all component and environments, Ex: | ||
// replicas: 4, | ||
}, | ||
components: { | ||
// Component-level parameters, defined initially from 'ks prototype use ...' | ||
// Each object below should correspond to a component in the components/ directory | ||
"guestbook-ui": { | ||
containerPort: 80, | ||
image: "gcr.io/heptio-images/ks-guestbook-demo:0.1", | ||
name: "guiroot", | ||
replicas: 1, | ||
servicePort: 80, | ||
type: "ClusterIP", | ||
obj: {a: "b"}, | ||
}, | ||
}, | ||
} |
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 |
---|---|---|
|
@@ -4,5 +4,8 @@ params { | |
"guestbook-ui" +: { | ||
name: "guestbook-dev", | ||
}, | ||
"nested.guestbook-ui" +: { | ||
name: "guestbook-dev", | ||
}, | ||
}, | ||
} |
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