More renames
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
||||
|
||||
|
||||
import * as runtime from "@pulumi/pulumi/runtime";
|
||||
import * as pulumi from "@pulumi/pulumi";
|
||||
|
||||
export function getEnv(...vars: string[]): string | undefined {
|
||||
for (const v of vars) {
|
||||
const value = process.env[v];
|
||||
@@ -50,7 +53,7 @@ export function getVersion(): string {
|
||||
|
||||
/** @internal */
|
||||
export function resourceOptsDefaults(): any {
|
||||
return { version: getVersion() };
|
||||
return { version: getVersion(), pluginDownloadURL: "github.com/pulumi/pulumi-docker-native" };
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
@@ -64,3 +67,29 @@ export function lazyLoad(exports: any, props: string[], loadModule: any) {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export async function callAsync<T>(
|
||||
tok: string,
|
||||
props: pulumi.Inputs,
|
||||
res?: pulumi.Resource,
|
||||
opts?: {property?: string},
|
||||
): Promise<T> {
|
||||
const o: any = runtime.call<T>(tok, props, res);
|
||||
const value = await o.promise(true /*withUnknowns*/);
|
||||
const isKnown = await o.isKnown;
|
||||
const isSecret = await o.isSecret;
|
||||
const problem: string|undefined =
|
||||
!isKnown ? "an unknown value"
|
||||
: isSecret ? "a secret value"
|
||||
: undefined;
|
||||
// Ingoring o.resources silently. They are typically non-empty, r.f() calls include r as a dependency.
|
||||
if (problem) {
|
||||
throw new Error(`Plain resource method "${tok}" incorrectly returned ${problem}. ` +
|
||||
"This is an error in the provider, please report this to the provider developer.");
|
||||
}
|
||||
// Extract a single property if requested.
|
||||
if (opts && opts.property) {
|
||||
return value[opts.property];
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user