tide

package
v0.2.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 33 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

DefaultScheme returns the default runtime.Scheme.

func InstallOperator

func InstallOperator(
	ctx context.Context,
	operator *oceanv1alpha1.OceanComponent,
	clientGetter genericclioptions.RESTClientGetter,
	wait, dryRun bool,
	timeout time.Duration,
	log log.Logger,
) error

InstallOperator installs the Ocean Operator.

func LoadConfig

func LoadConfig(ctx context.Context, client client.Client) (*config.Value, error)

func LoadCredentials

func LoadCredentials(ctx context.Context, client client.Client) (*credentials.Value, error)

func NewConfigFlags

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

func NewControllerRuntimeClient

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

func NewOperatorOceanComponent

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

NewOperatorOceanComponent returns an oceanv1alpha1.OceanComponent representing the Ocean Operator.

func UninstallOperator

func UninstallOperator(
	ctx context.Context,
	operator *oceanv1alpha1.OceanComponent,
	clientGetter genericclioptions.RESTClientGetter,
	wait, dryRun bool,
	timeout time.Duration,
	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 ChartOption

type ChartOption interface {
	// MutateChartOptions applies this configuration to the given ChartOptions.
	MutateChartOptions(options *ChartOptions)
}

ChartOption is some configuration that modifies options for a Helm chart.

func WithChartName

func WithChartName(name string) ChartOption

WithChartName sets the given chart name.

func WithChartNamespace

func WithChartNamespace(namespace string) ChartOption

WithChartNamespace sets the given chart namespace.

func WithChartURL

func WithChartURL(url string) ChartOption

WithChartURL sets the given chart URL.

func WithChartValues

func WithChartValues(values string) ChartOption

WithChartValues sets the given chart values.

func WithChartVersion

func WithChartVersion(version string) ChartOption

WithChartVersion sets the given chart version.

type ChartOptionFunc

type ChartOptionFunc func(options *ChartOptions)

ChartOptionFunc is a convenience type like http.HandlerFunc.

func (ChartOptionFunc) MutateChartOptions

func (f ChartOptionFunc) MutateChartOptions(options *ChartOptions)

MutateChartOptions implements the ChartOption interface.

type ChartOptions

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

ChartOptions contains Helm chart 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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