tide

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OceanOperatorDeployment = "ocean-operator"
	OceanOperatorConfigMap  = "ocean-operator"
	OceanOperatorSecret     = "ocean-operator"
	OceanOperatorChart      = "ocean-operator"
	OceanOperatorRepository = "https://charts.spot.io"
	OceanOperatorVersion    = "" // empty string indicates the latest chart version
	OceanOperatorValues     = ""

	LegacyOceanControllerDeployment = "spotinst-kubernetes-cluster-controller"
	LegacyOceanControllerSecret     = "spotinst-kubernetes-cluster-controller"
	LegacyOceanControllerConfigMap  = "spotinst-kubernetes-cluster-controller-config"
)

Variables

This section is empty.

Functions

func DefaultScheme

func DefaultScheme() *runtime.Scheme

func InstallOperator

func InstallOperator(
	ctx context.Context,
	operator *oceanv1alpha1.OceanComponent,
	clientGetter genericclioptions.RESTClientGetter,
	log log.Logger,
) error

InstallOperator installs the Ocean Operator.

func NewConfigFlags

func NewConfigFlags(config *rest.Config, namespace string) *genericclioptions.ConfigFlags

func NewControllerRuntimeClient

func NewControllerRuntimeClient(config *rest.Config, scheme *runtime.Scheme) (ctrlrt.Client, error)

func NewOperatorOceanComponent

func NewOperatorOceanComponent(options ...OperatorChartOption) *oceanv1alpha1.OceanComponent

NewOperatorOceanComponent returns an oceanv1alpha1.OceanComponent representing the Ocean Operator.

func UninstallOperator

func UninstallOperator(
	ctx context.Context,
	operator *oceanv1alpha1.OceanComponent,
	clientGetter genericclioptions.RESTClientGetter,
	log log.Logger,
) error

UninstallOperator uninstalls the Ocean Operator.

Types

type Applier

type Applier interface {
	// ApplyEnvironment applies all resources.
	ApplyEnvironment(
		ctx context.Context,
		options ...ApplyOption) error
	// ApplyComponents applies component resources.
	ApplyComponents(
		ctx context.Context,
		components []*oceanv1alpha1.OceanComponent,
		options ...ApplyOption) error
	// ApplyCRDs applies CRD resources.
	ApplyCRDs(
		ctx context.Context,
		crds []*apiextensionsv1.CustomResourceDefinition,
		options ...ApplyOption) error
	// ApplyRBAC applies RBAC resources.
	ApplyRBAC(
		ctx context.Context,
		serviceAccount *corev1.ServiceAccount,
		roleBinding *rbacv1.ClusterRoleBinding,
		options ...ApplyOption) error
}

Applier defines the interface used for applying cluster resources.

type ApplyOption

type ApplyOption interface {
	// MutateApplyOptions applies this configuration to the given ApplyOptions.
	MutateApplyOptions(options *ApplyOptions)
}

ApplyOption is some configuration that modifies options for an apply request.

type ApplyOptionFunc

type ApplyOptionFunc func(options *ApplyOptions)

ApplyOptionFunc is a convenience type like http.HandlerFunc.

func (ApplyOptionFunc) MutateApplyOptions

func (f ApplyOptionFunc) MutateApplyOptions(options *ApplyOptions)

MutateApplyOptions implements the ApplyOption interface.

type ApplyOptions

type ApplyOptions struct {
	Namespace        string
	ComponentsFilter map[oceanv1alpha1.OceanComponentName]struct{}
}

ApplyOptions contains apply options.

type ComponentsFilter

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

ComponentsFilter filters components to be applied or deleted.

func WithComponentsFilter

func WithComponentsFilter(components ...oceanv1alpha1.OceanComponentName) ComponentsFilter

WithComponentsFilter sets the given ComponentsFilter list.

func (ComponentsFilter) MutateApplyOptions

func (w ComponentsFilter) MutateApplyOptions(options *ApplyOptions)

