Documentation ¶
Index ¶
Constants ¶
const FakeTerraformVersion string = "v0.13.5"
FakeTerraformVersion is a nice lie we tell to providers to keep them happy TODO: is there a more sane way to negotiate version compat w/ providers?
const ProviderPluginType = "provider"
Variables ¶
var DefaultProviderPoolSize = 5
Functions ¶
func GetProviderSchema ¶
func GetProviderSchema(p *Provider) (*configschema.Block, error)
func NewGRPCProvider ¶
func NewGRPCProvider(providerName, pluginPath string) (*tfplugin.GRPCProvider, error)
NewGRPCProvider creates a new GRPCClient instance.
Types ¶
type Initializer ¶
type Initializer func(context.Context, resource.Managed, *RuntimeOptions, kubeclient.Client) (*Provider, error)
type Provider ¶
type Provider struct { GRPCProvider *tfplugin.GRPCProvider Name string Config ProviderConfig }
Provider wraps grpcProvider with some additional metadata like the provider name
func NewProvider ¶
NewProvider constructs a Provider, which is a container type, holding a terraform provider plugin grpc client, as well as metadata about this provider instance, eg its configuration and type.
type ProviderConfig ¶
ProviderConfig models the on-disk yaml config for providers
func ReadProviderConfigFile ¶
func ReadProviderConfigFile(path string) (ProviderConfig, error)
ReadProviderConfigFile reads a yaml-formatted provider config and unmarshals it into a ProviderConfig, which knows how to generate the serialized provider config that a terraform provider expects.
type ProviderPool ¶
type ProviderPool struct {
// contains filtered or unexported fields
}
func NewProviderPool ¶
func NewProviderPool(initializer Initializer, ropts *RuntimeOptions) *ProviderPool
func (*ProviderPool) Borrow ¶
func (pp *ProviderPool) Borrow(ctx context.Context, res resource.Managed, kube kubeclient.Client) (*Provider, error)
func (*ProviderPool) Return ¶
func (pp *ProviderPool) Return(p *Provider)
type RuntimeOptions ¶
func NewRuntimeOptions ¶
func NewRuntimeOptions() *RuntimeOptions
func (*RuntimeOptions) WithPluginPath ¶
func (ro *RuntimeOptions) WithPluginPath(path string) *RuntimeOptions
func (*RuntimeOptions) WithPoolSize ¶
func (ro *RuntimeOptions) WithPoolSize(size int) *RuntimeOptions