featuregateclient

package
v0.0.0-...-93a508a Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Overview

Package featuregateclient provides methods to interact with Feature and FeatureGate resources

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FeatureRefFromGateList

func FeatureRefFromGateList(gates *corev1alpha2.FeatureGateList, featureName string) (string, corev1alpha2.FeatureReference)

FeatureRefFromGateList finds the requested Feature from a list of featuregates. If found, the name of the FeatureGate and the FeatureReference is returned.

Types

type ErrType

type ErrType string

ErrType is a machine readable value created for facilitating error-matching in tests.

const (
	// ErrType indicates a resource could not be found.
	ErrTypeNotFound ErrType = "NotFound"
	// ErrTypeForbidden indicates an action is not allowed.
	ErrTypeForbidden ErrType = "Forbidden"
	// ErrTypeTooMany indicates there are too many of a resource.
	ErrTypeTooMany ErrType = "TooMany"
)

func (ErrType) Error

func (t ErrType) Error() string

Error converts a ErrorType into its corresponding canonical error message.

type FeatureGateClient

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

FeatureGateClient defines methods to interact with FeatureGate resources

func NewFeatureGateClient

func NewFeatureGateClient(options ...Option) (*FeatureGateClient, error)

NewFeatureGateClient returns an instance of FeatureGateClient.

func (*FeatureGateClient) ActivateFeature

func (f *FeatureGateClient) ActivateFeature(ctx context.Context, featureName string, warrantyVoidAllowed bool) error

ActivateFeature activates a Feature if it passes validation and warranty checks. Warning: Before sending `true` via the warrantyVoidAllowed function argument, ensure explicit user awareness and approval if activating a Feature will cause the support warranty to be void. Once warranty is void, it is is permanent for the environment.

func (*FeatureGateClient) DeactivateFeature

func (f *FeatureGateClient) DeactivateFeature(ctx context.Context, featureName string) (string, error)

DeactivateFeature deactivates a Feature. Along with the error, it returns the name of the FeatureGate that gates the Feature.

func (*FeatureGateClient) GetFeature

func (f *FeatureGateClient) GetFeature(ctx context.Context, featureName string) (*corev1alpha2.Feature, error)

GetFeature fetches the specified Feature resource.

func (*FeatureGateClient) GetFeatureGate

func (f *FeatureGateClient) GetFeatureGate(ctx context.Context, featureGateName string) (*corev1alpha2.FeatureGate, error)

GetFeatureGate fetches the specified FeatureGate resource.

func (*FeatureGateClient) GetFeatureGateList

func (f *FeatureGateClient) GetFeatureGateList(ctx context.Context) (*corev1alpha2.FeatureGateList, error)

GetFeatureGateList fetches all featuregates on the cluster.

func (*FeatureGateClient) GetFeatureList

func (f *FeatureGateClient) GetFeatureList(ctx context.Context) (*corev1alpha2.FeatureList, error)

GetFeatureList fetches all features on the cluster.

type Option

type Option func(*FeatureGateClient) *FeatureGateClient

Option is FeatureGateClient Option definition

func WithClient

func WithClient(cl client.Client) Option

WithClient function is for setting the passed in client when creating FeatureGateClient

Directories

Path Synopsis
Package fake provides data needed for testing
Package fake provides data needed for testing

Jump to

Keyboard shortcuts

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