diff --git a/Makefile b/Makefile index dc96e26..7f1420f 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION := 1.0.7 +VERSION := 1.1.0 PACK := libp2p PROJECT := github.com/LuxChanLu/pulumi-${PACK} diff --git a/provider/pkg/version/version.go b/provider/pkg/version/version.go index c01b4a0..bfec75c 100644 --- a/provider/pkg/version/version.go +++ b/provider/pkg/version/version.go @@ -1,3 +1,3 @@ package version -var Version string = "1.0.7" +var Version string = "1.1.0" diff --git a/schema.yaml b/schema.yaml index f6d4855..c9b958e 100644 --- a/schema.yaml +++ b/schema.yaml @@ -1,6 +1,8 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/pulumi/pulumi/master/pkg/codegen/schema/pulumi.json --- name: libp2p +pluginDownloadUrl: github://api.github.com/LuxChanLu + types: libp2p:index:KeyType: type: string diff --git a/sdk/dotnet/Key.cs b/sdk/dotnet/Key.cs index 85b7caf..1aa1104 100644 --- a/sdk/dotnet/Key.cs +++ b/sdk/dotnet/Key.cs @@ -48,6 +48,7 @@ private static ComponentResourceOptions MakeResourceOptions(ComponentResourceOpt var defaultOptions = new ComponentResourceOptions { Version = Utilities.Version, + PluginDownloadURL = "github://api.github.com/LuxChanLu", AdditionalSecretOutputs = { "private", diff --git a/sdk/dotnet/Provider.cs b/sdk/dotnet/Provider.cs index 7b202de..9b3b531 100644 --- a/sdk/dotnet/Provider.cs +++ b/sdk/dotnet/Provider.cs @@ -29,6 +29,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? var defaultOptions = new CustomResourceOptions { Version = Utilities.Version, + PluginDownloadURL = "github://api.github.com/LuxChanLu", }; var merged = CustomResourceOptions.Merge(defaultOptions, options); // Override the ID if one was specified for consistency with other language SDKs. diff --git a/sdk/dotnet/Utilities.cs b/sdk/dotnet/Utilities.cs index 5331ac1..a47f744 100644 --- a/sdk/dotnet/Utilities.cs +++ b/sdk/dotnet/Utilities.cs @@ -53,6 +53,7 @@ static class Utilities { var dst = src ?? new global::Pulumi.InvokeOptions{}; dst.Version = src?.Version ?? Version; + dst.PluginDownloadURL = src?.PluginDownloadURL ?? "github://api.github.com/LuxChanLu"; return dst; } diff --git a/sdk/dotnet/pulumi-plugin.json b/sdk/dotnet/pulumi-plugin.json index 0c9a4b0..d83d084 100644 --- a/sdk/dotnet/pulumi-plugin.json +++ b/sdk/dotnet/pulumi-plugin.json @@ -1,4 +1,5 @@ { "resource": true, - "name": "libp2p" + "name": "libp2p", + "server": "github://api.github.com/LuxChanLu" } diff --git a/sdk/go/libp2p/key.go b/sdk/go/libp2p/key.go index 671662d..5daea50 100644 --- a/sdk/go/libp2p/key.go +++ b/sdk/go/libp2p/key.go @@ -36,6 +36,7 @@ func NewKey(ctx *pulumi.Context, "private", }) opts = append(opts, secrets) + opts = pkgResourceDefaultOpts(opts) var resource Key err := ctx.RegisterRemoteComponentResource("libp2p:index:Key", name, args, &resource, opts...) if err != nil { diff --git a/sdk/go/libp2p/provider.go b/sdk/go/libp2p/provider.go index ab517a7..de293ac 100644 --- a/sdk/go/libp2p/provider.go +++ b/sdk/go/libp2p/provider.go @@ -21,6 +21,7 @@ func NewProvider(ctx *pulumi.Context, args = &ProviderArgs{} } + opts = pkgResourceDefaultOpts(opts) var resource Provider err := ctx.RegisterResource("pulumi:providers:libp2p", name, args, &resource, opts...) if err != nil { diff --git a/sdk/go/libp2p/pulumi-plugin.json b/sdk/go/libp2p/pulumi-plugin.json index 0c9a4b0..d83d084 100644 --- a/sdk/go/libp2p/pulumi-plugin.json +++ b/sdk/go/libp2p/pulumi-plugin.json @@ -1,4 +1,5 @@ { "resource": true, - "name": "libp2p" + "name": "libp2p", + "server": "github://api.github.com/LuxChanLu" } diff --git a/sdk/go/libp2p/pulumiUtilities.go b/sdk/go/libp2p/pulumiUtilities.go index 58e330f..bab0286 100644 --- a/sdk/go/libp2p/pulumiUtilities.go +++ b/sdk/go/libp2p/pulumiUtilities.go @@ -85,3 +85,17 @@ func isZero(v interface{}) bool { } return reflect.ValueOf(v).IsZero() } + +// pkgResourceDefaultOpts provides package level defaults to pulumi.OptionResource. +func pkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOption { + defaults := []pulumi.ResourceOption{pulumi.PluginDownloadURL("github://api.github.com/LuxChanLu")} + + return append(defaults, opts...) +} + +// pkgInvokeDefaultOpts provides package level defaults to pulumi.OptionInvoke. +func pkgInvokeDefaultOpts(opts []pulumi.InvokeOption) []pulumi.InvokeOption { + defaults := []pulumi.InvokeOption{pulumi.PluginDownloadURL("github://api.github.com/LuxChanLu")} + + return append(defaults, opts...) +} diff --git a/sdk/nodejs/package.json b/sdk/nodejs/package.json index c5f8341..66a0904 100644 --- a/sdk/nodejs/package.json +++ b/sdk/nodejs/package.json @@ -12,6 +12,7 @@ "typescript": "^3.7.0" }, "pulumi": { - "resource": true + "resource": true, + "pluginDownloadURL": "github://api.github.com/LuxChanLu" } } diff --git a/sdk/nodejs/utilities.ts b/sdk/nodejs/utilities.ts index 5df64c4..ec87f34 100644 --- a/sdk/nodejs/utilities.ts +++ b/sdk/nodejs/utilities.ts @@ -50,5 +50,5 @@ export function getVersion(): string { /** @internal */ export function resourceOptsDefaults(): any { - return { version: getVersion() }; + return { version: getVersion(), pluginDownloadURL: "github://api.github.com/LuxChanLu" }; } diff --git a/sdk/python/pulumi_libp2p/_utilities.py b/sdk/python/pulumi_libp2p/_utilities.py index b12d50f..e7d7076 100644 --- a/sdk/python/pulumi_libp2p/_utilities.py +++ b/sdk/python/pulumi_libp2p/_utilities.py @@ -234,3 +234,6 @@ def lifted_func(*args, opts=None, **kwargs): **resolved_args['kwargs'])) return (lambda _: lifted_func) + +def get_plugin_download_url(): + return "github://api.github.com/LuxChanLu" diff --git a/sdk/python/pulumi_libp2p/key.py b/sdk/python/pulumi_libp2p/key.py index 83c1ccd..181de1f 100644 --- a/sdk/python/pulumi_libp2p/key.py +++ b/sdk/python/pulumi_libp2p/key.py @@ -97,6 +97,8 @@ def _internal_init(__self__, raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() if opts.id is not None: raise ValueError('ComponentResource classes do not support opts.id') else: diff --git a/sdk/python/pulumi_libp2p/provider.py b/sdk/python/pulumi_libp2p/provider.py index 98458f3..fdd888f 100644 --- a/sdk/python/pulumi_libp2p/provider.py +++ b/sdk/python/pulumi_libp2p/provider.py @@ -60,6 +60,8 @@ def _internal_init(__self__, raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_libp2p/pulumi-plugin.json b/sdk/python/pulumi_libp2p/pulumi-plugin.json index 0c9a4b0..d83d084 100644 --- a/sdk/python/pulumi_libp2p/pulumi-plugin.json +++ b/sdk/python/pulumi_libp2p/pulumi-plugin.json @@ -1,4 +1,5 @@ { "resource": true, - "name": "libp2p" + "name": "libp2p", + "server": "github://api.github.com/LuxChanLu" } diff --git a/sdk/python/setup.py b/sdk/python/setup.py index 8d611bd..eb06a82 100644 --- a/sdk/python/setup.py +++ b/sdk/python/setup.py @@ -15,7 +15,7 @@ class InstallPluginCommand(install): def run(self): install.run(self) try: - check_call(['pulumi', 'plugin', 'install', 'resource', 'libp2p', PLUGIN_VERSION]) + check_call(['pulumi', 'plugin', 'install', 'resource', 'libp2p', PLUGIN_VERSION, '--server', 'github://api.github.com/LuxChanLu']) except OSError as error: if error.errno == errno.ENOENT: print(f"""