generated from pulumi/pulumi-provider-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a basic passthrough kubeadm resource (#113)
* Stub out all the files * Dead simple kubeadm component
- Loading branch information
1 parent
7ca583a
commit 4b77220
Showing
23 changed files
with
1,217 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package kubeadm | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/pulumi/pulumi-go-provider/infer" | ||
pb "github.com/unmango/pulumi-baremetal/gen/go/unmango/baremetal/v1alpha1" | ||
"github.com/unmango/pulumi-baremetal/provider/pkg/provider/cmd" | ||
) | ||
|
||
type KubeadmArgs struct { | ||
cmd.ArgsBase | ||
|
||
Commands []string `pulumi:"commands"` | ||
} | ||
|
||
func (a KubeadmArgs) Cmd() *pb.Command { | ||
return Builder(func(b *cmd.B) { | ||
for _, c := range a.Commands { | ||
b.Arg(c) | ||
} | ||
}) | ||
} | ||
|
||
type Kubeadm struct{} | ||
|
||
type KubeadmState = cmd.State[KubeadmArgs] | ||
|
||
// Create implements infer.CustomCreate. | ||
func (Kubeadm) Create(ctx context.Context, name string, inputs cmd.CommandArgs[KubeadmArgs], preview bool) (string, KubeadmState, error) { | ||
state := KubeadmState{} | ||
if err := state.Create(ctx, inputs, preview); err != nil { | ||
return name, state, fmt.Errorf("kubeadm: %w", err) | ||
} | ||
|
||
return name, state, nil | ||
} | ||
|
||
var _ = (infer.CustomCreate[cmd.CommandArgs[KubeadmArgs], KubeadmState])((*Kubeadm)(nil)) |
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,29 @@ | ||
// *** WARNING: this file was generated by pulumi. *** | ||
// *** Do not edit by hand unless you're certain you know what you are doing! *** | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.Immutable; | ||
using System.Threading.Tasks; | ||
using Pulumi.Serialization; | ||
using Pulumi; | ||
|
||
namespace UnMango.Baremetal.Kubeadm.Inputs | ||
{ | ||
|
||
public sealed class KubeadmArgsArgs : global::Pulumi.ResourceArgs | ||
{ | ||
[Input("commands", required: true)] | ||
private InputList<string>? _commands; | ||
public InputList<string> Commands | ||
{ | ||
get => _commands ?? (_commands = new InputList<string>()); | ||
set => _commands = value; | ||
} | ||
|
||
public KubeadmArgsArgs() | ||
{ | ||
} | ||
public static new KubeadmArgsArgs Empty => new KubeadmArgsArgs(); | ||
} | ||
} |
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,121 @@ | ||
// *** WARNING: this file was generated by pulumi. *** | ||
// *** Do not edit by hand unless you're certain you know what you are doing! *** | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.Immutable; | ||
using System.Threading.Tasks; | ||
using Pulumi.Serialization; | ||
using Pulumi; | ||
|
||
namespace UnMango.Baremetal.Kubeadm | ||
{ | ||
[BaremetalResourceType("baremetal:kubeadm:Kubeadm")] | ||
public partial class Kubeadm : global::Pulumi.CustomResource | ||
{ | ||
[Output("args")] | ||
public Output<Outputs.KubeadmArgs> Args { get; private set; } = null!; | ||
|
||
[Output("createdFiles")] | ||
public Output<ImmutableArray<string>> CreatedFiles { get; private set; } = null!; | ||
|
||
[Output("customDelete")] | ||
public Output<ImmutableArray<string>> CustomDelete { get; private set; } = null!; | ||
|
||
[Output("customUpdate")] | ||
public Output<ImmutableArray<string>> CustomUpdate { get; private set; } = null!; | ||
|
||
[Output("exitCode")] | ||
public Output<int> ExitCode { get; private set; } = null!; | ||
|
||
[Output("movedFiles")] | ||
public Output<ImmutableDictionary<string, string>> MovedFiles { get; private set; } = null!; | ||
|
||
[Output("stderr")] | ||
public Output<string> Stderr { get; private set; } = null!; | ||
|
||
[Output("stdout")] | ||
public Output<string> Stdout { get; private set; } = null!; | ||
|
||
[Output("triggers")] | ||
public Output<ImmutableArray<object>> Triggers { get; private set; } = null!; | ||
|
||
|
||
/// <summary> | ||
/// Create a Kubeadm resource with the given unique name, arguments, and options. | ||
/// </summary> | ||
/// | ||
/// <param name="name">The unique name of the resource</param> | ||
/// <param name="args">The arguments used to populate this resource's properties</param> | ||
/// <param name="options">A bag of options that control this resource's behavior</param> | ||
public Kubeadm(string name, KubeadmArgs args, CustomResourceOptions? options = null) | ||
: base("baremetal:kubeadm:Kubeadm", name, args ?? new KubeadmArgs(), MakeResourceOptions(options, "")) | ||
{ | ||
} | ||
|
||
private Kubeadm(string name, Input<string> id, CustomResourceOptions? options = null) | ||
: base("baremetal:kubeadm:Kubeadm", name, null, MakeResourceOptions(options, id)) | ||
{ | ||
} | ||
|
||
private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id) | ||
{ | ||
var defaultOptions = new CustomResourceOptions | ||
{ | ||
Version = Utilities.Version, | ||
PluginDownloadURL = "github://api.github.com/unmango", | ||
}; | ||
var merged = CustomResourceOptions.Merge(defaultOptions, options); | ||
// Override the ID if one was specified for consistency with other language SDKs. | ||
merged.Id = id ?? merged.Id; | ||
return merged; | ||
} | ||
/// <summary> | ||
/// Get an existing Kubeadm resource's state with the given name, ID, and optional extra | ||
/// properties used to qualify the lookup. | ||
/// </summary> | ||
/// | ||
/// <param name="name">The unique name of the resulting resource.</param> | ||
/// <param name="id">The unique provider ID of the resource to lookup.</param> | ||
/// <param name="options">A bag of options that control this resource's behavior</param> | ||
public static Kubeadm Get(string name, Input<string> id, CustomResourceOptions? options = null) | ||
{ | ||
return new Kubeadm(name, id, options); | ||
} | ||
} | ||
|
||
public sealed class KubeadmArgs : global::Pulumi.ResourceArgs | ||
{ | ||
[Input("args", required: true)] | ||
public Input<Inputs.KubeadmArgsArgs> Args { get; set; } = null!; | ||
|
||
[Input("customDelete")] | ||
private InputList<string>? _customDelete; | ||
public InputList<string> CustomDelete | ||
{ | ||
get => _customDelete ?? (_customDelete = new InputList<string>()); | ||
set => _customDelete = value; | ||
} | ||
|
||
[Input("customUpdate")] | ||
private InputList<string>? _customUpdate; | ||
public InputList<string> CustomUpdate | ||
{ | ||
get => _customUpdate ?? (_customUpdate = new InputList<string>()); | ||
set => _customUpdate = value; | ||
} | ||
|
||
[Input("triggers")] | ||
private InputList<object>? _triggers; | ||
public InputList<object> Triggers | ||
{ | ||
get => _triggers ?? (_triggers = new InputList<object>()); | ||
set => _triggers = value; | ||
} | ||
|
||
public KubeadmArgs() | ||
{ | ||
} | ||
public static new KubeadmArgs Empty => new KubeadmArgs(); | ||
} | ||
} |
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,25 @@ | ||
// *** WARNING: this file was generated by pulumi. *** | ||
// *** Do not edit by hand unless you're certain you know what you are doing! *** | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.Immutable; | ||
using System.Threading.Tasks; | ||
using Pulumi.Serialization; | ||
using Pulumi; | ||
|
||
namespace UnMango.Baremetal.Kubeadm.Outputs | ||
{ | ||
|
||
[OutputType] | ||
public sealed class KubeadmArgs | ||
{ | ||
public readonly ImmutableArray<string> Commands; | ||
|
||
[OutputConstructor] | ||
private KubeadmArgs(ImmutableArray<string> commands) | ||
{ | ||
Commands = commands; | ||
} | ||
} | ||
} |
Empty file.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.