provider

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MPL-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContainerImage = "cgr.dev/chainguard/docker-cli:latest-dev"
)

Variables

This section is empty.

Functions

func ContainerVolumeResourceAttributes added in v0.0.14

func ContainerVolumeResourceAttributes() map[string]schema.Attribute

func New

func New(version string) func() provider.Provider

func NewContainerVolumeResource added in v0.0.14

func NewContainerVolumeResource() resource.Resource

func NewFeatureResource

func NewFeatureResource() resource.Resource

func NewHarnessContainerResource

func NewHarnessContainerResource() resource.Resource

func NewHarnessDockerResource added in v0.0.15

func NewHarnessDockerResource() resource.Resource

func NewHarnessK3sResource

func NewHarnessK3sResource() resource.Resource

func NewInventoryDataSource added in v0.0.2

func NewInventoryDataSource() datasource.DataSource

func NewRandomDataSource added in v0.0.2

func NewRandomDataSource() datasource.DataSource

Types

type ContainerResourceModelNetwork

type ContainerResourceModelNetwork struct {
	Name types.String `tfsdk:"name"`
}

type ContainerResourceMountModel

type ContainerResourceMountModel struct {
	Source      types.String `tfsdk:"source"`
	Destination types.String `tfsdk:"destination"`
}

type ContainerVolumeResource added in v0.0.14

type ContainerVolumeResource struct {
	// contains filtered or unexported fields
}

func (*ContainerVolumeResource) Configure added in v0.0.14

func (*ContainerVolumeResource) Create added in v0.0.14

func (*ContainerVolumeResource) Delete added in v0.0.14

func (*ContainerVolumeResource) ImportState added in v0.0.14

func (*ContainerVolumeResource) Metadata added in v0.0.14

func (*ContainerVolumeResource) Read added in v0.0.14

func (*ContainerVolumeResource) Schema added in v0.0.14

func (*ContainerVolumeResource) Update added in v0.0.14

type ContainerVolumeResourceModel added in v0.0.14

type ContainerVolumeResourceModel struct {
	Id        types.String             `tfsdk:"id"`
	Name      types.String             `tfsdk:"name"`
	Inventory InventoryDataSourceModel `tfsdk:"inventory"`
}

type DockerRegistryResourceModel added in v0.0.17

type DockerRegistryResourceModel struct {
	Auth *RegistryResourceAuthModel `tfsdk:"auth"`
}

type FeatureHarnessResourceModel added in v0.0.2

type FeatureHarnessResourceModel struct {
	Id        types.String             `tfsdk:"id"`
	Name      types.String             `tfsdk:"name"`
	Inventory InventoryDataSourceModel `tfsdk:"inventory"`
	Skipped   types.Bool               `tfsdk:"skipped"`
}

FeatureHarnessResourceModel is the common data model all harnesses output to be passed into dependent features.

type FeatureHarnessVolumeMountModel added in v0.0.14

type FeatureHarnessVolumeMountModel struct {
	Source      ContainerVolumeResourceModel `tfsdk:"source"`
	Destination string                       `tfsdk:"destination"`
}

type FeatureResource

type FeatureResource struct {
	// contains filtered or unexported fields
}

FeatureResource defines the resource implementation.

func (*FeatureResource) Configure

func (*FeatureResource) Create

func (*FeatureResource) Delete

func (*FeatureResource) ImportState

func (*FeatureResource) Metadata

func (*FeatureResource) ModifyPlan added in v0.0.2

ModifyPlan implements resource.ResourceWithModifyPlan.

func (*FeatureResource) Read

func (*FeatureResource) Schema

func (*FeatureResource) Update

type FeatureResourceModel

type FeatureResourceModel struct {
	Id          types.String       `tfsdk:"id"`
	Name        types.String       `tfsdk:"name"`
	Description types.String       `tfsdk:"description"`
	Labels      types.Map          `tfsdk:"labels"`
	Before      []FeatureStepModel `tfsdk:"before"`
	After       []FeatureStepModel `tfsdk:"after"`
	Steps       []FeatureStepModel `tfsdk:"steps"`
	Timeouts    timeouts.Value     `tfsdk:"timeouts"`

	Harness FeatureHarnessResourceModel `tfsdk:"harness"`
}

