-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change invoke call to always use latest version #987
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,16 +121,10 @@ import * as outputs from "../types/output"; | |
resourcePrefix?: string; | ||
} | ||
|
||
function yamlLoadAll(text: string, opts?: pulumi.CustomResourceOptions): Promise<any[]> { | ||
// Rather than using the default provider for the following invoke call, determine the | ||
// provider from the parent if specified, or fallback to using the version specified | ||
function yamlLoadAll(text: string): Promise<any[]> { | ||
// Rather than using the default provider for the following invoke call, use the version specified | ||
// in package.json. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment block seems outdated. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whoops, good catch. |
||
let invokeOpts: pulumi.InvokeOptions = {async: true}; | ||
if (opts?.parent) { | ||
invokeOpts = {...invokeOpts, parent: opts.parent}; | ||
} else { | ||
invokeOpts = {...invokeOpts, version: getVersion()}; | ||
} | ||
let invokeOpts: pulumi.InvokeOptions = { async: true, version: getVersion() }; | ||
|
||
return pulumi.runtime.invoke("kubernetes:yaml:decode", {text}, invokeOpts) | ||
.then((p => p.result)); | ||
|
@@ -183,7 +177,7 @@ import * as outputs from "../types/output"; | |
|
||
for (const text of yamlTexts) { | ||
const docResources = parseYamlDocument({ | ||
objs: yamlLoadAll(text, opts), | ||
objs: yamlLoadAll(text), | ||
transformations: config.transformations, | ||
resourcePrefix: config.resourcePrefix | ||
}, | ||
|
@@ -331,7 +325,7 @@ import * as outputs from "../types/output"; | |
this.resources = pulumi.output(text.then(t => { | ||
try { | ||
return parseYamlDocument({ | ||
objs: yamlLoadAll(t, opts), | ||
objs: yamlLoadAll(t), | ||
transformations: config && config.transformations || [], | ||
resourcePrefix: config && config.resourcePrefix || undefined | ||
}, {parent: this}) | ||
|
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still also need to pass through a parent so that it uses the right provider instance? Or does this invoke not actually care about the provider? Even if it doesn’t now, should we pass the parent through regardless?
I actually don’t know for sure - so maybe input from @pgavlin would be good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried passing both args, and it was failing the same way (invoke returning an empty object
{}
). That may be a bug with the engine, but I don't know enough about it to be sure.I think using the version makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pulumi/pulumi#3914
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the version makes the most sense here as well. This invoke does not need the particular provider instance (yet, at least).