internal

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 75 Imported by: 0

Documentation

Overview

Package internal contains our clients, validation, and provider implementation for interacting with Docker's buildx APIs.

The provider has two primary modes of operation when building an image. The default behavior is to use an embedded Docker CLI, which does not require to actually be installed on a host in order to perform builds (a build daemon must still be accessible locally or remotely). The second mode execs a "docker-buildx" binary on the host to perform builds. This second mode was added primarily for compatibility with Docker Build Cloud, which requires a custom docker-buildx binary.

CLIs

In both execution modes we have several CLI clients. The first client is scoped to the host and initialized as part of the provider's Configure call. We use this CLI for host-level operations, in particular when we potentially initialize a new buildx builder and when we fetch existing credentials on the host.

Each operation then has a CLI instance scoped to the life of the operation. This allows us to layer resource-scoped credentials on top of the host's existing credentials, and in practice Docker seems to handle these connections more reliably than a single CLI for all operations.

Credentials

When using the embedded Docker client, secrets are communicated to the build daemon natively via gRPC callbacks. When running in exec mode, credentials must be communicated to the buildx binary via a configuration file. In order to not pollute the host's existing credentials with e.g. short-lived ECR tokens, we copy a small subset of the host's Docker config to a temporary directory and use that for the lifetime of the exec operation.

Preview mode

The pulumi-go-provider primarily operates on simple Go structs and doesn't currently have a way to distinguish whether a value is unknown or empty. We ignore anything that is a zero value during previews before we apply validation or perform builds.

Diffs

Another limitation of pulumi-go-provider is that it doesn't currently allow us to override the default Diff behavior. We intentionally apply "ignoreChanges" semantics to registry passwords, in order to reduce noise and unnecessary updates, but as a result we have to re-implement Diff from the ground up. This implementation is not nearly as rich as the default experience and should be replaced when an alternative is available.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBuildxProvider

func NewBuildxProvider() provider.Provider

NewBuildxProvider returns a new buildx provider.

func Schema

func Schema(ctx context.Context, version string) schema.PackageSpec

Schema returns our package specification.

Types

type Build

type Build interface {
	BuildOptions() controllerapi.BuildOptions
	Inline() string
	ShouldExec() bool
	Secrets() session.Attachable
}

Build encapsulates all of the user-provider build parameters and options.

type BuildContext

type BuildContext struct {
	Context
	Named NamedContexts `pulumi:"named,optional"`
}

BuildContext represents Docker's named and unamed contexts.

func (*BuildContext) Annotate

func (bc *BuildContext) Annotate(a infer.Annotator)

Annotate sets docstrings on BuildContext.

type BuilderConfig

type BuilderConfig struct {
	Name string `pulumi:"name,optional"`
}

BuilderConfig configures the builder to use for an image build.

func (*BuilderConfig) Annotate

func (b *BuilderConfig) Annotate(a infer.Annotator)

Annotate sets docstrings on BuilderConfig.

type CacheFrom

type CacheFrom struct {
	Local    *CacheFromLocal         `pulumi:"local,optional"`
	Registry *CacheFromRegistry      `pulumi:"registry,optional"`
	GHA      *CacheFromGitHubActions `pulumi:"gha,optional"`
	AZBlob   *CacheFromAzureBlob     `pulumi:"azblob,optional"`
	S3       *CacheFromS3            `pulumi:"s3,optional"`
	Raw      Raw                     `pulumi:"raw,optional"`

	Disabled bool `pulumi:"disabled,optional"`
}

CacheFrom is a "union" type for all of our available `--cache-from` options.

func (*CacheFrom) Annotate

func (c *CacheFrom) Annotate(a infer.Annotator)

Annotate sets docstrings and defaults on CacheFrom.

func (CacheFrom) String

func (c CacheFrom) String() string

String returns a CLI-encoded value for this `--cache-from` entry, or an empty string if disabled. `validate` should be called to ensure only one entry was set.

type CacheFromAzureBlob

type CacheFromAzureBlob struct {
	Name            string `pulumi:"name"`
	AccountURL      string `pulumi:"accountUrl,optional"`
	SecretAccessKey string `pulumi:"secretAccessKey,optional" provider:"secret"`
}

CacheFromAzureBlob pulls cache manifests from Azure blob storage.

func (*CacheFromAzureBlob) Annotate

