referenceaddon

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidBoolValue = errors.New("invalid bool value")

Functions

This section is empty.

Types

type ApplyNetorkPoliciesConfig

type ApplyNetorkPoliciesConfig struct {
	Owner    metav1.Object
	Policies []netv1.NetworkPolicy
}

func (*ApplyNetorkPoliciesConfig) Option

type ApplyNetorkPoliciesOption

type ApplyNetorkPoliciesOption interface {
	ConfigureApplyNetworkPolicies(c *ApplyNetorkPoliciesConfig)
}

type CSVClient

type CSVClient interface {
	ListCSVs(ctx context.Context, opts ...ListCSVsOption) ([]opsv1alpha1.ClusterServiceVersion, error)
	RemoveCSVs(ctx context.Context, csvs ...opsv1alpha1.ClusterServiceVersion) error
}

type CSVClientImpl

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

func NewCSVClientImpl

func NewCSVClientImpl(client client.Client, opts ...CSVClientOption) *CSVClientImpl

func (*CSVClientImpl) ListCSVs

func (*CSVClientImpl) RemoveCSVs

type CSVClientImplConfig

type CSVClientImplConfig struct {
	Log logr.Logger
}

func (*CSVClientImplConfig) Default

func (c *CSVClientImplConfig) Default()

func (*CSVClientImplConfig) Option

func (c *CSVClientImplConfig) Option(opts ...CSVClientOption)

type CSVClientOption

type CSVClientOption interface {
	ConfigureCSVClientImpl(*CSVClientImplConfig)
}

type ConfigMapUninstallSignaler

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

func (*ConfigMapUninstallSignaler) SignalUninstall

func (s *ConfigMapUninstallSignaler) SignalUninstall(ctx context.Context) bool

type ConfigMapUninstallSignalerConfig

type ConfigMapUninstallSignalerConfig struct {
	AddonNamespace string
	OperatorName   string
	DeleteLabel    string
}

func (*ConfigMapUninstallSignalerConfig) Option

func (*ConfigMapUninstallSignalerConfig) Validate

type ConfigMapUninstallSignalerOption

type ConfigMapUninstallSignalerOption interface {
	ConfigureConfigMapUninstallSignaler(*ConfigMapUninstallSignalerConfig)
}

type ListCSVsConfig

type ListCSVsConfig struct {
	Namespace string
	Prefix    string
}

func (*ListCSVsConfig) Option

func (c *ListCSVsConfig) Option(opts ...ListCSVsOption)

type ListCSVsOption

type ListCSVsOption interface {
	ConfigureListCSVs(*ListCSVsConfig)
}

type NetworkPolicyClient

type NetworkPolicyClient interface {
	ApplyNetworkPolicies(ctx context.Context, opts ...ApplyNetorkPoliciesOption) error
	RemoveNetworkPolicies(ctx context.Context, policies ...netv1.NetworkPolicy) error
}

type NetworkPolicyClientImpl

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

func NewNetworkPolicyClientImpl

func NewNetworkPolicyClientImpl(client client.Client) *NetworkPolicyClientImpl

func (*NetworkPolicyClientImpl) ApplyNetworkPolicies

func (c *NetworkPolicyClientImpl) ApplyNetworkPolicies(ctx context.Context, opts ...ApplyNetorkPoliciesOption) error

func (*NetworkPolicyClientImpl) RemoveNetworkPolicies

func (c *NetworkPolicyClientImpl) RemoveNetworkPolicies(ctx context.Context, policies ...netv1.NetworkPolicy) error

type ParameterGetter

type ParameterGetter interface {
	GetParameters(ctx context.Context) (PhaseRequestParameters, error)
}

type Phase

type Phase interface {
	Execute(ctx context.Context, req PhaseRequest) PhaseResult
}

type PhaseApplyNetworkPolicies

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

func (*PhaseApplyNetworkPolicies) Execute

type PhaseApplyNetworkPoliciesConfig

type PhaseApplyNetworkPoliciesConfig struct {
	Log logr.Logger

	Policies []netv1.NetworkPolicy
}

func (*PhaseApplyNetworkPoliciesConfig) Default

func (c *PhaseApplyNetworkPoliciesConfig) Default()

func (*PhaseApplyNetworkPoliciesConfig) Option

type PhaseApplyNetworkPoliciesOption

type PhaseApplyNetworkPoliciesOption interface {
	ConfigurePhaseApplyNetworkPolicies(*PhaseApplyNetworkPoliciesConfig)
}

type PhaseRequest

type PhaseRequest struct {
	Addon  refv1alpha1.ReferenceAddon
	Params PhaseRequestParameters
}

type PhaseRequestParameters

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

func (*PhaseRequestParameters) GetApplyNetworkPolicies

