operators

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: Apache-2.0 Imports: 33 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SupportedOperators = map[OperatorType]OperatorSetupBuilder{

		OperatorTypeBroker: &BrokerOperatorBuilder{BaseOperatorBuilder{
			image:        "quay.io/artemiscloud/activemq-artemis-operator:latest",
			operatorName: "activemq-artemis-operator",
			keepCdrs:     true,
			apiVersion:   "v1alpha1",
		}},
		OperatorTypeSkupper: &SkupperOperatorBuilder{BaseOperatorBuilder: BaseOperatorBuilder{
			operatorName: "skupper-router",
		}},
	}
)

Functions

This section is empty.

Types

type BaseOperator

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

func (*BaseOperator) APIVersion

func (b *BaseOperator) APIVersion() string

func (*BaseOperator) CRDNames

func (b *BaseOperator) CRDNames() []string

func (*BaseOperator) CreateDeployment added in v0.2.8

func (b *BaseOperator) CreateDeployment() error

func (*BaseOperator) CreateResourcesFromYAML added in v0.2.5

func (b *BaseOperator) CreateResourcesFromYAML(fileOrUrl string) error

CreateResourcesFromYAML creates all resources from the provided YAML file or URL using an initialized VanClient instance.

func (*BaseOperator) CreateResourcesFromYAMLBytes added in v0.2.5

func (b *BaseOperator) CreateResourcesFromYAMLBytes(yamlData []byte) error

func (*BaseOperator) DeleteDeployment added in v0.2.8

func (b *BaseOperator) DeleteDeployment() error

func (*BaseOperator) DeleteResourcesFromYAMLBytes added in v0.2.5

func (b *BaseOperator) DeleteResourcesFromYAMLBytes(yamlData []byte) error

func (*BaseOperator) GetDeployment added in v0.2.8

func (b *BaseOperator) GetDeployment() (*appsv1.Deployment, error)

func (*BaseOperator) GroupName

func (b *BaseOperator) GroupName() string

func (*BaseOperator) Image

func (b *BaseOperator) Image() string

func (*BaseOperator) InitFromBaseOperatorBuilder

func (b *BaseOperator) InitFromBaseOperatorBuilder(builder *BaseOperatorBuilder) error

func (*BaseOperator) Interface

func (b *BaseOperator) Interface() interface{}

func (*BaseOperator) Name

func (b *BaseOperator) Name() string

func (*BaseOperator) Namespace

func (b *BaseOperator) Namespace() string

func (*BaseOperator) Setup

func (b *BaseOperator) Setup() error

func (*BaseOperator) SetupYamls

func (b *BaseOperator) SetupYamls() error

func (*BaseOperator) TeardownEach

func (b *BaseOperator) TeardownEach() error

func (*BaseOperator) TeardownSuite

func (b *BaseOperator) TeardownSuite() error

func (*BaseOperator) UpdateDeployment added in v0.2.8

func (b *BaseOperator) UpdateDeployment(deployment *appsv1.Deployment) error

type BaseOperatorBuilder

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

All the base operator stuff goes into this class. All operator-specific things go into specific classes.

func (*BaseOperatorBuilder) AddYamlURL added in v0.1.3

func (b *BaseOperatorBuilder) AddYamlURL(yaml string) OperatorSetupBuilder

func (*BaseOperatorBuilder) Build

func (b *BaseOperatorBuilder) Build() (OperatorSetup, error)

func (*BaseOperatorBuilder) Finalize

func (*BaseOperatorBuilder) KeepCdr

func (b *BaseOperatorBuilder) KeepCdr(keepCdrs bool) OperatorSetupBuilder

func (*BaseOperatorBuilder) NewBuilder

func (b *BaseOperatorBuilder) NewBuilder(restConfig *rest.Config, rawConfig *clientcmdapi.Config) OperatorSetupBuilder

func (*BaseOperatorBuilder) OperatorType

func (b *BaseOperatorBuilder) OperatorType() OperatorType

func (*BaseOperatorBuilder) SetAdminUnavailable added in v0.1.4

func (b *BaseOperatorBuilder) SetAdminUnavailable() OperatorSetupBuilder

When CRDs are already created on the cluster in question, we don't need to do anything with them.