func (c *CacheFromAzureBlob) Annotate(a infer.Annotator)

Annotate sets docstrings on CacheFromAzureBlob.

func (*CacheFromAzureBlob) String

func (c *CacheFromAzureBlob) String() string

String returns the CLI-encoded value of these cache options, or an empty string if the receiver is nil.

type CacheFromGitHubActions

type CacheFromGitHubActions struct {
	URL   string `pulumi:"url,optional"`
	Token string `pulumi:"token,optional" provider:"secret"`
	Scope string `pulumi:"scope,optional"`
}

CacheFromGitHubActions pulls cache manifests from the GitHub actions cache.

func (*CacheFromGitHubActions) Annotate

func (c *CacheFromGitHubActions) Annotate(a infer.Annotator)

Annotate sets docstrings on CacheFromGitHubActions.

func (*CacheFromGitHubActions) String

func (c *CacheFromGitHubActions) String() string

type CacheFromLocal

type CacheFromLocal struct {
	Src    string `pulumi:"src"`
	Digest string `pulumi:"digest,optional"`
}

CacheFromLocal pulls cache manifests from a local directory.

func (*CacheFromLocal) Annotate

func (c *CacheFromLocal) Annotate(a infer.Annotator)

Annotate sets docstrings on CacheFromLocal.

func (*CacheFromLocal) String

func (c *CacheFromLocal) String() string

String returns the CLI-encoded value of these cache options, or an empty string if the receiver is nil.

type CacheFromRegistry

type CacheFromRegistry struct {
	Ref string `pulumi:"ref"`
}

CacheFromRegistry pulls cache manifests from a registry ref.

func (*CacheFromRegistry) Annotate

func (c *CacheFromRegistry) Annotate(a infer.Annotator)

Annotate sets docstrings on CacheFromRegistry.

func (*CacheFromRegistry) String

func (c *CacheFromRegistry) String() string

String returns the CLI-encoded value of these cache options, or an empty string if the receiver is nil.

type CacheFromS3

type CacheFromS3 struct {
	Region          string `pulumi:"region"`
	Bucket          string `pulumi:"bucket"`
	Name            string `pulumi:"name,optional"`
	EndpointURL     string `pulumi:"endpointUrl,optional"`
	BlobsPrefix     string `pulumi:"blobsPrefix,optional"`
	ManifestsPrefix string `pulumi:"manifestsPrefix,optional"`
	UsePathStyle    *bool  `pulumi:"usePathStyle,optional"`
	AccessKeyID     string `pulumi:"accessKeyId,optional"`
	SecretAccessKey string `pulumi:"secretAccessKey,optional" provider:"secret"`
	SessionToken    string `pulumi:"sessionToken,optional"    provider:"secret"`
}

CacheFromS3 pulls cache manifests from S3-compatible APIs.

func (*CacheFromS3) Annotate

func (c *CacheFromS3) Annotate(a infer.Annotator)

Annotate sets docstrings and defaults on CacheFromS3.

func (*CacheFromS3) String

func (c *CacheFromS3) String() string

String returns the CLI-encoded value of these cache options, or an empty string if the receiver is nil.

type CacheMode

type CacheMode string

CacheMode controls the complexity of exported cache manifests.

const (
	Min CacheMode = "min" // Min cache mode.
	Max CacheMode = "max" // Max cache mode.
)

func (CacheMode) Values

func (CacheMode) Values() []infer.EnumValue[CacheMode]

Values returns all valid CacheMode values for SDK generation.

type CacheTo

type CacheTo struct {
	Inline   *CacheToInline        `pulumi:"inline,optional"`
	Local    *CacheToLocal         `pulumi:"local,optional"`
	Registry *CacheToRegistry      `pulumi:"registry,optional"`
	GHA      *CacheToGitHubActions `pulumi:"gha,optional"`
	AZBlob   *CacheToAzureBlob     `pulumi:"azblob,optional"`
	S3       *CacheToS3            `pulumi:"s3,optional"`
	Raw      Raw                   `pulumi:"raw,optional"`

	Disabled bool `pulumi:"disabled,optional"`
}

CacheTo is a "union" type for all of our available `--cache-to` options.

func (*CacheTo) Annotate

func (c *CacheTo) Annotate(a infer.Annotator)

Annotate sets docstrings and defaults on CacheTo.

func (CacheTo) String

