Documentation
¶
Overview ¶
Package infra contains boilerplate code for the infra provider implementations.
Index ¶
- func ResourceNamespace(providerID string) string
- func ResourceType(name, providerID string) string
- type HealthCheckFunc
- type Option
- func WithClientOptions(options ...client.Option) Option
- func WithConcurrency(value uint) Option
- func WithHealthCheckFunc(healthCheckFunc HealthCheckFunc) Option
- func WithHealthCheckInterval(interval time.Duration) Option
- func WithImageFactoryClient(imageFactory provision.FactoryClient) Option
- func WithOmniEndpoint(value string) Option
- func WithState(state state.State) Option
- type Options
- type Provider
- type ProviderConfig
- type RD
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResourceNamespace ¶
ResourceNamespace generates the correct namespace name for the infra provider state.
func ResourceType ¶
ResourceType generates the correct resource name for the resources managed by the infra providers.
Types ¶
type HealthCheckFunc ¶ added in v0.46.0
HealthCheckFunc defines a function that checks the health of the infra provider.
type Option ¶
type Option func(*Options)
Option define an additional infra provider option.
func WithClientOptions ¶
WithClientOptions defines custom options for the Omni API client.
func WithConcurrency ¶
WithConcurrency sets maximum provision concurrency on the controller.
func WithHealthCheckFunc ¶ added in v0.46.0
func WithHealthCheckFunc(healthCheckFunc HealthCheckFunc) Option
WithHealthCheckFunc sets the health check function for the infra provider.
The health check function should return a descriptive error if the provider is unhealthy.
func WithHealthCheckInterval ¶ added in v0.46.0
WithHealthCheckInterval sets the health check interval for the infra provider.
func WithImageFactoryClient ¶
func WithImageFactoryClient(imageFactory provision.FactoryClient) Option
WithImageFactoryClient sets up the image factory client explicitly.
func WithOmniEndpoint ¶
WithOmniEndpoint sets Omni API client endpoint to use.
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options defines additional infra provider options.
type Provider ¶
type Provider[T generic.ResourceWithRD] struct { // contains filtered or unexported fields }
Provider runner.
func NewProvider ¶
func NewProvider[V any, T RD[V]]( id string, provisioner provision.Provisioner[T], config ProviderConfig, ) (*Provider[T], error)
NewProvider creates a new infra provider and registers provider state resource in the COSI state.
type ProviderConfig ¶ added in v0.45.0
type ProviderConfig struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Icon string `yaml:"icon,omitempty"`
Schema string `yaml:"schema"`
}
ProviderConfig defines the schema, human-readable provider name and description.
func ParseProviderConfig ¶ added in v0.45.0
func ParseProviderConfig(data []byte) (ProviderConfig, error)
ParseProviderConfig loads provider config from the yaml data.
type RD ¶
type RD[V any] interface { generic.ResourceWithRD protobuf.ResourceUnmarshaler *V }
RD defines contract for the resource definition.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package controllers implements common controllers for the infra providers.
|
Package controllers implements common controllers for the infra providers. |
|
Package imagefactory implements factory clients used in the infra providers.
|
Package imagefactory implements factory clients used in the infra providers. |
|
internal
|
|
|
resources
Package resources contains COSI resource helpers for the infra provider.
|
Package resources contains COSI resource helpers for the infra provider. |
|
Package provision defines the interface for the infra provisioner.
|
Package provision defines the interface for the infra provisioner. |