controller

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: Apache-2.0 Imports: 15 Imported by: 43

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APICallbacks

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

APICallbacks providers callbacks that work on API resources.

func NewAPICallbacks

func NewAPICallbacks(m ctrl.Manager, of xpresource.ManagedKind) *APICallbacks

NewAPICallbacks returns a new APICallbacks.

func (*APICallbacks) Apply

func (ac *APICallbacks) Apply(name string) terraform.CallbackFn

Apply makes sure the error is saved in async operation condition.

func (*APICallbacks) Destroy

func (ac *APICallbacks) Destroy(name string) terraform.CallbackFn

Destroy makes sure the error is saved in async operation condition.

type APISecretClient

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

APISecretClient is a client for getting k8s secrets

func (*APISecretClient) GetSecretData

func (a *APISecretClient) GetSecretData(ctx context.Context, ref *xpv1.SecretReference) (map[string][]byte, error)

GetSecretData gets and returns data for the referenced secret

func (*APISecretClient) GetSecretValue

func (a *APISecretClient) GetSecretValue(ctx context.Context, sel xpv1.SecretKeySelector) ([]byte, error)

GetSecretValue gets and returns value for key of the referenced secret

type CallbackProvider

type CallbackProvider interface {
	Apply(name string) terraform.CallbackFn
	Destroy(name string) terraform.CallbackFn
}

CallbackProvider provides functions that can be called with the result of async operations.

type Connector

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

Connector initializes the external client with credentials and other configuration parameters.

func NewConnector

func NewConnector(kube client.Client, ws Store, sf terraform.SetupFn, cfg *config.Resource, opts ...Option) *Connector

NewConnector returns a new Connector object.

func (*Connector) Connect

Connect makes sure the underlying client is ready to issue requests to the provider API.

type Option

type Option func(*Connector)

Option allows you to configure Connector.

func WithCallbackProvider

func WithCallbackProvider(ac CallbackProvider) Option

WithCallbackProvider configures the controller to use async variant of the functions of the Terraform client and run given callbacks once those operations are completed.

type Options added in v0.4.0

type Options struct {
	controller.Options

	// Provider contains all resource configurations of the provider which can
	// be used to pick the related one. Since the selection is done in runtime,
	// we need to pass everything and generated code will pick the one.
	Provider *config.Provider

	// WorkspaceStore will be used to pick/initialize the workspace the specific CR
	// instance should use.
	WorkspaceStore *terraform.WorkspaceStore

	// SetupFn contains the provider-specific initialization logic, such as
	// preparing the auth token for Terraform CLI.
	SetupFn terraform.SetupFn
}

Options contains incriminating options for a given Terrajet controller instance.

type Store

type Store interface {
	Workspace(ctx context.Context, c resource.SecretClient, tr resource.Terraformed, ts terraform.Setup, cfg *config.Resource) (*terraform.Workspace, error)
}

Store is where we can get access to the Terraform workspace of given resource.

type Workspace

Workspace is the set of methods that are needed for the controller to work.

Jump to

Keyboard shortcuts

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