func (c CacheTo) String() string

String returns a CLI-encoded value for this `--cache-to` entry, or an empty string if disabled. `validate` should be called to ensure only one entry was set.

type CacheToAzureBlob

type CacheToAzureBlob struct {
	CacheWithMode
	CacheWithIgnoreError

	CacheFromAzureBlob
}

CacheToAzureBlob pushes cache manifests to Azure blob storage.

func (*CacheToAzureBlob) String

func (c *CacheToAzureBlob) String() string

type CacheToGitHubActions

type CacheToGitHubActions struct {
	CacheWithMode
	CacheWithIgnoreError

	CacheFromGitHubActions
}

CacheToGitHubActions pushes cache manifests to the GitHub Actions cache backend.

func (*CacheToGitHubActions) String

func (c *CacheToGitHubActions) String() string

String returns the CLI-encoded value of these cache options, or an empty string if the receiver is nil.

type CacheToInline

type CacheToInline struct{}

CacheToInline embeds cache information directly into an image.

func (*CacheToInline) Annotate

func (c *CacheToInline) Annotate(a infer.Annotator)

Annotate sets docstrings on CacheToInline.

func (*CacheToInline) String

func (c *CacheToInline) String() string

String returns the CLI-encoded value of these cache options, or an empty string if unknown.

type CacheToLocal

type CacheToLocal struct {
	CacheWithCompression
	CacheWithIgnoreError
	CacheWithMode

	Dest string `pulumi:"dest"`
}

CacheToLocal writes cache manifests to a local directory.

func (*CacheToLocal) Annotate

func (c *CacheToLocal) Annotate(a infer.Annotator)

Annotate sets docstrings on CacheToLocal.

func (*CacheToLocal) String

func (c *CacheToLocal) String() string

String returns the CLI-encoded value of these cache options, or an empty string if the receiver is nil.

type CacheToRegistry

CacheToRegistry pushes cache manifests to a remote registry.

func (*CacheToRegistry) String

func (c *CacheToRegistry) String() string

String returns the CLI-encoded value of these cache options, or an empty string if the receiver is nil.

type CacheToS3

type CacheToS3 struct {
	CacheWithMode
	CacheWithIgnoreError

	CacheFromS3
}

CacheToS3 pushes cache manifests to an S3-compatible API.

func (*CacheToS3) String

func (c *CacheToS3) String() string

String returns the CLI-encoded value of these cache options, or an empty string if the receiver is nil.

type CacheWithCompression

type CacheWithCompression struct {
	Compression      *CompressionType `pulumi:"compression,optional"`
	CompressionLevel int              `pulumi:"compressionLevel,optional"`
	ForceCompression *bool            `pulumi:"forceCompression,optional"`
}

CacheWithCompression is a cache with options to configure compression settings.

func (*CacheWithCompression) Annotate

func (c *CacheWithCompression) Annotate(a infer.Annotator)

Annotate sets docstrings and defaults on CacheWithCompression.

func (CacheWithCompression) String

func (c CacheWithCompression) String() string

String returns the CLI-encoded value of these cache options, or an empty string if the receiver is nil.

type CacheWithIgnoreError

type CacheWithIgnoreError struct {
	IgnoreError *bool `pulumi:"ignoreError,optional"`
}

CacheWithIgnoreError exposes an option to ignore errors during caching.

func (*CacheWithIgnoreError) Annotate

func (c *CacheWithIgnoreError) Annotate(a infer.Annotator)

Annotate sets docstrings and defaults on CacheWithIgnoreError.

func (CacheWithIgnoreError) String

func (c CacheWithIgnoreError) String() string

type CacheWithMode

type CacheWithMode struct {
	Mode *CacheMode `pulumi:"mode,optional"`
}

CacheWithMode is a cache that can configure its mode.

func (*CacheWithMode) Annotate

func (c *CacheWithMode) Annotate(a infer.Annotator)

Annotate sets docstrings and defaults on CacheWithMode.

func (CacheWithMode) String

func (c CacheWithMode) String() string

type CacheWithOCI

type CacheWithOCI struct {
	OCI           *bool `pulumi:"ociMediaTypes,optional"`
	ImageManifest *bool `pulumi:"imageManifest,optional"`
}

CacheWithOCI exposes OCI media type options.

func (*CacheWithOCI) Annotate

