Forklift buildx provider

This commit is contained in:
Bryce Lampe
2024-03-25 11:40:33 -07:00
parent 2b348f84e4
commit d50d156bd8
349 changed files with 61549 additions and 1141 deletions

View File

@@ -14,6 +14,9 @@ import (
type Provider struct {
pulumi.ProviderResourceState
// The build daemon's address.
Host pulumi.StringPtrOutput `pulumi:"host"`
}
// NewProvider registers a new resource with the given unique name, arguments, and options.
@@ -23,6 +26,11 @@ func NewProvider(ctx *pulumi.Context,
args = &ProviderArgs{}
}
if args.Host == nil {
if d := internal.GetEnvOrDefault("", nil, "DOCKER_HOST"); d != nil {
args.Host = pulumi.StringPtr(d.(string))
}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Provider
err := ctx.RegisterResource("pulumi:providers:dockerbuild", name, args, &resource, opts...)
@@ -33,20 +41,51 @@ func NewProvider(ctx *pulumi.Context,
}
type providerArgs struct {
// The build daemon's address.
Host *string `pulumi:"host"`
Registries []Registry `pulumi:"registries"`
}
// The set of arguments for constructing a Provider resource.
type ProviderArgs struct {
// The build daemon's address.
Host pulumi.StringPtrInput
Registries RegistryArrayInput
}
func (ProviderArgs) ElementType() reflect.Type {
return reflect.TypeOf((*providerArgs)(nil)).Elem()
}
type ProviderInput interface {
pulumi.Input
ToProviderOutput() ProviderOutput
ToProviderOutputWithContext(ctx context.Context) ProviderOutput
}
func (*Provider) ElementType() reflect.Type {
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (i *Provider) ToProviderOutput() ProviderOutput {
return i.ToProviderOutputWithContext(context.Background())
}
func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProviderOutput)
}
func (i *Provider) ToOutput(ctx context.Context) pulumix.Output[*Provider] {
return pulumix.Output[*Provider]{
OutputState: i.ToProviderOutputWithContext(ctx).OutputState,
}
}
type ProviderOutput struct{ *pulumi.OutputState }
func (ProviderOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Provider)(nil)).Elem()
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (o ProviderOutput) ToProviderOutput() ProviderOutput {
@@ -57,12 +96,18 @@ func (o ProviderOutput) ToProviderOutputWithContext(ctx context.Context) Provide
return o
}
func (o ProviderOutput) ToOutput(ctx context.Context) pulumix.Output[Provider] {
return pulumix.Output[Provider]{
func (o ProviderOutput) ToOutput(ctx context.Context) pulumix.Output[*Provider] {
return pulumix.Output[*Provider]{
OutputState: o.OutputState,
}
}
// The build daemon's address.
func (o ProviderOutput) Host() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.Host }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ProviderInput)(nil)).Elem(), &Provider{})
pulumi.RegisterOutputType(ProviderOutput{})
}