func (*BaseOperatorBuilder) SetOperatorName added in v0.1.4

func (b *BaseOperatorBuilder) SetOperatorName(operatorName string) OperatorSetupBuilder

Allows for custom named operators to exist

func (*BaseOperatorBuilder) WithApiVersion

func (b *BaseOperatorBuilder) WithApiVersion(apiVersion string) OperatorSetupBuilder

func (*BaseOperatorBuilder) WithCommand

func (b *BaseOperatorBuilder) WithCommand(command string) OperatorSetupBuilder

func (*BaseOperatorBuilder) WithGlobalNamespace added in v0.2.6

func (b *BaseOperatorBuilder) WithGlobalNamespace() OperatorSetupBuilder

func (*BaseOperatorBuilder) WithImage

func (b *BaseOperatorBuilder) WithImage(image string) OperatorSetupBuilder

func (*BaseOperatorBuilder) WithNamespace

func (b *BaseOperatorBuilder) WithNamespace(namespace string) OperatorSetupBuilder

func (*BaseOperatorBuilder) WithOperatorName

func (b *BaseOperatorBuilder) WithOperatorName(name string) OperatorSetupBuilder

func (*BaseOperatorBuilder) WithYamlURLs added in v0.1.3

func (b *BaseOperatorBuilder) WithYamlURLs(yamls []string) OperatorSetupBuilder

func (*BaseOperatorBuilder) WithYamls

func (b *BaseOperatorBuilder) WithYamls(yamls [][]byte) OperatorSetupBuilder

Pass loaded yamls objects instead of URLs

type BrokerOperator

type BrokerOperator struct {
	BaseOperator
	// contains filtered or unexported fields
}

func (*BrokerOperator) APIVersion

func (b *BrokerOperator) APIVersion() string

func (*BrokerOperator) CRDNames

func (b *BrokerOperator) CRDNames() []string

func (*BrokerOperator) CreateDeployment added in v0.2.8

func (b *BrokerOperator) CreateDeployment() error

func (*BrokerOperator) DeleteDeployment added in v0.2.8

func (b *BrokerOperator) DeleteDeployment() error

func (*BrokerOperator) GetDeployment added in v0.2.8

func (b *BrokerOperator) GetDeployment() (*appsv1.Deployment, error)

func (*BrokerOperator) GroupName

func (b *BrokerOperator) GroupName() string

func (*BrokerOperator) Image

func (b *BrokerOperator) Image() string

func (*BrokerOperator) Interface

func (b *BrokerOperator) Interface() interface{}

func (*BrokerOperator) Name

func (b *BrokerOperator) Name() string

func (*BrokerOperator) Namespace

func (b *BrokerOperator) Namespace() string

func (*BrokerOperator) Setup

func (b *BrokerOperator) Setup() error

func (*BrokerOperator) TeardownEach

func (b *BrokerOperator) TeardownEach() error

func (*BrokerOperator) TeardownSuite

func (b *BrokerOperator) TeardownSuite() error

func (*BrokerOperator) UpdateDeployment added in v0.2.8

func (b *BrokerOperator) UpdateDeployment(deployment *appsv1.Deployment) error

type BrokerOperatorBuilder

type BrokerOperatorBuilder struct {
	BaseOperatorBuilder
}

Reusing BaseOperatorBuilder implementation and adding the "abstract" method Build() and OperatorType()

func (*BrokerOperatorBuilder) Build

func (*BrokerOperatorBuilder) OperatorType

func (b *BrokerOperatorBuilder) OperatorType() OperatorType

type DefinitionStruct

type DefinitionStruct struct {
	ApiVersion string      `json:"apiVersion"`
	Kind       string      `json:"kind"`
	Metadata   interface{} `json:"metadata"`
	Spec       interface{} `json:"spec"`
}

type OperatorSetup

type OperatorSetup interface {
	Interface() interface{}
	Namespace() string
	Image() string
	Name() string
	CRDNames() []string
	GroupName() string
	APIVersion() string
	Setup() error
	UpdateDeployment(deployment *appsv1.Deployment) error
	DeleteDeployment() error
	CreateDeployment() error
	GetDeployment() (*appsv1.Deployment, error)
	TeardownEach() error
	TeardownSuite() error
}