func (c *CacheWithOCI) Annotate(a infer.Annotator)

Annotate sets docstrings on CacheWithOCI.

func (CacheWithOCI) String

func (c CacheWithOCI) String() string

String returns the CLI-encoded value of these cache options, or an empty string if unknown.

type Cli

type Cli interface {
	command.Cli
}

Cli wraps the Docker interface for mock generation.

type Client

type Client interface {
	Build(ctx provider.Context, b Build) (*client.SolveResponse, error)
	BuildKitEnabled() (bool, error)
	Inspect(ctx context.Context, id string) ([]descriptor.Descriptor, error)
	Delete(ctx context.Context, id string) error

	ManifestCreate(ctx provider.Context, push bool, target string, refs ...string) error
	ManifestInspect(ctx provider.Context, target string) (string, error)
	ManifestDelete(ctx provider.Context, target string) error
}

Client handles all our Docker API calls.

type CompressionType

type CompressionType string

CompressionType is the algorithm used for compressing blobs.

const (
	Gzip    CompressionType = "gzip"    // Gzip compression.
	Estargz CompressionType = "estargz" // Estargz compression.
	Zstd    CompressionType = "zstd"    // Zstd compression.
)

func (CompressionType) Values

Values returns all valid CompressionType values for SDK generation.

type Config

type Config struct {
	Host       string     `pulumi:"host,optional"`
	Registries []Registry `pulumi:"registries,optional"`
	// contains filtered or unexported fields
}

Config configures the buildx provider.

func (*Config) Annotate

func (c *Config) Annotate(a infer.Annotator)

Annotate provides user-facing descriptions and defaults for Config's fields.

func (*Config) Configure

func (c *Config) Configure(_ provider.Context) error

Configure validates and processes user-provided configuration values.

type Context

type Context struct {
	Location string `pulumi:"location"` // Location is a local directory or URL.
}

Context represents Docker's `PATH | URL | -` context argument. Inline context isn't supported yet.

func (*Context) Annotate

func (c *Context) Annotate(a infer.Annotator)

Annotate sets docstrings on Context.

type Dockerfile

type Dockerfile struct {
	Location string `pulumi:"location,optional"`
	Inline   string `pulumi:"inline,optional"`
}

Dockerfile references a local, remote, or inline Dockerfile.

func (*Dockerfile) Annotate

func (d *Dockerfile) Annotate(a infer.Annotator)

Annotate sets docstrings on Dockerfile.

type Export

type Export struct {
	Tar       *ExportTar       `pulumi:"tar,optional"`
	Local     *ExportLocal     `pulumi:"local,optional"`
	Registry  *ExportRegistry  `pulumi:"registry,optional"`
	Image     *ExportImage     `pulumi:"image,optional"`
	OCI       *ExportOCI       `pulumi:"oci,optional"`
	Docker    *ExportDocker    `pulumi:"docker,optional"`
	CacheOnly *ExportCacheOnly `pulumi:"cacheonly,optional"`
	Raw       Raw              `pulumi:"raw,optional"`

	Disabled bool `pulumi:"disabled,optional"`
}

Export is a "union" type for all of our available `--output` options.

func (*Export) Annotate

func (e *Export) Annotate(a infer.Annotator)

Annotate sets docstrings on Export.

func (Export) String

func (e Export) String() string

String returns a CLI-encoded value for this `--output` entry, or an empty string if disabled. `validate` should be called to ensure only one entry was set.

type ExportCacheOnly

type ExportCacheOnly struct{}

ExportCacheOnly is a dummy/no-op --cache-to entry. It exists only to help silence the "no exports configured" warning. By using this the user signals that they intentionally do not want exports, and only caches will be populated as a result.

func (*ExportCacheOnly) String

func (e *ExportCacheOnly) String() string

String returns the CLI-encoded value of these export options, or an empty string if the receiver is nil.

type ExportDocker

type ExportDocker struct {
	ExportWithOCI
	ExportWithCompression
	ExportWithAnnotations
	ExportWithNames

	Dest string `pulumi:"dest,optional"`
	Tar  *bool  `pulumi:"tar,optional"`
}

ExportDocker pushes the final image to the local build daemon.

func (*ExportDocker) Annotate

func (e *ExportDocker) Annotate(a infer.Annotator)

Annotate sets docstrings and defaults on ExportDocker.