FeatureResourceModel describes the resource data model.

type FeatureStepBackoffModel added in v0.0.10

type FeatureStepBackoffModel struct {
	Attempts types.Int64   `tfsdk:"attempts"`
	Delay    types.String  `tfsdk:"delay"`
	Factor   types.Float64 `tfsdk:"factor"`
}

type FeatureStepModel

type FeatureStepModel struct {
	Name    types.String             `tfsdk:"name"`
	Cmd     types.String             `tfsdk:"cmd"`
	Workdir types.String             `tfsdk:"workdir"`
	Retry   *FeatureStepBackoffModel `tfsdk:"retry"`
}

func (*FeatureStepModel) StepConfig added in v0.0.3

func (s *FeatureStepModel) StepConfig() itypes.StepConfig

type HarnessContainerResource

type HarnessContainerResource struct {
	HarnessResource
}

HarnessContainerResource defines the resource implementation.

func (*HarnessContainerResource) Create

func (*HarnessContainerResource) Delete

func (*HarnessContainerResource) ImportState

func (*HarnessContainerResource) Metadata

func (*HarnessContainerResource) Read

func (*HarnessContainerResource) Schema

func (*HarnessContainerResource) Update

type HarnessContainerResourceModel

type HarnessContainerResourceModel struct {
	Id        types.String                     `tfsdk:"id"`
	Name      types.String                     `tfsdk:"name"`
	Inventory InventoryDataSourceModel         `tfsdk:"inventory"`
	Skipped   types.Bool                       `tfsdk:"skipped"`
	Volumes   []FeatureHarnessVolumeMountModel `tfsdk:"volumes"`

	Image      types.String                             `tfsdk:"image"`
	Privileged types.Bool                               `tfsdk:"privileged"`
	Envs       types.Map                                `tfsdk:"envs"`
	Mounts     []ContainerResourceMountModel            `tfsdk:"mounts"`
	Networks   map[string]ContainerResourceModelNetwork `tfsdk:"networks"`
}

HarnessContainerResourceModel describes the resource data model.

type HarnessDockerResource added in v0.0.15

type HarnessDockerResource struct {
	HarnessResource
}

HarnessDockerResource defines the resource implementation.

func (*HarnessDockerResource) Create added in v0.0.15

func (*HarnessDockerResource) Delete added in v0.0.15

func (*HarnessDockerResource) ImportState added in v0.0.15

func (*HarnessDockerResource) Metadata added in v0.0.15

func (*HarnessDockerResource) Read added in v0.0.15

func (*HarnessDockerResource) Schema added in v0.0.15

func (*HarnessDockerResource) Update added in v0.0.15

type HarnessDockerResourceModel added in v0.0.15

type HarnessDockerResourceModel struct {
	Id        types.String                     `tfsdk:"id"`
	Name      types.String                     `tfsdk:"name"`
	Inventory InventoryDataSourceModel         `tfsdk:"inventory"`
	Skipped   types.Bool                       `tfsdk:"skipped"`
	Volumes   []FeatureHarnessVolumeMountModel `tfsdk:"volumes"`

	Image      types.String                             `tfsdk:"image"`
	Privileged types.Bool                               `tfsdk:"privileged"`
	Envs       types.Map                                `tfsdk:"envs"`
	Mounts     []ContainerResourceMountModel            `tfsdk:"mounts"`
	Networks   map[string]ContainerResourceModelNetwork `tfsdk:"networks"`
	Registries map[string]DockerRegistryResourceModel   `tfsdk:"registries"`
}

HarnessDockerResourceModel describes the resource data model.

type HarnessK3sResource

type HarnessK3sResource struct {
	HarnessResource
}

