Initial provider implementation (#18)
This brings over the initial buildx prototype from pulumi/pulumi-docker and fixes various build and release issues.
This commit is contained in:
259
sdk/dotnet/Index.cs
generated
Normal file
259
sdk/dotnet/Index.cs
generated
Normal file
@@ -0,0 +1,259 @@
|
||||
// *** 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;
|
||||
|
||||
namespace Pulumi.DockerBuild
|
||||
{
|
||||
/// <summary>
|
||||
/// A wrapper around `docker buildx imagetools create` to create an index
|
||||
/// (or manifest list) referencing one or more existing images.
|
||||
///
|
||||
/// In most cases you do not need an `Index` to build a multi-platform
|
||||
/// image -- specifying multiple platforms on the `Image` will handle this
|
||||
/// for you automatically.
|
||||
///
|
||||
/// However, as of April 2024, building multi-platform images _with
|
||||
/// caching_ will only export a cache for one platform at a time (see [this
|
||||
/// discussion](https://github.com/docker/buildx/discussions/1382) for more
|
||||
/// details).
|
||||
///
|
||||
/// Therefore this resource can be helpful if you are building
|
||||
/// multi-platform images with caching: each platform can be built and
|
||||
/// cached separately, and an `Index` can join them all together. An
|
||||
/// example of this is shown below.
|
||||
///
|
||||
/// This resource creates an OCI image index or a Docker manifest list
|
||||
/// depending on the media types of the source images.
|
||||
///
|
||||
/// ## Example Usage
|
||||
/// ### Multi-platform registry caching
|
||||
/// ```csharp
|
||||
/// using System.Collections.Generic;
|
||||
/// using System.Linq;
|
||||
/// using Pulumi;
|
||||
/// using DockerBuild = Pulumi.DockerBuild;
|
||||
///
|
||||
/// return await Deployment.RunAsync(() =>
|
||||
/// {
|
||||
/// var amd64 = new DockerBuild.Image("amd64", new()
|
||||
/// {
|
||||
/// CacheFrom = new[]
|
||||
/// {
|
||||
/// new DockerBuild.Inputs.CacheFromArgs
|
||||
/// {
|
||||
/// Registry = new DockerBuild.Inputs.CacheFromRegistryArgs
|
||||
/// {
|
||||
/// Ref = "docker.io/pulumi/pulumi:cache-amd64",
|
||||
/// },
|
||||
/// },
|
||||
/// },
|
||||
/// CacheTo = new[]
|
||||
/// {
|
||||
/// new DockerBuild.Inputs.CacheToArgs
|
||||
/// {
|
||||
/// Registry = new DockerBuild.Inputs.CacheToRegistryArgs
|
||||
/// {
|
||||
/// Mode = DockerBuild.CacheMode.Max,
|
||||
/// Ref = "docker.io/pulumi/pulumi:cache-amd64",
|
||||
/// },
|
||||
/// },
|
||||
/// },
|
||||
/// Context = new DockerBuild.Inputs.BuildContextArgs
|
||||
/// {
|
||||
/// Location = "app",
|
||||
/// },
|
||||
/// Platforms = new[]
|
||||
/// {
|
||||
/// DockerBuild.Platform.Linux_amd64,
|
||||
/// },
|
||||
/// Tags = new[]
|
||||
/// {
|
||||
/// "docker.io/pulumi/pulumi:3.107.0-amd64",
|
||||
/// },
|
||||
/// });
|
||||
///
|
||||
/// var arm64 = new DockerBuild.Image("arm64", new()
|
||||
/// {
|
||||
/// CacheFrom = new[]
|
||||
/// {
|
||||
/// new DockerBuild.Inputs.CacheFromArgs
|
||||
/// {
|
||||
/// Registry = new DockerBuild.Inputs.CacheFromRegistryArgs
|
||||
/// {
|
||||
/// Ref = "docker.io/pulumi/pulumi:cache-arm64",
|
||||
/// },
|
||||
/// },
|
||||
/// },
|
||||
/// CacheTo = new[]
|
||||
/// {
|
||||
/// new DockerBuild.Inputs.CacheToArgs
|
||||
/// {
|
||||
/// Registry = new DockerBuild.Inputs.CacheToRegistryArgs
|
||||
/// {
|
||||
/// Mode = DockerBuild.CacheMode.Max,
|
||||
/// Ref = "docker.io/pulumi/pulumi:cache-arm64",
|
||||
/// },
|
||||
/// },
|
||||
/// },
|
||||
/// Context = new DockerBuild.Inputs.BuildContextArgs
|
||||
/// {
|
||||
/// Location = "app",
|
||||
/// },
|
||||
/// Platforms = new[]
|
||||
/// {
|
||||
/// DockerBuild.Platform.Linux_arm64,
|
||||
/// },
|
||||
/// Tags = new[]
|
||||
/// {
|
||||
/// "docker.io/pulumi/pulumi:3.107.0-arm64",
|
||||
/// },
|
||||
/// });
|
||||
///
|
||||
/// var index = new DockerBuild.Index("index", new()
|
||||
/// {
|
||||
/// Sources = new[]
|
||||
/// {
|
||||
/// amd64.Ref,
|
||||
/// arm64.Ref,
|
||||
/// },
|
||||
/// Tag = "docker.io/pulumi/pulumi:3.107.0",
|
||||
/// });
|
||||
///
|
||||
/// return new Dictionary<string, object?>
|
||||
/// {
|
||||
/// ["ref"] = index.Ref,
|
||||
/// };
|
||||
/// });
|
||||
///
|
||||
/// ```
|
||||
/// </summary>
|
||||
[DockerBuildResourceType("docker-build:index:Index")]
|
||||
public partial class Index : global::Pulumi.CustomResource
|
||||
{
|
||||
/// <summary>
|
||||
/// If true, push the index to the target registry.
|
||||
///
|
||||
/// Defaults to `true`.
|
||||
/// </summary>
|
||||
[Output("push")]
|
||||
public Output<bool?> Push { get; private set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// The pushed tag with digest.
|
||||
///
|
||||
/// Identical to the tag if the index was not pushed.
|
||||
/// </summary>
|
||||
[Output("ref")]
|
||||
public Output<string> Ref { get; private set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Authentication for the registry where the tagged index will be pushed.
|
||||
///
|
||||
/// Credentials can also be included with the provider's configuration.
|
||||
/// </summary>
|
||||
[Output("registry")]
|
||||
public Output<Outputs.Registry?> Registry { get; private set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Existing images to include in the index.
|
||||
/// </summary>
|
||||
[Output("sources")]
|
||||
public Output<ImmutableArray<string>> Sources { get; private set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// The tag to apply to the index.
|
||||
/// </summary>
|
||||
[Output("tag")]
|
||||
public Output<string> Tag { get; private set; } = null!;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a Index 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 Index(string name, IndexArgs args, CustomResourceOptions? options = null)
|
||||
: base("docker-build:index:Index", name, args ?? new IndexArgs(), MakeResourceOptions(options, ""))
|
||||
{
|
||||
}
|
||||
|
||||
private Index(string name, Input<string> id, CustomResourceOptions? options = null)
|
||||
: base("docker-build:index:Index", name, null, MakeResourceOptions(options, id))
|
||||
{
|
||||
}
|
||||
|
||||
private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
|
||||
{
|
||||
var defaultOptions = new CustomResourceOptions
|
||||
{
|
||||
Version = Utilities.Version,
|
||||
};
|
||||
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 Index 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 Index Get(string name, Input<string> id, CustomResourceOptions? options = null)
|
||||
{
|
||||
return new Index(name, id, options);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class IndexArgs : global::Pulumi.ResourceArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// If true, push the index to the target registry.
|
||||
///
|
||||
/// Defaults to `true`.
|
||||
/// </summary>
|
||||
[Input("push")]
|
||||
public Input<bool>? Push { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Authentication for the registry where the tagged index will be pushed.
|
||||
///
|
||||
/// Credentials can also be included with the provider's configuration.
|
||||
/// </summary>
|
||||
[Input("registry")]
|
||||
public Input<Inputs.RegistryArgs>? Registry { get; set; }
|
||||
|
||||
[Input("sources", required: true)]
|
||||
private InputList<string>? _sources;
|
||||
|
||||
/// <summary>
|
||||
/// Existing images to include in the index.
|
||||
/// </summary>
|
||||
public InputList<string> Sources
|
||||
{
|
||||
get => _sources ?? (_sources = new InputList<string>());
|
||||
set => _sources = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The tag to apply to the index.
|
||||
/// </summary>
|
||||
[Input("tag", required: true)]
|
||||
public Input<string> Tag { get; set; } = null!;
|
||||
|
||||
public IndexArgs()
|
||||
{
|
||||
Push = true;
|
||||
}
|
||||
public static new IndexArgs Empty => new IndexArgs();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user