Skip to content

Commit

Permalink
Also disambiguate the ConfigFile name
Browse files Browse the repository at this point in the history
  • Loading branch information
lblackstone committed Jun 17, 2019
1 parent ba92ddb commit f3b2809
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pkg/gen/nodejs-templates/yaml.ts.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ import * as outputApi from "../types/output";
config?: ConfigFileOpts,
opts?: pulumi.ComponentResourceOptions
) {
if (config && config.resourcePrefix !== undefined) {
name = `${config.resourcePrefix}-${name}`
}
super("kubernetes:yaml:ConfigFile", name, config, opts);
const fileId = config && config.file || name;
let text: Promise<string>;
Expand Down
2 changes: 2 additions & 0 deletions pkg/gen/python-templates/yaml.py.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class ConfigFile(pulumi.ComponentResource):

__props__ = dict()

if resource_prefix:
name = f"{resource_prefix}-{name}"
super(ConfigFile, self).__init__(
"kubernetes:yaml:ConfigFile",
name,
Expand Down
3 changes: 3 additions & 0 deletions sdk/nodejs/yaml/yaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2199,6 +2199,9 @@ import * as outputApi from "../types/output";
config?: ConfigFileOpts,
opts?: pulumi.ComponentResourceOptions
) {
if (config && config.resourcePrefix !== undefined) {
name = `${config.resourcePrefix}-${name}`
}
super("kubernetes:yaml:ConfigFile", name, config, opts);
const fileId = config && config.file || name;
let text: Promise<string>;
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/pulumi_kubernetes/yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ def __init__(

__props__ = dict()

if resource_prefix:
name = f"{resource_prefix}-{name}"
super(ConfigFile, self).__init__(
"kubernetes:yaml:ConfigFile",
name,
Expand Down
2 changes: 1 addition & 1 deletion tests/examples/python/yaml-test/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def secret_status(obj, opts):
transformations=[set_namespace(ns)],
)
cf_url2 = ConfigFile(
"guestbook2",
"guestbook",
file_id="https://raw.githubusercontent.com/pulumi/pulumi-kubernetes/master/tests/examples/yaml-guestbook/yaml"
"/guestbook.yaml",
transformations=[set_namespace(ns2)],
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/yaml-url/step1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ new k8s.yaml.ConfigFile("guestbook", {

// Create resources from standard Kubernetes guestbook YAML example in the second test namespace.
// Disambiguate resource names with a specified prefix.
new k8s.yaml.ConfigFile("guestbook2", {
new k8s.yaml.ConfigFile("guestbook", {
file: "https://raw.githubusercontent.com/pulumi/pulumi-kubernetes/master/tests/examples/yaml-guestbook/yaml/guestbook.yaml",
transformations: [
(obj: any) => {
Expand Down

0 comments on commit f3b2809

Please sign in to comment.