func (p *PhaseRequestParameters) GetApplyNetworkPolicies() (bool, bool)

func (*PhaseRequestParameters) GetEnableSmokeTest added in v0.9.0

func (p *PhaseRequestParameters) GetEnableSmokeTest() (bool, bool)

func (*PhaseRequestParameters) GetSize

func (p *PhaseRequestParameters) GetSize() (string, bool)

type PhaseRequestParametersConfig

type PhaseRequestParametersConfig struct {
	ApplyNetworkPolicies *bool
	EnableSmokeTest      *bool
	Size                 *string
}

func (*PhaseRequestParametersConfig) Option

type PhaseRequestParametersOption

type PhaseRequestParametersOption interface {
	ConfigurePhaseRequestParameters(*PhaseRequestParametersConfig)
}

type PhaseResult

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

func PhaseResultBlocking

func PhaseResultBlocking(opts ...PhaseResultOption) PhaseResult

func PhaseResultError

func PhaseResultError(err error, opts ...PhaseResultOption) PhaseResult

func PhaseResultFailure

func PhaseResultFailure(msg string, opts ...PhaseResultOption) PhaseResult

func PhaseResultSuccess

func PhaseResultSuccess(opts ...PhaseResultOption) PhaseResult

func (PhaseResult) Conditions

func (r PhaseResult) Conditions() []metav1.Condition

func (PhaseResult) Error

func (r PhaseResult) Error() error

func (PhaseResult) FailureMessage

func (r PhaseResult) FailureMessage() string

func (PhaseResult) Status

func (r PhaseResult) Status() PhaseStatus

type PhaseResultConfig

type PhaseResultConfig struct {
	Conditions []metav1.Condition
}

func (*PhaseResultConfig) Option

func (c *PhaseResultConfig) Option(opts ...PhaseResultOption)

type PhaseResultOption

type PhaseResultOption interface {
	ConfigurePhaseResult(c *PhaseResultConfig)
}

type PhaseSendDummyMetrics

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

func NewPhaseSendDummyMetrics

func NewPhaseSendDummyMetrics(sampler ResponseSampler, opts ...PhaseSendDummyMetricsOption) *PhaseSendDummyMetrics

func (*PhaseSendDummyMetrics) Execute

type PhaseSendDummyMetricsConfig

type PhaseSendDummyMetricsConfig struct {
	SampleURLs []string
}

func (*PhaseSendDummyMetricsConfig) Option

type PhaseSendDummyMetricsOption

type PhaseSendDummyMetricsOption interface {
	ConfigurePhaseSendDummyMetrics(*PhaseSendDummyMetricsConfig)
}

type PhaseSmokeTestRun added in v0.9.0

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

func NewPhaseSmokeTestRun added in v0.9.0

func NewPhaseSmokeTestRun(opts ...PhaseSmokeTestRunOption) *PhaseSmokeTestRun

func (*PhaseSmokeTestRun) Execute added in v0.9.0

type PhaseSmokeTestRunConfig added in v0.9.0

type PhaseSmokeTestRunConfig struct {
	Log logr.Logger

	SmokeTester SmokeTester
}

func (*PhaseSmokeTestRunConfig) Default added in v0.9.0

func (c *PhaseSmokeTestRunConfig) Default()

func (*PhaseSmokeTestRunConfig) Option added in v0.9.0

type PhaseSmokeTestRunOption added in v0.9.0

type PhaseSmokeTestRunOption interface {
	ConfigurePhaseSmokeTestRun(*PhaseSmokeTestRunConfig)
}

type PhaseStatus

type PhaseStatus string
const (
	PhaseStatusBlocking PhaseStatus = "blocking"
	PhaseStatusError    PhaseStatus = "error"
	PhaseStatusFailure  PhaseStatus = "failure"
	PhaseStatusSuccess  PhaseStatus = "success"
)

func (PhaseStatus) String

func (s PhaseStatus) String() string

type PhaseUninstall

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

func NewPhaseUninstall

func NewPhaseUninstall(signaler UninstallSignaler, uninstaller Uninstaller, opts ...PhaseUninstallOption) *PhaseUninstall

func (*PhaseUninstall) Execute

func (p *PhaseUninstall) Execute(ctx context.Context, req PhaseRequest) PhaseResult

type PhaseUninstallConfig

type PhaseUninstallConfig struct {
	Log logr.Logger

	AddonNamespace string
	OperatorName   string
}

func (*PhaseUninstallConfig) Default

func (c *PhaseUninstallConfig) Default()

func (*PhaseUninstallConfig) Option

func (c *PhaseUninstallConfig) Option(opts ...PhaseUninstallOption)

type PhaseUninstallOption