type OperatorSetupBuilder

type OperatorSetupBuilder interface {
	NewBuilder(restConfig *rest.Config, rawConfig *clientcmdapi.Config) OperatorSetupBuilder
	WithNamespace(namespace string) OperatorSetupBuilder
	WithImage(image string) OperatorSetupBuilder
	WithCommand(command string) OperatorSetupBuilder
	WithYamlURLs(yamls []string) OperatorSetupBuilder
	AddYamlURL(yaml string) OperatorSetupBuilder
	WithOperatorName(name string) OperatorSetupBuilder
	KeepCdr(keepCdrs bool) OperatorSetupBuilder
	SetAdminUnavailable() OperatorSetupBuilder
	SetOperatorName(operatorName string) OperatorSetupBuilder
	WithApiVersion(apiVersion string) OperatorSetupBuilder
	WithYamls(yamls [][]byte) OperatorSetupBuilder
	WithGlobalNamespace() OperatorSetupBuilder
	Build() (OperatorSetup, error)
	OperatorType() OperatorType
}

type OperatorType

type OperatorType int
const (
	OperatorTypeQdr OperatorType = iota
	OperatorTypeBroker
	OperatorTypeSkupper
)

type SkupperOperator added in v0.1.2

type SkupperOperator struct {
	BaseOperator
	ClusterLocal    bool
	Id              string
	QdrouterdImage  string
	ControllerImage string
	ProxyImage      string
	SkupperPath     string
}

func (*SkupperOperator) CreateDeployment added in v0.2.8

func (b *SkupperOperator) CreateDeployment() error

func (*SkupperOperator) DeleteDeployment added in v0.2.8

func (b *SkupperOperator) DeleteDeployment() error

func (*SkupperOperator) GetDeployment added in v0.2.8

func (b *SkupperOperator) GetDeployment() (*appsv1.Deployment, error)

func (*SkupperOperator) Name added in v0.1.2

func (s *SkupperOperator) Name() string

func (*SkupperOperator) Setup added in v0.1.2

func (s *SkupperOperator) Setup() error

func (*SkupperOperator) SkupperBin added in v0.1.2

func (s *SkupperOperator) SkupperBin() string

func (*SkupperOperator) TeardownEach added in v0.1.2

func (s *SkupperOperator) TeardownEach() error

func (*SkupperOperator) TeardownSuite added in v0.1.2

func (s *SkupperOperator) TeardownSuite() error

func (*SkupperOperator) UpdateDeployment added in v0.2.8

func (b *SkupperOperator) UpdateDeployment(deployment *appsv1.Deployment) error

type SkupperOperatorBuilder added in v0.1.2

type SkupperOperatorBuilder struct {
	BaseOperatorBuilder
	// contains filtered or unexported fields
}

SkupperOperatorBuilder helps building a skupper operator that uses

the CLI skupper. Once the API is available
we can create a second skupper operator to
test both api and cli.

func (*SkupperOperatorBuilder) Build added in v0.1.2

func (*SkupperOperatorBuilder) ClusterLocal added in v0.1.2

func (b *SkupperOperatorBuilder) ClusterLocal(local bool)

func (*SkupperOperatorBuilder) OperatorType added in v0.1.2

func (s *SkupperOperatorBuilder) OperatorType() OperatorType

func (*SkupperOperatorBuilder) SkupperId added in v0.1.2

func (b *SkupperOperatorBuilder) SkupperId(id string)

func (*SkupperOperatorBuilder) WithControllerImage added in v0.1.2

func (b *SkupperOperatorBuilder) WithControllerImage(image string)

func (*SkupperOperatorBuilder) WithProxyImage added in v0.1.2

func (b *SkupperOperatorBuilder) WithProxyImage(image string)

func (*SkupperOperatorBuilder) WithQdrouterdImage added in v0.1.2

func (b *SkupperOperatorBuilder) WithQdrouterdImage(image string)

func (*SkupperOperatorBuilder) WithSkupperPath added in v0.1.2

func (b *SkupperOperatorBuilder) WithSkupperPath(path string)

Jump to

Keyboard shortcuts

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