func (*ExportDocker) String

func (e *ExportDocker) String() string

String returns the CLI-encoded value of these export options, or an empty string if the receiver is nil.

type ExportImage

type ExportImage struct {
	ExportWithOCI
	ExportWithCompression
	ExportWithNames
	ExportWithAnnotations

	Push               *bool  `pulumi:"push,optional"`
	PushByDigest       *bool  `pulumi:"pushByDigest,optional"`
	Insecure           *bool  `pulumi:"insecure,optional"`
	DanglingNamePrefix string `pulumi:"danglingNamePrefix,optional"`
	NameCanonical      *bool  `pulumi:"nameCanonical,optional"`
	Unpack             *bool  `pulumi:"unpack,optional"`
	Store              *bool  `pulumi:"store,optional"`
}

ExportImage can push the final image to remote registries.

func (*ExportImage) Annotate

func (e *ExportImage) Annotate(a infer.Annotator)

Annotate sets docstrings and defaults on ExportImage.

func (*ExportImage) String

func (e *ExportImage) String() string

String returns the CLI-encoded value of these export options, or an empty string if the receiver is nil.

type ExportLocal

type ExportLocal struct {
	Dest string `pulumi:"dest"`
}

ExportLocal writes the final image to disk.

func (*ExportLocal) Annotate

func (e *ExportLocal) Annotate(a infer.Annotator)

Annotate sets docstrings on ExportLocal.

func (*ExportLocal) String

func (e *ExportLocal) String() string

String returns the CLI-encoded value of these export options, or an empty string if the receiver is nil.

type ExportOCI

type ExportOCI struct {
	ExportDocker
}

ExportOCI is a cache that defaults to using OCI media types.

func (*ExportOCI) Annotate

func (e *ExportOCI) Annotate(a infer.Annotator)

Annotate sets docstrings and defaults on ExportOCI.

func (*ExportOCI) String

func (e *ExportOCI) String() string

type ExportRegistry

type ExportRegistry struct {
	ExportImage
}

ExportRegistry is equivalent to ExportImage but defaults to push=true.

func (*ExportRegistry) Annotate

func (e *ExportRegistry) Annotate(a infer.Annotator)

Annotate sets docstrings and defaults on ExportRegistry.

func (*ExportRegistry) String

func (e *ExportRegistry) String() string

String returns the CLI-encoded value of these export options, or an empty string if the receiver is nil.

type ExportTar

type ExportTar struct {
	ExportLocal
}

ExportTar is an export that uses the tar format for exporting.

func (*ExportTar) String

func (e *ExportTar) String() string

type ExportWithAnnotations

type ExportWithAnnotations struct {
	Annotations map[string]string `pulumi:"annotations,optional"`
}

ExportWithAnnotations is an export with configurable annotations.

func (*ExportWithAnnotations) Annotate

func (e *ExportWithAnnotations) Annotate(a infer.Annotator)

Annotate sets docstrings on ExportWithAnnotations.

func (ExportWithAnnotations) String

func (e ExportWithAnnotations) String() string

type ExportWithCompression

type ExportWithCompression struct {
	Compression      *CompressionType `pulumi:"compression,optional"`
	CompressionLevel int              `pulumi:"compressionLevel,optional"`
	ForceCompression *bool            `pulumi:"forceCompression,optional"`
}

ExportWithCompression is an export with options to configure compression settings.

func (*ExportWithCompression) Annotate

func (e *ExportWithCompression) Annotate(a infer.Annotator)

Annotate sets docstrings and defaults on ExportWithCompression.

func (ExportWithCompression) String

func (e ExportWithCompression) String() string

type ExportWithNames

type ExportWithNames struct {
	Names []string `pulumi:"names,optional"`
}

ExportWithNames is an export with configurable names (tags).

func (*ExportWithNames) Annotate

func (e *ExportWithNames) Annotate(a infer.Annotator)

Annotate sets docstrings on ExportWithNames.

func (ExportWithNames) String

func (e ExportWithNames) String() string

type ExportWithOCI

type ExportWithOCI struct {
	OCI *bool `pulumi:"ociMediaTypes,optional"`
}

ExportWithOCI is an export that support OCI media types.

func (*ExportWithOCI) Annotate

func (c *ExportWithOCI) Annotate(a infer.Annotator)

Annotate sets defaults on ExportWithOCI.

