Documentation ¶
Index ¶
- Constants
- func New(version string) func() provider.Provider
- func NewContainerVolumeResource() resource.Resource
- func NewFeatureResource() resource.Resource
- func NewHarnessDockerResource() resource.Resource
- func NewHarnessK3sResource() resource.Resource
- func NewHarnessPterraformResource() resource.Resource
- func NewInventoryDataSource() datasource.DataSource
- func ParseResources(resources *ContainerResources) (docker.ResourcesRequest, error)
- type BaseHarnessResource
- func (r *BaseHarnessResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *BaseHarnessResource) Delete(context.Context, resource.DeleteRequest, *resource.DeleteResponse)
- func (r *BaseHarnessResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, ...)
- func (r *BaseHarnessResource) Read(context.Context, resource.ReadRequest, *resource.ReadResponse)
- type BaseHarnessResourceModel
- type ContainerCpuResources
- type ContainerMemoryResources
- type ContainerMountModel
- type ContainerNetworkModel
- type ContainerResources
- type ContainerVolumeResource
- func (r *ContainerVolumeResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *ContainerVolumeResource) Metadata(_ context.Context, req resource.MetadataRequest, ...)
- func (r *ContainerVolumeResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *ContainerVolumeResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type ContainerVolumeResourceModel
- type DockerRegistryResourceModel
- type FeatureHarnessResourceModel
- type FeatureHarnessVolumeMountModel
- type FeatureResource
- func (r *FeatureResource) Configure(_ context.Context, req resource.ConfigureRequest, ...)
- func (r *FeatureResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *FeatureResource) Delete(_ context.Context, _ resource.DeleteRequest, _ *resource.DeleteResponse)
- func (r *FeatureResource) Metadata(_ context.Context, req resource.MetadataRequest, ...)
- func (r *FeatureResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, ...)
- func (r *FeatureResource) Read(_ context.Context, _ resource.ReadRequest, _ *resource.ReadResponse)
- func (r *FeatureResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *FeatureResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type FeatureResourceModel
- type FeatureStepBackoffModel
- type FeatureStepModel
- type HarnessContainerEnvs
- type HarnessDockerResource
- func (r *HarnessDockerResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *HarnessDockerResource) Metadata(_ context.Context, req resource.MetadataRequest, ...)
- func (r *HarnessDockerResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *HarnessDockerResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type HarnessDockerResourceModel
- type HarnessHooksModel
- type HarnessK3sResource
- func (r *HarnessK3sResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *HarnessK3sResource) Metadata(_ context.Context, req resource.MetadataRequest, ...)
- func (r *HarnessK3sResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *HarnessK3sResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type HarnessK3sResourceModel
- type HarnessK3sSandboxResourceModel
- type HarnessPterraformResource
- func (r *HarnessPterraformResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *HarnessPterraformResource) Metadata(_ context.Context, req resource.MetadataRequest, ...)
- func (r *HarnessPterraformResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *HarnessPterraformResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type HarnessPterraformResourceModel
- type ImageTestProvider
- func (p *ImageTestProvider) Configure(ctx context.Context, req provider.ConfigureRequest, ...)
- func (p *ImageTestProvider) DataSources(ctx context.Context) []func() datasource.DataSource
- func (p *ImageTestProvider) Metadata(ctx context.Context, req provider.MetadataRequest, ...)
- func (p *ImageTestProvider) Resources(_ context.Context) []func() resource.Resource
- func (p *ImageTestProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse)
- type ImageTestProviderHarnessModel
- type ImageTestProviderModel
- type InventoryDataSource
- func (d *InventoryDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, ...)
- func (d *InventoryDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, ...)
- func (d *InventoryDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
- func (d *InventoryDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse)
- type InventoryDataSourceModel
- type ProviderHarnessClusterModel
- type ProviderHarnessContainerSandboxResourceModel
- type ProviderHarnessDockerModel
- type ProviderHarnessK3sModel
- type ProviderLoggerFileModel
- type ProviderLoggerModel
- type ProviderStore
- func (s *ProviderStore) AddHarness(id string, harness harness.Harness)
- func (s *ProviderStore) EnableDebugLogging() bool
- func (s *ProviderStore) Encode(components ...string) (string, error)
- func (s *ProviderStore) GetHarness(id string) (harness.Harness, bool)
- func (s *ProviderStore) Inventory(data InventoryDataSourceModel) inventory.Inventory
- func (s *ProviderStore) Logger(ctx context.Context, inv InventoryDataSourceModel, withs ...any) (context.Context, error)
- func (s *ProviderStore) SkipTeardown() bool
- type RegistryResourceAuthModel
- type RegistryResourceMirrorModel
- type RegistryResourceModel
- type RegistryResourceTlsModel
Constants ¶
const (
ContainerImage = "cgr.dev/chainguard/docker-cli:latest-dev"
)
Variables ¶
This section is empty.
Functions ¶
func NewContainerVolumeResource ¶ added in v0.0.14
func NewFeatureResource ¶
func NewHarnessDockerResource ¶ added in v0.0.15
func NewHarnessK3sResource ¶
func NewHarnessPterraformResource ¶ added in v0.0.29
func NewInventoryDataSource ¶ added in v0.0.2
func NewInventoryDataSource() datasource.DataSource
func ParseResources ¶ added in v0.0.20
func ParseResources(resources *ContainerResources) (docker.ResourcesRequest, error)
ParseResources parses the ContainerResources object into a provider.ContainerResourcesRequest object.
Types ¶
type BaseHarnessResource ¶ added in v0.0.29
type BaseHarnessResource struct {
// contains filtered or unexported fields
}
BaseHarnessResource provides common methods for all BaseHarnessResource implementations.
func (*BaseHarnessResource) Configure ¶ added in v0.0.29
func (r *BaseHarnessResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (*BaseHarnessResource) Delete ¶ added in v0.0.29
func (r *BaseHarnessResource) Delete(context.Context, resource.DeleteRequest, *resource.DeleteResponse)
Delete implements resource.Resource. This is intentionally a no-op.
func (*BaseHarnessResource) ModifyPlan ¶ added in v0.0.29
func (r *BaseHarnessResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse)
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 (*BaseHarnessResource) Read ¶ added in v0.0.29
func (r *BaseHarnessResource) Read(context.Context, resource.ReadRequest, *resource.ReadResponse)
Read implements resource.Resource. This is intentionally a no-op.
type BaseHarnessResourceModel ¶ added in v0.0.29
type ContainerCpuResources ¶ added in v0.0.20
type ContainerMemoryResources ¶ added in v0.0.18
type ContainerMountModel ¶ added in v0.0.29
type ContainerNetworkModel ¶ added in v0.0.29
type ContainerResources ¶ added in v0.0.18
type ContainerResources struct { Memory *ContainerMemoryResources `tfsdk:"memory"` Cpu *ContainerCpuResources `tfsdk:"cpu"` }
type ContainerVolumeResource ¶ added in v0.0.14
type ContainerVolumeResource struct {
BaseHarnessResource
}
func (*ContainerVolumeResource) Create ¶ added in v0.0.14
func (r *ContainerVolumeResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (*ContainerVolumeResource) Metadata ¶ added in v0.0.14
func (r *ContainerVolumeResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*ContainerVolumeResource) Schema ¶ added in v0.0.14
func (r *ContainerVolumeResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
func (*ContainerVolumeResource) Update ¶ added in v0.0.14
func (r *ContainerVolumeResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
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"` }
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 (r *FeatureResource) Configure(_ context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (*FeatureResource) Create ¶
func (r *FeatureResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (*FeatureResource) Delete ¶
func (r *FeatureResource) Delete(_ context.Context, _ resource.DeleteRequest, _ *resource.DeleteResponse)
func (*FeatureResource) Metadata ¶
func (r *FeatureResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*FeatureResource) ModifyPlan ¶ added in v0.0.2
func (r *FeatureResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse)
ModifyPlan implements resource.ResourceWithModifyPlan.
func (*FeatureResource) Read ¶
func (r *FeatureResource) Read(_ context.Context, _ resource.ReadRequest, _ *resource.ReadResponse)
func (*FeatureResource) Schema ¶
func (r *FeatureResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
func (*FeatureResource) Update ¶
func (r *FeatureResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
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 FeatureStepModel ¶
type HarnessContainerEnvs ¶ added in v0.0.29
func (HarnessContainerEnvs) Slice ¶ added in v0.0.29
func (e HarnessContainerEnvs) Slice() []string
type HarnessDockerResource ¶ added in v0.0.15
type HarnessDockerResource struct {
BaseHarnessResource
}
HarnessDockerResource defines the resource implementation.
func (*HarnessDockerResource) Create ¶ added in v0.0.15
func (r *HarnessDockerResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (*HarnessDockerResource) Metadata ¶ added in v0.0.15
func (r *HarnessDockerResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*HarnessDockerResource) Schema ¶ added in v0.0.15
func (r *HarnessDockerResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
func (*HarnessDockerResource) Update ¶ added in v0.0.15
func (r *HarnessDockerResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
type HarnessDockerResourceModel ¶ added in v0.0.15
type HarnessDockerResourceModel struct { Id types.String `tfsdk:"id"` Name types.String `tfsdk:"name"` Inventory InventoryDataSourceModel `tfsdk:"inventory"` Volumes []FeatureHarnessVolumeMountModel `tfsdk:"volumes"` Image types.String `tfsdk:"image"` Privileged types.Bool `tfsdk:"privileged"` Envs *HarnessContainerEnvs `tfsdk:"envs"` Mounts []ContainerMountModel `tfsdk:"mounts"` Networks map[string]ContainerNetworkModel `tfsdk:"networks"` Registries map[string]DockerRegistryResourceModel `tfsdk:"registries"` Resources *ContainerResources `tfsdk:"resources"` Timeouts timeouts.Value `tfsdk:"timeouts"` }
HarnessDockerResourceModel describes the resource data model.
type HarnessHooksModel ¶ added in v0.0.24
type HarnessK3sResource ¶
type HarnessK3sResource struct {
BaseHarnessResource
}
HarnessK3sResource defines the resource implementation.
func (*HarnessK3sResource) Create ¶
func (r *HarnessK3sResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (*HarnessK3sResource) Metadata ¶
func (r *HarnessK3sResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*HarnessK3sResource) Schema ¶
func (r *HarnessK3sResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
func (*HarnessK3sResource) Update ¶
func (r *HarnessK3sResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
type HarnessK3sResourceModel ¶
type HarnessK3sResourceModel struct { Id types.String `tfsdk:"id"` Name types.String `tfsdk:"name"` Inventory InventoryDataSourceModel `tfsdk:"inventory"` Timeouts timeouts.Value `tfsdk:"timeouts"` Image types.String `tfsdk:"image"` DisableCni types.Bool `tfsdk:"disable_cni"` DisableNetworkPolicy types.Bool `tfsdk:"disable_network_policy"` DisableTraefik types.Bool `tfsdk:"disable_traefik"` DisableMetricsServer types.Bool `tfsdk:"disable_metrics_server"` Registries map[string]RegistryResourceModel `tfsdk:"registries"` Networks map[string]ContainerNetworkModel `tfsdk:"networks"` Sandbox types.Object `tfsdk:"sandbox"` Resources *ContainerResources `tfsdk:"resources"` Hooks *HarnessHooksModel `tfsdk:"hooks"` KubeletConfig types.String `tfsdk:"kubelet_config"` }
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 []ContainerMountModel `tfsdk:"mounts"` Networks map[string]ContainerNetworkModel `tfsdk:"networks"` }
type HarnessPterraformResource ¶ added in v0.0.29
type HarnessPterraformResource struct {
BaseHarnessResource
}
func (*HarnessPterraformResource) Create ¶ added in v0.0.29
func (r *HarnessPterraformResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (*HarnessPterraformResource) Metadata ¶ added in v0.0.29
func (r *HarnessPterraformResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*HarnessPterraformResource) Schema ¶ added in v0.0.29
func (r *HarnessPterraformResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
func (*HarnessPterraformResource) Update ¶ added in v0.0.29
func (r *HarnessPterraformResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
type HarnessPterraformResourceModel ¶ added in v0.0.29
type ImageTestProvider ¶
type ImageTestProvider struct {
// contains filtered or unexported fields
}
ImageTestProvider defines the provider implementation.
func (*ImageTestProvider) Configure ¶
func (p *ImageTestProvider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse)
func (*ImageTestProvider) DataSources ¶
func (p *ImageTestProvider) DataSources(ctx context.Context) []func() datasource.DataSource
func (*ImageTestProvider) Metadata ¶
func (p *ImageTestProvider) Metadata(ctx context.Context, req provider.MetadataRequest, resp *provider.MetadataResponse)
func (*ImageTestProvider) Resources ¶
func (p *ImageTestProvider) Resources(_ context.Context) []func() resource.Resource
func (*ImageTestProvider) Schema ¶
func (p *ImageTestProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse)
type ImageTestProviderHarnessModel ¶
type ImageTestProviderHarnessModel struct { K3s *ProviderHarnessK3sModel `tfsdk:"k3s"` Docker *ProviderHarnessDockerModel `tfsdk:"docker"` Cluster *ProviderHarnessClusterModel `tfsdk:"cluster"` }
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 (d *InventoryDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse)
func (*InventoryDataSource) Metadata ¶ added in v0.0.2
func (d *InventoryDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse)
func (*InventoryDataSource) Read ¶ added in v0.0.2
func (d *InventoryDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
func (*InventoryDataSource) Schema ¶ added in v0.0.2
func (d *InventoryDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse)
type InventoryDataSourceModel ¶ added in v0.0.2
InventoryDataSourceModel describes the data source data model.
type ProviderHarnessClusterModel ¶ added in v0.0.26
type ProviderHarnessClusterModel struct {
Kubeconfig *string `tfsdk:"kubeconfig"`
}
type ProviderHarnessContainerSandboxResourceModel ¶ added in v0.0.18
type ProviderHarnessDockerModel ¶ added in v0.0.15
type ProviderHarnessDockerModel struct { HostSocketPath *string `tfsdk:"host_socket_path"` Networks map[string]ContainerNetworkModel `tfsdk:"networks"` Envs *HarnessContainerEnvs `tfsdk:"envs"` Mounts []ContainerMountModel `tfsdk:"mounts"` Registries map[string]DockerRegistryResourceModel `tfsdk:"registries"` }
type ProviderHarnessK3sModel ¶
type ProviderHarnessK3sModel struct { Networks map[string]ContainerNetworkModel `tfsdk:"networks"` Registries map[string]RegistryResourceModel `tfsdk:"registries"` Sandbox *ProviderHarnessContainerSandboxResourceModel `tfsdk:"sandbox"` }
type ProviderLoggerFileModel ¶ added in v0.0.19
type ProviderLoggerModel ¶ added in v0.0.2
type ProviderLoggerModel struct {
File *ProviderLoggerFileModel `tfsdk:"file"`
}
type ProviderStore ¶
type ProviderStore struct {
// contains filtered or unexported fields
}
ProviderStore manages the global runtime state of the provider. The provider uses this to look up the defined relationships between resources, and manage shared external state.
func NewProviderStore ¶
func NewProviderStore() *ProviderStore
func (*ProviderStore) AddHarness ¶ added in v0.0.29
func (s *ProviderStore) AddHarness(id string, harness harness.Harness)
func (*ProviderStore) EnableDebugLogging ¶ added in v0.0.18
func (s *ProviderStore) EnableDebugLogging() bool
func (*ProviderStore) Encode ¶ added in v0.0.2
func (s *ProviderStore) Encode(components ...string) (string, error)
func (*ProviderStore) GetHarness ¶ added in v0.0.29
func (s *ProviderStore) GetHarness(id string) (harness.Harness, bool)
func (*ProviderStore) Inventory ¶ added in v0.0.2
func (s *ProviderStore) Inventory(data InventoryDataSourceModel) inventory.Inventory
Inventory returns an instance of the inventory per inventory data source.
func (*ProviderStore) Logger ¶ added in v0.0.2
func (s *ProviderStore) Logger(ctx context.Context, inv InventoryDataSourceModel, withs ...any) (context.Context, error)
Logger initializes the context logger for the given inventory.
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 RegistryResourceModel ¶
type RegistryResourceModel struct { Auth *RegistryResourceAuthModel `tfsdk:"auth"` Tls *RegistryResourceTlsModel `tfsdk:"tls"` Mirror *RegistryResourceMirrorModel `tfsdk:"mirror"` }