type PhaseUninstallOption interface {
	ConfigurePhaseUninstall(*PhaseUninstallConfig)
}

type ReferenceAddonClient

type ReferenceAddonClient interface {
	CreateOrUpdate(ctx context.Context, addon refv1alpha1.ReferenceAddon) (*refv1alpha1.ReferenceAddon, error)
	UpdateStatus(ctx context.Context, addon *refv1alpha1.ReferenceAddon) error
}

type ReferenceAddonClientImpl

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

func NewReferenceAddonClient

func NewReferenceAddonClient(client client.Client) *ReferenceAddonClientImpl

func (*ReferenceAddonClientImpl) CreateOrUpdate

func (*ReferenceAddonClientImpl) UpdateStatus

type ReferenceAddonReconciler

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

func (*ReferenceAddonReconciler) Reconcile

func (*ReferenceAddonReconciler) SetupWithManager

func (r *ReferenceAddonReconciler) SetupWithManager(mgr ctrl.Manager) error

type ReferenceAddonReconcilerConfig

type ReferenceAddonReconcilerConfig struct {
	Log logr.Logger

	AddonNamespace           string
	AddonParameterSecretname string
	OperatorName             string
	DeleteLabel              string
}

func (*ReferenceAddonReconcilerConfig) Default

func (c *ReferenceAddonReconcilerConfig) Default()

func (*ReferenceAddonReconcilerConfig) Option

type ReferenceAddonReconcilerOption

type ReferenceAddonReconcilerOption interface {
	ConfigureReferenceAddonReconciler(*ReferenceAddonReconcilerConfig)
}

type ResponseSampler

type ResponseSampler interface {
	RequestSampleResponseData(urls ...string)
}

type SecretParameterGetter

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

func NewSecretParameterGetter

func NewSecretParameterGetter(client client.Client, opts ...SecretParameteterGetterOption) *SecretParameterGetter

func (*SecretParameterGetter) GetParameters

type SecretParameterGetterConfig

type SecretParameterGetterConfig struct {
	Namespace string
	Name      string
}

func (*SecretParameterGetterConfig) Option

type SecretParameteterGetterOption

type SecretParameteterGetterOption interface {
	ConfigureSecretParameterGetter(*SecretParameterGetterConfig)
}

type SmokeTester added in v0.9.0

type SmokeTester interface {
	Enable()
	Disable()
}

type UninstallSignaler

type UninstallSignaler interface {
	SignalUninstall(ctx context.Context) bool
}

type Uninstaller

type Uninstaller interface {
	Uninstall(ctx context.Context, namespace, operatorName string) error
}

type UninstallerImpl

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

func NewUninstallerImpl

func NewUninstallerImpl(client CSVClient, opts ...UninstallerImplOption) *UninstallerImpl

func (UninstallerImpl) Uninstall

func (u UninstallerImpl) Uninstall(ctx context.Context, namespace, operatorName string) error

type UninstallerImplConfig

type UninstallerImplConfig struct {
	Log logr.Logger
}

func (*UninstallerImplConfig) Default

func (c *UninstallerImplConfig) Default()

func (*UninstallerImplConfig) Option

func (c *UninstallerImplConfig) Option(opts ...UninstallerImplOption)

type UninstallerImplOption

type UninstallerImplOption interface {
	ConfigureUninstallerImpl(*UninstallerImplConfig)
}

type WithAddonNamespace

type WithAddonNamespace string

func (WithAddonNamespace) ConfigureConfigMapUninstallSignaler

func (w WithAddonNamespace) ConfigureConfigMapUninstallSignaler(c *ConfigMapUninstallSignalerConfig)

func (WithAddonNamespace) ConfigurePhaseUninstall

func (w WithAddonNamespace) ConfigurePhaseUninstall(c *PhaseUninstallConfig)

func (WithAddonNamespace) ConfigureReferenceAddonReconciler

func (w WithAddonNamespace) ConfigureReferenceAddonReconciler(c *ReferenceAddonReconcilerConfig)

type WithAddonParameterSecretName

type WithAddonParameterSecretName string

func (WithAddonParameterSecretName) ConfigureReferenceAddonReconciler

func (w WithAddonParameterSecretName) ConfigureReferenceAddonReconciler(c *ReferenceAddonReconcilerConfig)

type WithApplyNetworkPolicies

type WithApplyNetworkPolicies struct{ Value *bool }

func (WithApplyNetworkPolicies) ConfigurePhaseRequestParameters

func (w WithApplyNetworkPolicies) ConfigurePhaseRequestParameters(c *PhaseRequestParametersConfig)

type WithConditions

type WithConditions []metav1.Condition

func (WithConditions) ConfigurePhaseResult

func (w WithConditions) ConfigurePhaseResult(c *PhaseResultConfig)