func (ExportWithOCI) String

func (c ExportWithOCI) String() string

type Image

type Image struct{}

Image is a Docker image build using buildkit.

func (*Image) Annotate

func (i *Image) Annotate(a infer.Annotator)

Annotate provides a description of the Image resource.

func (*Image) Check

Check validates ImageArgs, sets defaults, and ensures our client is authenticated.

func (*Image) Create

func (i *Image) Create(
	ctx provider.Context,
	name string,
	input ImageArgs,
	preview bool,
) (string, ImageState, error)

Create builds an image using buildkit.

func (*Image) Delete

func (i *Image) Delete(
	ctx provider.Context,
	_ string,
	state ImageState,
) error

Delete deletes an Image. If the Image was already deleted out-of-band it is treated as a success.

func (*Image) Diff

func (*Image) Diff(
	_ provider.Context,
	_ string,
	olds ImageState,
	news ImageArgs,
) (provider.DiffResponse, error)

Diff re-implements most of the default diff behavior, with the exception of ignoring "password" changes on registry inputs.

func (*Image) Read

func (i *Image) Read(
	ctx provider.Context,
	name string,
	input ImageArgs,
	state ImageState,
) (
	string,
	ImageArgs,
	ImageState,
	error,
)

Read attempts to read manifests from an image's exports. An image without exports will have no manifests.

func (*Image) Update

func (i *Image) Update(
	ctx provider.Context,
	name string,
	_ ImageState,
	input ImageArgs,
	preview bool,
) (ImageState, error)

Update builds a new image. Normally we create-replace resources, but for images built locally there is nothing to delete. We treat those cases as updates and simply re-build the image without deleting anything.

type ImageArgs

type ImageArgs struct {
	AddHosts       []string          `pulumi:"addHosts,optional"`
	BuildArgs      map[string]string `pulumi:"buildArgs,optional"`
	BuildOnPreview *bool             `pulumi:"buildOnPreview,optional"`
	Builder        *BuilderConfig    `pulumi:"builder,optional"`
	CacheFrom      []CacheFrom       `pulumi:"cacheFrom,optional"`
	CacheTo        []CacheTo         `pulumi:"cacheTo,optional"`
	Context        *BuildContext     `pulumi:"context,optional"`
	Dockerfile     *Dockerfile       `pulumi:"dockerfile,optional"`
	Exports        []Export          `pulumi:"exports,optional"`
	Labels         map[string]string `pulumi:"labels,optional"`
	Load           bool              `pulumi:"load,optional"`
	Network        *NetworkMode      `pulumi:"network,optional"`
	NoCache        bool              `pulumi:"noCache,optional"`
	Platforms      []Platform        `pulumi:"platforms,optional"`
	Pull           bool              `pulumi:"pull,optional"`
	Push           bool              `pulumi:"push"`
	Registries     []Registry        `pulumi:"registries,optional"`
	Secrets        map[string]string `pulumi:"secrets,optional"`
	SSH            []SSH             `pulumi:"ssh,optional"`
	Tags           []string          `pulumi:"tags,optional"`
	Target         string            `pulumi:"target,optional"`
	Exec           bool              `pulumi:"exec,optional"`
}

ImageArgs instantiates a new Image.

func (*ImageArgs) Annotate

func (ia *ImageArgs) Annotate(a infer.Annotator)

Annotate describes inputs to the Image resource.

type ImageState

type ImageState struct {
	ImageArgs

	Digest      string `pulumi:"digest"      provider:"output"`
	ContextHash string `pulumi:"contextHash" provider:"output"`
	Ref         string `pulumi:"ref"         provider:"output"`
}

ImageState is serialized to the program's state file.

func (*ImageState) Annotate

func (is *ImageState) Annotate(a infer.Annotator)

Annotate describes outputs of the Image resource.

type Index

type Index struct{}

Index is an OCI index or manifest list on a remote registry.

func (*Index) Annotate

func (i *Index) Annotate(a infer.Annotator)

Annotate sets docstrings and defaults on Index.

func (*Index) Check

Check confirms the Index's tag and source refs are all valid. This doesn't fully capture input requirements -- for example buildx requires refs to all exist on the same registry. This is sufficient to handle the most common cases for now.

func (*Index) Create

func (i *Index) Create(
	ctx provider.Context,
	name string,
	input IndexArgs,
	preview bool,
) (string, IndexState, error)