MutateApplyOptions implements the ApplyOption interface.

type DeleteOption

type DeleteOption interface {
	// MutateDeleteOptions applies this configuration to the given DeleteOptions.
	MutateDeleteOptions(options *DeleteOptions)
}

DeleteOption is some configuration that modifies options for a delete request.

type DeleteOptionFunc

type DeleteOptionFunc func(options *DeleteOptions)

DeleteOptionFunc is a convenience type like http.HandlerFunc.

func (DeleteOptionFunc) MutateDeleteOptions

func (f DeleteOptionFunc) MutateDeleteOptions(options *DeleteOptions)

MutateDeleteOptions implements the DeleteOption interface.

type DeleteOptions

type DeleteOptions struct {
	Namespace string
}

DeleteOptions contains delete options.

type Deleter

type Deleter interface {
	// DeleteEnvironment deletes all resources.
	DeleteEnvironment(
		ctx context.Context,
		options ...DeleteOption) error
	// DeleteComponents deletes component resources.
	DeleteComponents(
		ctx context.Context,
		components []oceanv1alpha1.OceanComponent,
		options ...DeleteOption) error
	// DeleteCRDs deletes CRD resources.
	DeleteCRDs(
		ctx context.Context,
		crds []apiextensionsv1.CustomResourceDefinition,
		options ...DeleteOption) error
	// DeleteRBAC deletes RBAC resources.
	DeleteRBAC(
		ctx context.Context,
		serviceAccount, roleBinding string,
		options ...DeleteOption) error
}

Deleter defines the interface used for deleting cluster resources.

type Manager

type Manager interface {
	Applier
	Deleter
}

Manager defines the interface used for managing cluster resources.

func NewManager

func NewManager(clientGetter genericclioptions.RESTClientGetter, log log.Logger) (Manager, error)

type Namespace

type Namespace string

Namespace determines where components should be applied or deleted.

func WithNamespace

func WithNamespace(namespace string) Namespace

WithNamespace sets the given namespace.

func (Namespace) MutateApplyOptions

func (w Namespace) MutateApplyOptions(options *ApplyOptions)

MutateApplyOptions implements the ApplyOption interface.

func (Namespace) MutateDeleteOptions

func (w Namespace) MutateDeleteOptions(options *DeleteOptions)

MutateDeleteOptions implements the DeleteOption interface.

type OperatorChartOption

type OperatorChartOption interface {
	// MutateOperatorChartOptions applies this configuration to the given OperatorChartOptions.
	MutateOperatorChartOptions(options *OperatorChartOptions)
}

OperatorChartOption is some configuration that modifies options for an Operator.

func WithOperatorChartName

func WithOperatorChartName(name string) OperatorChartOption

WithOperatorChartName sets the given chart name.

func WithOperatorChartNamespace

func WithOperatorChartNamespace(namespace string) OperatorChartOption

WithOperatorChartNamespace sets the given chart namespace.

func WithOperatorChartURL

func WithOperatorChartURL(url string) OperatorChartOption

WithOperatorChartURL sets the given chart URL.

func WithOperatorChartValues

func WithOperatorChartValues(values string) OperatorChartOption

WithOperatorChartValues sets the given chart values.

func WithOperatorChartVersion

func WithOperatorChartVersion(version string) OperatorChartOption

WithOperatorChartVersion sets the given chart version.

type OperatorChartOptionFunc

type OperatorChartOptionFunc func(options *OperatorChartOptions)

OperatorChartOptionFunc is a convenience type like http.HandlerFunc.

func (OperatorChartOptionFunc) MutateOperatorChartOptions

func (f OperatorChartOptionFunc) MutateOperatorChartOptions(options *OperatorChartOptions)

MutateOperatorChartOptions implements the OperatorChartOption interface.

type OperatorChartOptions

type OperatorChartOptions struct {
	Name      string
	Namespace string
	URL       string
	Version   string
	Values    string
}

OperatorChartOptions contains Ocean Operator chart options.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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