feature

package
v2.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	BaseDir        = "templates"
	ServiceMeshDir = path.Join(BaseDir, "servicemesh")
	ServerlessDir  = path.Join(BaseDir, "serverless")
	AuthDir        = path.Join(ServiceMeshDir, "authorino")
	KServeDir      = path.Join(ServiceMeshDir, "kserve")
)

Functions

func CreateFeature

func CreateFeature(name string) *usingFeaturesHandler

func CreateKustomizeManifestFrom added in v2.9.0

func CreateKustomizeManifestFrom(path string, fsys filesys.FileSystem) *kustomizeManifest

func CreateRawManifestFrom added in v2.9.0

func CreateRawManifestFrom(fsys fs.FS, path string) *rawManifest

func CreateTemplateManifestFrom added in v2.9.0

func CreateTemplateManifestFrom(fsys fs.FS, path string) *templateManifest

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 CreateNamespaceIfNotExists added in v2.7.0

func CreateNamespaceIfNotExists(namespace string) Action

CreateNamespaceIfNotExists will create namespace with the given name if it does not exist yet, but will not own it.

func EnsureOperatorIsInstalled added in v2.9.0

func EnsureOperatorIsInstalled(name string) Action

func WaitForPodsToBeReady

func WaitForPodsToBeReady(namespace string) Action

func WaitForResourceToBeCreated

func WaitForResourceToBeCreated(namespace string, gvk schema.GroupVersionKind) Action

type Feature

type Feature struct {
	Name    string
	Spec    *Spec
	Enabled bool
	Tracker *featurev1.FeatureTracker

	Client client.Client

	Log logr.Logger
	// contains filtered or unexported fields
}

func (*Feature) Apply

func (f *Feature) Apply() (err error)

func (*Feature) ApplyManifest added in v2.8.0

func (f *Feature) ApplyManifest(path string) error

func (*Feature) AsOwnerReference added in v2.7.0

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

func (*Feature) Cleanup

func (f *Feature) Cleanup() error

func (*Feature) CreateConfigMap

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

func (*Feature) CreateSelfSignedCertificate added in v2.7.0

func (f *Feature) CreateSelfSignedCertificate(secretName string, certificateType infrav1.CertType, domain, namespace string) error

type FeaturesHandler added in v2.7.0

type FeaturesHandler struct {
	*v1.DSCInitializationSpec
	// contains filtered or unexported fields
}

FeaturesHandler coordinates feature creations and removal from within controllers.

func ClusterFeaturesHandler added in v2.7.0

func ClusterFeaturesHandler(dsci *v1.DSCInitialization, def FeaturesProvider) *FeaturesHandler

func ComponentFeaturesHandler added in v2.7.0

func ComponentFeaturesHandler(componentName string, spec *v1.DSCInitializationSpec, def FeaturesProvider) *FeaturesHandler

func (*FeaturesHandler) Apply added in v2.7.0

func (f *FeaturesHandler) Apply() error

func (*FeaturesHandler) Delete added in v2.7.0

func (f *FeaturesHandler) 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.

type FeaturesProvider added in v2.7.0

type FeaturesProvider func(handler *FeaturesHandler) error

FeaturesProvider is a function which allow to define list of features and couple them with the given initializer.

type Manifest added in v2.9.0

type Manifest interface {
	// Process allows any arbitrary struct to be passed and used while processing the content of the manifest.
	Process(data any) ([]*unstructured.Unstructured, error)
}

type OAuth

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

type Spec

type Spec struct {
	*infrav1.ServiceMeshSpec
	Serving                  *infrav1.ServingSpec
	AuthProviderName         string
	OAuth                    OAuth
	AppNamespace             string
	TargetNamespace          string
	Domain                   string
	KnativeCertificateSecret string
	KnativeIngressDomain     string
	Source                   *featurev1.Source
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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