Create is a passthrough to Update.

func (*Index) Delete

func (i *Index) Delete(ctx provider.Context, _ string, state IndexState) error

Delete attempts to delete the remote manifest.

func (*Index) Diff

func (i *Index) Diff(
	_ provider.Context,
	_ string,
	olds IndexState,
	news IndexArgs,
) (provider.DiffResponse, error)

Diff returns a diff of proposed changes against current state. Ideally we wouldn't need to implement all of this, but we currently have to in order to force `ignoreChanges`-style behavior on our registry password (which can change all the time due to short-lived AWS credentials).

func (*Index) Read

func (i *Index) Read(
	ctx provider.Context,
	name string,
	input IndexArgs,
	state IndexState,
) (string, IndexArgs, IndexState, error)

func (*Index) Update

func (i *Index) Update(
	ctx provider.Context,
	name string,
	state IndexState,
	input IndexArgs,
	preview bool,
) (IndexState, error)

Update performs `buildx imagetools create` to create a new OCI index / manifest list.

type IndexArgs

type IndexArgs struct {
	Tag      string    `pulumi:"tag"`
	Sources  []string  `pulumi:"sources"`
	Push     bool      `pulumi:"push,optional"`
	Registry *Registry `pulumi:"registry,optional"`
}

IndexArgs instantiate an Index.

func (*IndexArgs) Annotate

func (i *IndexArgs) Annotate(a infer.Annotator)

Annotate sets docstrings and defaults on IndexArgs.

type IndexState

type IndexState struct {
	IndexArgs

	Ref string `pulumi:"ref" provider:"output"`
}

IndexState captures the state of an Index.

func (*IndexState) Annotate

func (i *IndexState) Annotate(a infer.Annotator)

Annotate sets docstrings on IndexState.

type NamedContexts

type NamedContexts map[string]Context

NamedContexts correspond to Docker's `--build-context name=path` options. The path can be local or a remote URL.

func (NamedContexts) Map

func (nc NamedContexts) Map() map[string]string

Map returns NamedContexts as a simple map.

type NetworkMode

type NetworkMode string

NetworkMode is the --network parameter for a build.

const (
	Default NetworkMode = "default" // Default network mode.
	Host    NetworkMode = "host"    // Host network mode.
	None    NetworkMode = "none"    // None or no network mode.
)

func (*NetworkMode) String

func (n *NetworkMode) String() string

func (NetworkMode) Values

func (NetworkMode) Values() []infer.EnumValue[NetworkMode]

Values returns all valid NetworkMode values for SDK generation.

type Platform

type Platform string

Platform is an enum capturing all available OS/architecture targets.

func (Platform) String

func (p Platform) String() string

func (Platform) Values

func (Platform) Values() []infer.EnumValue[Platform]

Values returns all valid Platform values for SDK generation.

type ProviderContext

type ProviderContext interface {
	provider.Context
}

ProviderContext is a workaround for https://github.com/pulumi/pulumi-go-provider/issues/159

type Raw

type Raw string

Raw is a CLI-encoded cache entry appropriate for passing directly to the CLI. Useful if the Docker backend supports cache types not captured by our API, or if the user just prefers "type=..." inputs.

func (Raw) String

func (c Raw) String() string

String return the raw string as-is. This can be empty during previews where the user has provided a value but it is unknown.

type Registry

type Registry struct {
	Address  string `pulumi:"address"`
	Password string `pulumi:"password,optional" provider:"secret"`
	Username string `pulumi:"username,optional"`
}

Registry contains credentials for authenticating with a remote registry.

func (*Registry) Annotate

func (r *Registry) Annotate(a infer.Annotator)

Annotate sets docstrings on Registry.

type SSH

type SSH struct {
	ID    string   `pulumi:"id"`
	Paths []string `pulumi:"paths,optional"`
}

SSH is an SSH option.

func (*SSH) Annotate

func (s *SSH) Annotate(a infer.Annotator)

Annotate sets docstrings on SSH.

func (SSH) String

func (s SSH) String() string

String returns a CLI-encoded value for the SSH option, or an empty string if its ID is not known.

Directories

Path Synopsis
Package deprecated vendors config parsing from pulumi-terraform-bridge.
Package deprecated vendors config parsing from pulumi-terraform-bridge.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL