Make push a required param

This commit is contained in:
Bryce Lampe
2024-04-25 09:25:50 -07:00
parent 5175dbeb3f
commit f8796f9095
10 changed files with 91 additions and 67 deletions

File diff suppressed because one or more lines are too long

View File

@@ -99,7 +99,7 @@ type ImageArgs struct {
NoCache bool `pulumi:"noCache,optional"` NoCache bool `pulumi:"noCache,optional"`
Platforms []Platform `pulumi:"platforms,optional"` Platforms []Platform `pulumi:"platforms,optional"`
Pull bool `pulumi:"pull,optional"` Pull bool `pulumi:"pull,optional"`
Push bool `pulumi:"push,optional"` Push bool `pulumi:"push"`
Registries []Registry `pulumi:"registries,optional"` Registries []Registry `pulumi:"registries,optional"`
Secrets map[string]string `pulumi:"secrets,optional"` Secrets map[string]string `pulumi:"secrets,optional"`
SSH []SSH `pulumi:"ssh,optional"` SSH []SSH `pulumi:"ssh,optional"`
@@ -907,11 +907,9 @@ func (*Image) Diff(
if !reflect.DeepEqual(olds.Context.Named, news.Context.Named) { if !reflect.DeepEqual(olds.Context.Named, news.Context.Named) {
diff["context.named"] = update diff["context.named"] = update
} }
if olds.Dockerfile.Location != news.Dockerfile.Location { dockerfile, _, _ := news.Context.validate(true, news.Dockerfile)
diff["dockerfile.location"] = update if !reflect.DeepEqual(olds.Dockerfile, dockerfile) {
} diff["dockerfile"] = update
if olds.Dockerfile.Inline != news.Dockerfile.Inline {
diff["dockerfile.inline"] = update
} }
// Use string comparison to ignore any manifests attached to the export. // Use string comparison to ignore any manifests attached to the export.
if fmt.Sprint(olds.Exports) != fmt.Sprint(news.Exports) { if fmt.Sprint(olds.Exports) != fmt.Sprint(news.Exports) {
@@ -932,10 +930,10 @@ func (*Image) Diff(
if !reflect.DeepEqual(olds.Platforms, news.Platforms) { if !reflect.DeepEqual(olds.Platforms, news.Platforms) {
diff["platforms"] = update diff["platforms"] = update
} }
if olds.Pull != news.Pull { if !reflect.DeepEqual(olds.Pull, news.Pull) {
diff["pull"] = update diff["pull"] = update
} }
if olds.Push != news.Push { if !reflect.DeepEqual(olds.Push, news.Push) {
diff["push"] = update diff["push"] = update
} }
if !reflect.DeepEqual(olds.Secrets, news.Secrets) { if !reflect.DeepEqual(olds.Secrets, news.Secrets) {
@@ -960,7 +958,7 @@ func (*Image) Diff(
// Check if anything has changed in our build context. // Check if anything has changed in our build context.
hash, err := hashBuildContext( hash, err := hashBuildContext(
news.Context.Location, news.Context.Location,
news.Dockerfile.Location, dockerfile.Location,
news.Context.Named.Map(), news.Context.Named.Map(),
) )
if err != nil { if err != nil {

View File

@@ -82,6 +82,7 @@ func TestImageLifecycle(t *testing.T) {
op: func(t *testing.T) integration.Operation { op: func(t *testing.T) integration.Operation {
return integration.Operation{ return integration.Operation{
Inputs: resource.PropertyMap{ Inputs: resource.PropertyMap{
"push": resource.NewBoolProperty(false),
"tags": resource.NewArrayProperty( "tags": resource.NewArrayProperty(
[]resource.PropertyValue{ []resource.PropertyValue{
resource.NewStringProperty("docker.io/pulumibot/buildkit-e2e"), resource.NewStringProperty("docker.io/pulumibot/buildkit-e2e"),
@@ -129,6 +130,7 @@ func TestImageLifecycle(t *testing.T) {
op: func(t *testing.T) integration.Operation { op: func(t *testing.T) integration.Operation {
return integration.Operation{ return integration.Operation{
Inputs: resource.PropertyMap{ Inputs: resource.PropertyMap{
"push": resource.NewBoolProperty(false),
"tags": resource.NewArrayProperty([]resource.PropertyValue{}), "tags": resource.NewArrayProperty([]resource.PropertyValue{}),
"context": resource.NewObjectProperty(resource.PropertyMap{ "context": resource.NewObjectProperty(resource.PropertyMap{
"location": resource.NewStringProperty("testdata/noop"), "location": resource.NewStringProperty("testdata/noop"),
@@ -157,6 +159,7 @@ func TestImageLifecycle(t *testing.T) {
op: func(t *testing.T) integration.Operation { op: func(t *testing.T) integration.Operation {
return integration.Operation{ return integration.Operation{
Inputs: resource.PropertyMap{ Inputs: resource.PropertyMap{
"push": resource.NewBoolProperty(false),
"tags": resource.NewArrayProperty( "tags": resource.NewArrayProperty(
[]resource.PropertyValue{resource.NewStringProperty("invalid-exports")}, []resource.PropertyValue{resource.NewStringProperty("invalid-exports")},
), ),
@@ -189,6 +192,7 @@ func TestImageLifecycle(t *testing.T) {
op: func(t *testing.T) integration.Operation { op: func(t *testing.T) integration.Operation {
return integration.Operation{ return integration.Operation{
Inputs: resource.PropertyMap{ Inputs: resource.PropertyMap{
"push": resource.NewBoolProperty(false),
"tags": resource.NewArrayProperty( "tags": resource.NewArrayProperty(
[]resource.PropertyValue{resource.NewStringProperty("foo")}, []resource.PropertyValue{resource.NewStringProperty("foo")},
), ),
@@ -215,6 +219,7 @@ func TestImageLifecycle(t *testing.T) {
op: func(t *testing.T) integration.Operation { op: func(t *testing.T) integration.Operation {
return integration.Operation{ return integration.Operation{
Inputs: resource.PropertyMap{ Inputs: resource.PropertyMap{
"push": resource.NewBoolProperty(false),
"tags": resource.NewArrayProperty( "tags": resource.NewArrayProperty(
[]resource.PropertyValue{resource.NewStringProperty("foo")}, []resource.PropertyValue{resource.NewStringProperty("foo")},
), ),
@@ -246,6 +251,7 @@ func TestImageLifecycle(t *testing.T) {
op: func(t *testing.T) integration.Operation { op: func(t *testing.T) integration.Operation {
return integration.Operation{ return integration.Operation{
Inputs: resource.PropertyMap{ Inputs: resource.PropertyMap{
"push": resource.NewBoolProperty(false),
"tags": resource.NewArrayProperty( "tags": resource.NewArrayProperty(
[]resource.PropertyValue{ []resource.PropertyValue{
resource.NewStringProperty("default-dockerfile"), resource.NewStringProperty("default-dockerfile"),

8
sdk/dotnet/Image.cs generated
View File

@@ -681,7 +681,7 @@ namespace Pulumi.DockerBuild
/// Equivalent to Docker's `--push` flag. /// Equivalent to Docker's `--push` flag.
/// </summary> /// </summary>
[Output("push")] [Output("push")]
public Output<bool?> Push { get; private set; } = null!; public Output<bool> Push { get; private set; } = null!;
/// <summary> /// <summary>
/// If the image was pushed to any registries then this will contain a /// If the image was pushed to any registries then this will contain a
@@ -765,7 +765,7 @@ namespace Pulumi.DockerBuild
/// <param name="name">The unique name of the resource</param> /// <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="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> /// <param name="options">A bag of options that control this resource's behavior</param>
public Image(string name, ImageArgs? args = null, CustomResourceOptions? options = null) public Image(string name, ImageArgs args, CustomResourceOptions? options = null)
: base("docker-build:index:Image", name, args ?? new ImageArgs(), MakeResourceOptions(options, "")) : base("docker-build:index:Image", name, args ?? new ImageArgs(), MakeResourceOptions(options, ""))
{ {
} }
@@ -1018,8 +1018,8 @@ namespace Pulumi.DockerBuild
/// ///
/// Equivalent to Docker's `--push` flag. /// Equivalent to Docker's `--push` flag.
/// </summary> /// </summary>
[Input("push")] [Input("push", required: true)]
public Input<bool>? Push { get; set; } public Input<bool> Push { get; set; } = null!;
[Input("registries")] [Input("registries")]
private InputList<Inputs.RegistryArgs>? _registries; private InputList<Inputs.RegistryArgs>? _registries;

View File

@@ -7,6 +7,7 @@ import (
"context" "context"
"reflect" "reflect"
"errors"
"github.com/pulumi/pulumi-docker-build/sdk/go/dockerbuild/internal" "github.com/pulumi/pulumi-docker-build/sdk/go/dockerbuild/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi" "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumix" "github.com/pulumi/pulumi/sdk/v3/go/pulumix"
@@ -655,7 +656,7 @@ type Image struct {
// Defaults to `false`. // Defaults to `false`.
// //
// Equivalent to Docker's `--push` flag. // Equivalent to Docker's `--push` flag.
Push pulumi.BoolPtrOutput `pulumi:"push"` Push pulumi.BoolOutput `pulumi:"push"`
// If the image was pushed to any registries then this will contain a // If the image was pushed to any registries then this will contain a
// single fully-qualified tag including the build's digest. // single fully-qualified tag including the build's digest.
// //
@@ -712,9 +713,12 @@ type Image struct {
func NewImage(ctx *pulumi.Context, func NewImage(ctx *pulumi.Context,
name string, args *ImageArgs, opts ...pulumi.ResourceOption) (*Image, error) { name string, args *ImageArgs, opts ...pulumi.ResourceOption) (*Image, error) {
if args == nil { if args == nil {
args = &ImageArgs{} return nil, errors.New("missing one or more required arguments")
} }
if args.Push == nil {
return nil, errors.New("invalid value for required argument 'Push'")
}
if args.BuildOnPreview == nil { if args.BuildOnPreview == nil {
args.BuildOnPreview = pulumi.BoolPtr(true) args.BuildOnPreview = pulumi.BoolPtr(true)
} }
@@ -862,7 +866,7 @@ type imageArgs struct {
// Defaults to `false`. // Defaults to `false`.
// //
// Equivalent to Docker's `--push` flag. // Equivalent to Docker's `--push` flag.
Push *bool `pulumi:"push"` Push bool `pulumi:"push"`
// Registry credentials. Required if reading or exporting to private // Registry credentials. Required if reading or exporting to private
// repositories. // repositories.
// //
@@ -1010,7 +1014,7 @@ type ImageArgs struct {
// Defaults to `false`. // Defaults to `false`.
// //
// Equivalent to Docker's `--push` flag. // Equivalent to Docker's `--push` flag.
Push pulumi.BoolPtrInput Push pulumi.BoolInput
// Registry credentials. Required if reading or exporting to private // Registry credentials. Required if reading or exporting to private
// repositories. // repositories.
// //
@@ -1271,8 +1275,8 @@ func (o ImageOutput) Pull() pulumi.BoolPtrOutput {
// Defaults to `false`. // Defaults to `false`.
// //
// Equivalent to Docker's `--push` flag. // Equivalent to Docker's `--push` flag.
func (o ImageOutput) Push() pulumi.BoolPtrOutput { func (o ImageOutput) Push() pulumi.BoolOutput {
return o.ApplyT(func(v *Image) pulumi.BoolPtrOutput { return v.Push }).(pulumi.BoolPtrOutput) return o.ApplyT(func(v *Image) pulumi.BoolOutput { return v.Push }).(pulumi.BoolOutput)
} }
// If the image was pushed to any registries then this will contain a // If the image was pushed to any registries then this will contain a

View File

@@ -7,6 +7,7 @@ import (
"context" "context"
"reflect" "reflect"
"errors"
"github.com/pulumi/pulumi-docker-build/sdk/go/dockerbuild/internal" "github.com/pulumi/pulumi-docker-build/sdk/go/dockerbuild/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi" "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumix" "github.com/pulumi/pulumi/sdk/v3/go/pulumix"
@@ -655,7 +656,7 @@ type Image struct {
// Defaults to `false`. // Defaults to `false`.
// //
// Equivalent to Docker's `--push` flag. // Equivalent to Docker's `--push` flag.
Push pulumix.Output[*bool] `pulumi:"push"` Push pulumix.Output[bool] `pulumi:"push"`
// If the image was pushed to any registries then this will contain a // If the image was pushed to any registries then this will contain a
// single fully-qualified tag including the build's digest. // single fully-qualified tag including the build's digest.
// //
@@ -712,9 +713,12 @@ type Image struct {
func NewImage(ctx *pulumi.Context, func NewImage(ctx *pulumi.Context,
name string, args *ImageArgs, opts ...pulumi.ResourceOption) (*Image, error) { name string, args *ImageArgs, opts ...pulumi.ResourceOption) (*Image, error) {
if args == nil { if args == nil {
args = &ImageArgs{} return nil, errors.New("missing one or more required arguments")
} }
if args.Push == nil {
return nil, errors.New("invalid value for required argument 'Push'")
}
if args.BuildOnPreview == nil { if args.BuildOnPreview == nil {
args.BuildOnPreview = pulumix.Ptr(true) args.BuildOnPreview = pulumix.Ptr(true)
} }
@@ -862,7 +866,7 @@ type imageArgs struct {
// Defaults to `false`. // Defaults to `false`.
// //
// Equivalent to Docker's `--push` flag. // Equivalent to Docker's `--push` flag.
Push *bool `pulumi:"push"` Push bool `pulumi:"push"`
// Registry credentials. Required if reading or exporting to private // Registry credentials. Required if reading or exporting to private
// repositories. // repositories.
// //
@@ -1010,7 +1014,7 @@ type ImageArgs struct {
// Defaults to `false`. // Defaults to `false`.
// //
// Equivalent to Docker's `--push` flag. // Equivalent to Docker's `--push` flag.
Push pulumix.Input[*bool] Push pulumix.Input[bool]
// Registry credentials. Required if reading or exporting to private // Registry credentials. Required if reading or exporting to private
// repositories. // repositories.
// //
@@ -1274,9 +1278,9 @@ func (o ImageOutput) Pull() pulumix.Output[*bool] {
// Defaults to `false`. // Defaults to `false`.
// //
// Equivalent to Docker's `--push` flag. // Equivalent to Docker's `--push` flag.
func (o ImageOutput) Push() pulumix.Output[*bool] { func (o ImageOutput) Push() pulumix.Output[bool] {
value := pulumix.Apply[Image](o, func(v Image) pulumix.Output[*bool] { return v.Push }) value := pulumix.Apply[Image](o, func(v Image) pulumix.Output[bool] { return v.Push })
return pulumix.Flatten[*bool, pulumix.Output[*bool]](value) return pulumix.Flatten[bool, pulumix.Output[bool]](value)
} }
// If the image was pushed to any registries then this will contain a // If the image was pushed to any registries then this will contain a

View File

@@ -1023,7 +1023,7 @@ public class Image extends com.pulumi.resources.CustomResource {
* *
*/ */
@Export(name="push", refs={Boolean.class}, tree="[0]") @Export(name="push", refs={Boolean.class}, tree="[0]")
private Output</* @Nullable */ Boolean> push; private Output<Boolean> push;
/** /**
* @return When `true` the build will automatically include a `registry` export. * @return When `true` the build will automatically include a `registry` export.
@@ -1033,8 +1033,8 @@ public class Image extends com.pulumi.resources.CustomResource {
* Equivalent to Docker&#39;s `--push` flag. * Equivalent to Docker&#39;s `--push` flag.
* *
*/ */
public Output<Optional<Boolean>> push() { public Output<Boolean> push() {
return Codegen.optional(this.push); return this.push;
} }
/** /**
* If the image was pushed to any registries then this will contain a * If the image was pushed to any registries then this will contain a
@@ -1209,7 +1209,7 @@ public class Image extends com.pulumi.resources.CustomResource {
* @param name The _unique_ name of the resulting resource. * @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties. * @param args The arguments to use to populate this resource's properties.
*/ */
public Image(String name, @Nullable ImageArgs args) { public Image(String name, ImageArgs args) {
this(name, args, null); this(name, args, null);
} }
/** /**
@@ -1218,7 +1218,7 @@ public class Image extends com.pulumi.resources.CustomResource {
* @param args The arguments to use to populate this resource's properties. * @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior. * @param options A bag of options that control this resource's behavior.
*/ */
public Image(String name, @Nullable ImageArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { public Image(String name, ImageArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("docker-build:index:Image", name, args == null ? ImageArgs.Empty : args, makeResourceOptions(options, Codegen.empty())); super("docker-build:index:Image", name, args == null ? ImageArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
} }

View File

@@ -16,6 +16,7 @@ import com.pulumi.dockerbuild.inputs.DockerfileArgs;
import com.pulumi.dockerbuild.inputs.ExportArgs; import com.pulumi.dockerbuild.inputs.ExportArgs;
import com.pulumi.dockerbuild.inputs.RegistryArgs; import com.pulumi.dockerbuild.inputs.RegistryArgs;
import com.pulumi.dockerbuild.inputs.SSHArgs; import com.pulumi.dockerbuild.inputs.SSHArgs;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean; import java.lang.Boolean;
import java.lang.String; import java.lang.String;
import java.util.List; import java.util.List;
@@ -419,8 +420,8 @@ public final class ImageArgs extends com.pulumi.resources.ResourceArgs {
* Equivalent to Docker&#39;s `--push` flag. * Equivalent to Docker&#39;s `--push` flag.
* *
*/ */
@Import(name="push") @Import(name="push", required=true)
private @Nullable Output<Boolean> push; private Output<Boolean> push;
/** /**
* @return When `true` the build will automatically include a `registry` export. * @return When `true` the build will automatically include a `registry` export.
@@ -430,8 +431,8 @@ public final class ImageArgs extends com.pulumi.resources.ResourceArgs {
* Equivalent to Docker&#39;s `--push` flag. * Equivalent to Docker&#39;s `--push` flag.
* *
*/ */
public Optional<Output<Boolean>> push() { public Output<Boolean> push() {
return Optional.ofNullable(this.push); return this.push;
} }
/** /**
@@ -1158,7 +1159,7 @@ public final class ImageArgs extends com.pulumi.resources.ResourceArgs {
* @return builder * @return builder
* *
*/ */
public Builder push(@Nullable Output<Boolean> push) { public Builder push(Output<Boolean> push) {
$.push = push; $.push = push;
return this; return this;
} }
@@ -1378,6 +1379,9 @@ public final class ImageArgs extends com.pulumi.resources.ResourceArgs {
public ImageArgs build() { public ImageArgs build() {
$.buildOnPreview = Codegen.booleanProp("buildOnPreview").output().arg($.buildOnPreview).def(true).getNullable(); $.buildOnPreview = Codegen.booleanProp("buildOnPreview").output().arg($.buildOnPreview).def(true).getNullable();
$.network = Codegen.objectProp("network", NetworkMode.class).output().arg($.network).def(NetworkMode.Default_).getNullable(); $.network = Codegen.objectProp("network", NetworkMode.class).output().arg($.network).def(NetworkMode.Default_).getNullable();
if ($.push == null) {
throw new MissingRequiredPropertyException("ImageArgs", "push");
}
return $; return $;
} }
} }

9
sdk/nodejs/image.ts generated
View File

@@ -640,7 +640,7 @@ export class Image extends pulumi.CustomResource {
* *
* Equivalent to Docker's `--push` flag. * Equivalent to Docker's `--push` flag.
*/ */
public readonly push!: pulumi.Output<boolean | undefined>; public readonly push!: pulumi.Output<boolean>;
/** /**
* If the image was pushed to any registries then this will contain a * If the image was pushed to any registries then this will contain a
* single fully-qualified tag including the build's digest. * single fully-qualified tag including the build's digest.
@@ -711,10 +711,13 @@ export class Image extends pulumi.CustomResource {
* @param args The arguments to use to populate this resource's properties. * @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior. * @param opts A bag of options that control this resource's behavior.
*/ */
constructor(name: string, args?: ImageArgs, opts?: pulumi.CustomResourceOptions) { constructor(name: string, args: ImageArgs, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {}; let resourceInputs: pulumi.Inputs = {};
opts = opts || {}; opts = opts || {};
if (!opts.id) { if (!opts.id) {
if ((!args || args.push === undefined) && !opts.urn) {
throw new Error("Missing required property 'push'");
}
resourceInputs["addHosts"] = args ? args.addHosts : undefined; resourceInputs["addHosts"] = args ? args.addHosts : undefined;
resourceInputs["buildArgs"] = args ? args.buildArgs : undefined; resourceInputs["buildArgs"] = args ? args.buildArgs : undefined;
resourceInputs["buildOnPreview"] = (args ? args.buildOnPreview : undefined) ?? true; resourceInputs["buildOnPreview"] = (args ? args.buildOnPreview : undefined) ?? true;
@@ -918,7 +921,7 @@ export interface ImageArgs {
* *
* Equivalent to Docker's `--push` flag. * Equivalent to Docker's `--push` flag.
*/ */
push?: pulumi.Input<boolean>; push: pulumi.Input<boolean>;
/** /**
* Registry credentials. Required if reading or exporting to private * Registry credentials. Required if reading or exporting to private
* repositories. * repositories.

View File

@@ -17,6 +17,7 @@ __all__ = ['ImageArgs', 'Image']
@pulumi.input_type @pulumi.input_type
class ImageArgs: class ImageArgs:
def __init__(__self__, *, def __init__(__self__, *,
push: pulumi.Input[bool],
add_hosts: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, add_hosts: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
build_args: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, build_args: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
build_on_preview: Optional[pulumi.Input[bool]] = None, build_on_preview: Optional[pulumi.Input[bool]] = None,
@@ -33,7 +34,6 @@ class ImageArgs:
no_cache: Optional[pulumi.Input[bool]] = None, no_cache: Optional[pulumi.Input[bool]] = None,
platforms: Optional[pulumi.Input[Sequence[pulumi.Input['Platform']]]] = None, platforms: Optional[pulumi.Input[Sequence[pulumi.Input['Platform']]]] = None,
pull: Optional[pulumi.Input[bool]] = None, pull: Optional[pulumi.Input[bool]] = None,
push: Optional[pulumi.Input[bool]] = None,
registries: Optional[pulumi.Input[Sequence[pulumi.Input['RegistryArgs']]]] = None, registries: Optional[pulumi.Input[Sequence[pulumi.Input['RegistryArgs']]]] = None,
secrets: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, secrets: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
ssh: Optional[pulumi.Input[Sequence[pulumi.Input['SSHArgs']]]] = None, ssh: Optional[pulumi.Input[Sequence[pulumi.Input['SSHArgs']]]] = None,
@@ -41,6 +41,11 @@ class ImageArgs:
target: Optional[pulumi.Input[str]] = None): target: Optional[pulumi.Input[str]] = None):
""" """
The set of arguments for constructing a Image resource. The set of arguments for constructing a Image resource.
:param pulumi.Input[bool] push: When `true` the build will automatically include a `registry` export.
Defaults to `false`.
Equivalent to Docker's `--push` flag.
:param pulumi.Input[Sequence[pulumi.Input[str]]] add_hosts: Custom `host:ip` mappings to use during the build. :param pulumi.Input[Sequence[pulumi.Input[str]]] add_hosts: Custom `host:ip` mappings to use during the build.
Equivalent to Docker's `--add-host` flag. Equivalent to Docker's `--add-host` flag.
@@ -128,11 +133,6 @@ class ImageArgs:
:param pulumi.Input[bool] pull: Always pull referenced images. :param pulumi.Input[bool] pull: Always pull referenced images.
Equivalent to Docker's `--pull` flag. Equivalent to Docker's `--pull` flag.
:param pulumi.Input[bool] push: When `true` the build will automatically include a `registry` export.
Defaults to `false`.
Equivalent to Docker's `--push` flag.
:param pulumi.Input[Sequence[pulumi.Input['RegistryArgs']]] registries: Registry credentials. Required if reading or exporting to private :param pulumi.Input[Sequence[pulumi.Input['RegistryArgs']]] registries: Registry credentials. Required if reading or exporting to private
repositories. repositories.
@@ -164,6 +164,7 @@ class ImageArgs:
Equivalent to Docker's `--target` flag. Equivalent to Docker's `--target` flag.
""" """
pulumi.set(__self__, "push", push)
if add_hosts is not None: if add_hosts is not None:
pulumi.set(__self__, "add_hosts", add_hosts) pulumi.set(__self__, "add_hosts", add_hosts)
if build_args is not None: if build_args is not None:
@@ -200,8 +201,6 @@ class ImageArgs:
pulumi.set(__self__, "platforms", platforms) pulumi.set(__self__, "platforms", platforms)
if pull is not None: if pull is not None:
pulumi.set(__self__, "pull", pull) pulumi.set(__self__, "pull", pull)
if push is not None:
pulumi.set(__self__, "push", push)
if registries is not None: if registries is not None:
pulumi.set(__self__, "registries", registries) pulumi.set(__self__, "registries", registries)
if secrets is not None: if secrets is not None:
@@ -213,6 +212,22 @@ class ImageArgs:
if target is not None: if target is not None:
pulumi.set(__self__, "target", target) pulumi.set(__self__, "target", target)
@property
@pulumi.getter
def push(self) -> pulumi.Input[bool]:
"""
When `true` the build will automatically include a `registry` export.
Defaults to `false`.
Equivalent to Docker's `--push` flag.
"""
return pulumi.get(self, "push")
@push.setter
def push(self, value: pulumi.Input[bool]):
pulumi.set(self, "push", value)
@property @property
@pulumi.getter(name="addHosts") @pulumi.getter(name="addHosts")
def add_hosts(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: def add_hosts(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
@@ -476,22 +491,6 @@ class ImageArgs:
def pull(self, value: Optional[pulumi.Input[bool]]): def pull(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "pull", value) pulumi.set(self, "pull", value)
@property
@pulumi.getter
def push(self) -> Optional[pulumi.Input[bool]]:
"""
When `true` the build will automatically include a `registry` export.
Defaults to `false`.
Equivalent to Docker's `--push` flag.
"""
return pulumi.get(self, "push")
@push.setter
def push(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "push", value)
@property @property
@pulumi.getter @pulumi.getter
def registries(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['RegistryArgs']]]]: def registries(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['RegistryArgs']]]]:
@@ -1030,7 +1029,7 @@ class Image(pulumi.CustomResource):
@overload @overload
def __init__(__self__, def __init__(__self__,
resource_name: str, resource_name: str,
args: Optional[ImageArgs] = None, args: ImageArgs,
opts: Optional[pulumi.ResourceOptions] = None): opts: Optional[pulumi.ResourceOptions] = None):
""" """
A Docker image built using buildx -- Docker's interface to the improved A Docker image built using buildx -- Docker's interface to the improved
@@ -1393,6 +1392,8 @@ class Image(pulumi.CustomResource):
__props__.__dict__["no_cache"] = no_cache __props__.__dict__["no_cache"] = no_cache
__props__.__dict__["platforms"] = platforms __props__.__dict__["platforms"] = platforms
__props__.__dict__["pull"] = pull __props__.__dict__["pull"] = pull
if push is None and not opts.urn:
raise TypeError("Missing required property 'push'")
__props__.__dict__["push"] = push __props__.__dict__["push"] = push
__props__.__dict__["registries"] = registries __props__.__dict__["registries"] = registries
__props__.__dict__["secrets"] = secrets __props__.__dict__["secrets"] = secrets
@@ -1676,7 +1677,7 @@ class Image(pulumi.CustomResource):
@property @property
@pulumi.getter @pulumi.getter
def push(self) -> pulumi.Output[Optional[bool]]: def push(self) -> pulumi.Output[bool]:
""" """
When `true` the build will automatically include a `registry` export. When `true` the build will automatically include a `registry` export.