HarnessK3sResource defines the resource implementation.

func (*HarnessK3sResource) Create

func (*HarnessK3sResource) Delete

func (*HarnessK3sResource) ImportState

func (*HarnessK3sResource) Metadata

func (*HarnessK3sResource) Read

func (*HarnessK3sResource) Schema

func (*HarnessK3sResource) Update

type HarnessK3sResourceModel

type HarnessK3sResourceModel struct {
	Id        types.String             `tfsdk:"id"`
	Name      types.String             `tfsdk:"name"`
	Inventory InventoryDataSourceModel `tfsdk:"inventory"`
	Skipped   types.Bool               `tfsdk:"skipped"`

	Image                types.String                             `tfsdk:"image"`
	DisableCni           types.Bool                               `tfsdk:"disable_cni"`
	DisableTraefik       types.Bool                               `tfsdk:"disable_traefik"`
	DisableMetricsServer types.Bool                               `tfsdk:"disable_metrics_server"`
	Registries           map[string]RegistryResourceModel         `tfsdk:"registries"`
	Networks             map[string]ContainerResourceModelNetwork `tfsdk:"networks"`
	Sandbox              types.Object                             `tfsdk:"sandbox"`
	Timeouts             timeouts.Value                           `tfsdk:"timeouts"`
}

HarnessK3sResourceModel describes the resource data model.

type HarnessK3sSandboxResourceModel added in v0.0.3

type HarnessK3sSandboxResourceModel struct {
	Image      types.String                             `tfsdk:"image"`
	Privileged types.Bool                               `tfsdk:"privileged"`
	Envs       types.Map                                `tfsdk:"envs"`
	Mounts     []ContainerResourceMountModel            `tfsdk:"mounts"`
	Networks   map[string]ContainerResourceModelNetwork `tfsdk:"networks"`
}

type HarnessResource added in v0.0.2

type HarnessResource struct {
	// contains filtered or unexported fields
}

HarnessResource provides common methods for all HarnessResource implementations.

func (*HarnessResource) Configure added in v0.0.2

func (*HarnessResource) ModifyPlan added in v0.0.2

ModifyPlan adds the harness to the inventory during both the plan and apply phase. This uses the more verbose GetAttribute() instead of Get() because terraform-plugin-framework does not support embedding models without nesting.

func (*HarnessResource) ShouldSkip added in v0.0.2

type ImageTestProvider

type ImageTestProvider struct {
	// contains filtered or unexported fields
}

ImageTestProvider defines the provider implementation.

func (*ImageTestProvider) Configure

func (*ImageTestProvider) DataSources

func (p *ImageTestProvider) DataSources(ctx context.Context) []func() datasource.DataSource

func (*ImageTestProvider) Metadata

func (*ImageTestProvider) Resources

func (p *ImageTestProvider) Resources(_ context.Context) []func() resource.Resource

func (*ImageTestProvider) Schema

type ImageTestProviderHarnessModel

type ImageTestProviderHarnessModel struct {
	Container *ProviderHarnessContainerModel `tfsdk:"container"`
	K3s       *ProviderHarnessK3sModel       `tfsdk:"k3s"`
	Docker    *ProviderHarnessDockerModel    `tfsdk:"docker"`
}

type ImageTestProviderModel

type ImageTestProviderModel struct {
	Log       *ProviderLoggerModel           `tfsdk:"log"`
	Harnesses *ImageTestProviderHarnessModel `tfsdk:"harnesses"`
	Labels    types.Map                      `tfsdk:"labels"`
}

ImageTestProviderModel describes the provider data model.

type InventoryDataSource added in v0.0.2

type InventoryDataSource struct {
	// contains filtered or unexported fields
}

InventoryDataSource defines the data source implementation.

func (*InventoryDataSource) Configure added in v0.0.2

func (*InventoryDataSource) Metadata added in v0.0.2

func (*InventoryDataSource) Read added in v0.0.2

func (*InventoryDataSource) Schema added in v0.0.2

