feature

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YamlSeparator = "(?m)^---[ \t]*$"
)

Variables

This section is empty.

Functions

func CopyEmbeddedFiles

func CopyEmbeddedFiles(src, dest string) error

CopyEmbeddedFiles ensures that files embedded using go:embed are populated to dest directory. In order to process the templates, we need to create a tmp directory to store the files. This is because embedded files are read only.

func CreateFeature

func CreateFeature(name string) *featureBuilder

func GenerateSelfSignedCertificateAsSecret

func GenerateSelfSignedCertificateAsSecret(addr string, objectMeta metav1.ObjectMeta) (*corev1.Secret, error)

func ReplaceChar

func ReplaceChar(s string, oldChar, newChar string) string

Types

type Action

type Action func(feature *Feature) error

Action is a func type which can be used for different purposes while having access to Feature struct

func CreateNamespace

func CreateNamespace(namespace string) Action

CreateNamespace will create namespace with the given name if it does not exist yet and sets feature as an owner of it. This way we ensure that when the feature is cleaned up, the namespace will be deleted as well.

func EnsureCRDIsInstalled

func EnsureCRDIsInstalled(name string) Action

func WaitForPodsToBeReady

func WaitForPodsToBeReady(namespace string) Action

func WaitForResourceToBeCreated

func WaitForResourceToBeCreated(namespace string, gvr schema.GroupVersionResource) Action

type DefinedFeatures

type DefinedFeatures func(s *FeaturesInitializer) error

type Feature

type Feature struct {
	Name    string
	Spec    *Spec
	Enabled bool

	Clientset     *kubernetes.Clientset
	DynamicClient dynamic.Interface
	Client        client.Client
	// contains filtered or unexported fields
}

func (*Feature) Apply

func (f *Feature) Apply() error

func (*Feature) Cleanup

func (f *Feature) Cleanup() error

func (*Feature) CreateConfigMap

func (f *Feature) CreateConfigMap(cfgMapName string, data map[string]string) error

func (*Feature) OwnerReference

func (f *Feature) OwnerReference() metav1.OwnerReference

type FeaturesInitializer

type FeaturesInitializer struct {
	*v1.DSCInitializationSpec

	Features []*Feature
	// contains filtered or unexported fields
}

func (*FeaturesInitializer) Apply

func (s *FeaturesInitializer) Apply() error

func (*FeaturesInitializer) Delete

func (s *FeaturesInitializer) Delete() error

Delete executes registered clean-up tasks in the opposite order they were initiated (following a stack structure). For instance, this allows for the undoing patches before its deletion. This approach assumes that Features are either instantiated in the correct sequence or are self-contained.

func (*FeaturesInitializer) Prepare

func (s *FeaturesInitializer) Prepare() error

Prepare performs validation of the spec and ensures all resources, such as Features and their templates, are processed and initialized before proceeding with the actual cluster set-up.

type OAuth

type OAuth struct {
	AuthzEndpoint,
	TokenEndpoint,
	Route,
	Port,
	ClientSecret,
	Hmac string
}

type Spec

type Spec struct {
	OAuth        OAuth
	AppNamespace string
	Domain       string
	Tracker      *v1.FeatureTracker
}

Jump to

Keyboard shortcuts

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