type WithDeleteLabel

type WithDeleteLabel string

func (WithDeleteLabel) ConfigureConfigMapUninstallSignaler

func (w WithDeleteLabel) ConfigureConfigMapUninstallSignaler(c *ConfigMapUninstallSignalerConfig)

func (WithDeleteLabel) ConfigureReferenceAddonReconciler

func (w WithDeleteLabel) ConfigureReferenceAddonReconciler(c *ReferenceAddonReconcilerConfig)

type WithEnableSmokeTest added in v0.9.0

type WithEnableSmokeTest struct{ Value *bool }

func (WithEnableSmokeTest) ConfigurePhaseRequestParameters added in v0.9.0

func (w WithEnableSmokeTest) ConfigurePhaseRequestParameters(c *PhaseRequestParametersConfig)

type WithLog

type WithLog struct{ Log logr.Logger }

func (WithLog) ConfigureCSVClientImpl

func (w WithLog) ConfigureCSVClientImpl(c *CSVClientImplConfig)

func (WithLog) ConfigurePhaseApplyNetworkPolicies

func (w WithLog) ConfigurePhaseApplyNetworkPolicies(c *PhaseApplyNetworkPoliciesConfig)

func (WithLog) ConfigurePhaseSmokeTestRun added in v0.9.0

func (w WithLog) ConfigurePhaseSmokeTestRun(c *PhaseSmokeTestRunConfig)

func (WithLog) ConfigurePhaseUninstall

func (w WithLog) ConfigurePhaseUninstall(c *PhaseUninstallConfig)

func (WithLog) ConfigureReferenceAddonReconciler

func (w WithLog) ConfigureReferenceAddonReconciler(c *ReferenceAddonReconcilerConfig)

func (WithLog) ConfigureUninstallerImpl

func (w WithLog) ConfigureUninstallerImpl(c *UninstallerImplConfig)

type WithName

type WithName string

func (WithName) ConfigureSecretParameterGetter

func (w WithName) ConfigureSecretParameterGetter(c *SecretParameterGetterConfig)

type WithNamespace

type WithNamespace string

func (WithNamespace) ConfigureListCSVs

func (w WithNamespace) ConfigureListCSVs(c *ListCSVsConfig)

func (WithNamespace) ConfigureSecretParameterGetter

func (w WithNamespace) ConfigureSecretParameterGetter(c *SecretParameterGetterConfig)

type WithOperatorName

type WithOperatorName string

func (WithOperatorName) ConfigureConfigMapUninstallSignaler

func (w WithOperatorName) ConfigureConfigMapUninstallSignaler(c *ConfigMapUninstallSignalerConfig)

func (WithOperatorName) ConfigurePhaseUninstall

func (w WithOperatorName) ConfigurePhaseUninstall(c *PhaseUninstallConfig)

func (WithOperatorName) ConfigureReferenceAddonReconciler

func (w WithOperatorName) ConfigureReferenceAddonReconciler(c *ReferenceAddonReconcilerConfig)

type WithOwner

type WithOwner struct{ Owner metav1.Object }

func (WithOwner) ConfigureApplyNetworkPolicies

func (w WithOwner) ConfigureApplyNetworkPolicies(c *ApplyNetorkPoliciesConfig)

type WithPolicies

type WithPolicies []netv1.NetworkPolicy

func (WithPolicies) ConfigureApplyNetworkPolicies

func (w WithPolicies) ConfigureApplyNetworkPolicies(c *ApplyNetorkPoliciesConfig)

func (WithPolicies) ConfigurePhaseApplyNetworkPolicies

func (w WithPolicies) ConfigurePhaseApplyNetworkPolicies(c *PhaseApplyNetworkPoliciesConfig)

type WithPrefix

type WithPrefix string

func (WithPrefix) ConfigureListCSVs

func (w WithPrefix) ConfigureListCSVs(c *ListCSVsConfig)

type WithSampleURLs

type WithSampleURLs []string

func (WithSampleURLs) ConfigurePhaseSendDummyMetrics

func (w WithSampleURLs) ConfigurePhaseSendDummyMetrics(c *PhaseSendDummyMetricsConfig)

type WithSize

type WithSize struct{ Value *string }

func (WithSize) ConfigurePhaseRequestParameters

func (w WithSize) ConfigurePhaseRequestParameters(c *PhaseRequestParametersConfig)

type WithSmokeTester added in v0.9.0

type WithSmokeTester struct{ Tester SmokeTester }

func (WithSmokeTester) ConfigurePhaseSmokeTestRun added in v0.9.0

func (w WithSmokeTester) ConfigurePhaseSmokeTestRun(c *PhaseSmokeTestRunConfig)

Jump to

Keyboard shortcuts

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