type InventoryDataSourceModel added in v0.0.2

type InventoryDataSourceModel struct {
	Seed types.String `tfsdk:"seed"`
}

InventoryDataSourceModel describes the data source data model.

type ProviderHarnessContainerModel

type ProviderHarnessContainerModel struct {
	Networks map[string]ContainerResourceModelNetwork `tfsdk:"networks"`
	Envs     types.Map                                `tfsdk:"envs"`
	Mounts   []ContainerResourceMountModel            `tfsdk:"mounts"`
}

type ProviderHarnessDockerModel added in v0.0.15

type ProviderHarnessDockerModel struct {
	HostSocketPath *string                                  `tfsdk:"host_socket_path"`
	Networks       map[string]ContainerResourceModelNetwork `tfsdk:"networks"`
	Envs           types.Map                                `tfsdk:"envs"`
	Mounts         []ContainerResourceMountModel            `tfsdk:"mounts"`
	Registries     map[string]DockerRegistryResourceModel   `tfsdk:"registries"`
}

type ProviderHarnessK3sModel

type ProviderHarnessK3sModel struct {
	Networks   map[string]ContainerResourceModelNetwork `tfsdk:"networks"`
	Registries map[string]RegistryResourceModel         `tfsdk:"registries"`
}

type ProviderLoggerModel added in v0.0.2

type ProviderLoggerModel struct {
	Tf *ProviderLoggerTfModel `tfsdk:"tf"`
}

type ProviderLoggerTfModel added in v0.0.2

type ProviderLoggerTfModel struct{}

type ProviderStore

type ProviderStore struct {
	// contains filtered or unexported fields
}

ProviderStore manages the global runtime state of the provider. The provider uses this to lookup the defined relationships between resources, and manage shared external state.

func NewProviderStore

func NewProviderStore() *ProviderStore

func (*ProviderStore) Encode added in v0.0.2

func (s *ProviderStore) Encode(components ...string) (string, error)

func (*ProviderStore) Inventory added in v0.0.2

Inventory returns an instance of the inventory per inventory data source.

func (*ProviderStore) Logger added in v0.0.2

func (s *ProviderStore) Logger() *slog.Logger

func (*ProviderStore) SkipTeardown added in v0.0.8

func (s *ProviderStore) SkipTeardown() bool

SkipTeardown returns true if the IMAGETEST_SKIP_TEARDOWN environment variable is declared.

type RandomDataSource added in v0.0.2

type RandomDataSource struct {
	// contains filtered or unexported fields
}

RandomDataSource defines the data source implementation.

func (*RandomDataSource) Configure added in v0.0.2

func (*RandomDataSource) Metadata added in v0.0.2

func (*RandomDataSource) Read added in v0.0.2

func (*RandomDataSource) Schema added in v0.0.2

type RandomDataSourceModel added in v0.0.2

type RandomDataSourceModel struct {
	Id types.String `tfsdk:"id"`
}

RandomDataSourceModel describes the data source data model.

type RegistryResourceAuthModel

type RegistryResourceAuthModel struct {
	Username types.String `tfsdk:"username"`
	Password types.String `tfsdk:"password"`
	Auth     types.String `tfsdk:"auth"`
}

type RegistryResourceMirrorModel

type RegistryResourceMirrorModel struct {
	Endpoints types.List `tfsdk:"endpoints"`
}

type RegistryResourceModel

type RegistryResourceModel struct {
	Auth   *RegistryResourceAuthModel   `tfsdk:"auth"`
	Tls    *RegistryResourceTlsModel    `tfsdk:"tls"`
	Mirror *RegistryResourceMirrorModel `tfsdk:"mirror"`
}

type RegistryResourceTlsModel

type RegistryResourceTlsModel struct {
	CertFile types.String `tfsdk:"cert_file"`
	KeyFile  types.String `tfsdk:"key_file"`
	CaFile   types.String `tfsdk:"ca_file"`
}

Jump to

Keyboard shortcuts

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