Documentation ¶
Index ¶
- Constants
- Variables
- func CreateFeature(name string) *usingFeaturesHandler
- func CreateRawManifestFrom(fsys fs.FS, path string) *rawManifest
- func CreateTemplateManifestFrom(fsys fs.FS, path string) *templateManifest
- func GenerateSelfSignedCertificateAsSecret(addr string, objectMeta metav1.ObjectMeta) (*corev1.Secret, error)
- func OwnedBy(f *Feature) cluster.MetaOptions
- func ReplaceChar(s string, oldChar, newChar string) string
- type Action
- type Feature
- func (f *Feature) Apply() error
- func (f *Feature) ApplyManifest(path string) error
- func (f *Feature) AsOwnerReference() metav1.OwnerReference
- func (f *Feature) Cleanup() error
- func (f *Feature) CreateSelfSignedCertificate(secretName string, certificateType infrav1.CertType, domain, namespace string) error
- type FeaturesHandler
- type FeaturesProvider
- type HandlerWithReporter
- type Manifest
- type MissingOperatorError
- type OAuth
- type Spec
Constants ¶
const (
YamlSeparator = "(?m)^---[ \t]*$"
)
Variables ¶
var EmptyFeaturesHandler = &FeaturesHandler{ features: []*Feature{}, featuresProviders: []FeaturesProvider{}, }
EmptyFeaturesHandler is noop handler so that we can avoid nil checks in the code and safely call Apply/Delete methods.
Functions ¶
func CreateFeature ¶
func CreateFeature(name string) *usingFeaturesHandler
CreateFeature creates a new feature builder with the given name.
func CreateRawManifestFrom ¶ added in v2.9.0
func CreateTemplateManifestFrom ¶ added in v2.9.0
func OwnedBy ¶ added in v2.10.0
func OwnedBy(f *Feature) cluster.MetaOptions
func ReplaceChar ¶
Types ¶
type Action ¶
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
CreateNamespaceIfNotExists will create a namespace with the given name if it does not exist yet. It does not set ownership nor apply extra metadata to the existing namespace.
func EnsureOperatorIsInstalled ¶ added in v2.9.0
func WaitForPodsToBeReady ¶
func WaitForResourceToBeCreated ¶
func WaitForResourceToBeCreated(namespace string, gvk schema.GroupVersionKind) Action
type Feature ¶
type Feature struct { Name string Spec *Spec Enabled bool Managed bool Tracker *featurev1.FeatureTracker Client client.Client Log logr.Logger // contains filtered or unexported fields }
func (*Feature) ApplyManifest ¶ added in v2.8.0
func (*Feature) AsOwnerReference ¶ added in v2.7.0
func (f *Feature) AsOwnerReference() metav1.OwnerReference
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 (fh *FeaturesHandler) Apply() error
func (*FeaturesHandler) Delete ¶ added in v2.7.0
func (fh *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 HandlerWithReporter ¶ added in v2.10.1
HandlerWithReporter is a wrapper around FeaturesHandler and status.Reporter It is intended apply features related to a given resource capabilities and report its status using custom reporter.
func NewHandlerWithReporter ¶ added in v2.10.1
func NewHandlerWithReporter[T client.Object](handler *FeaturesHandler, reporter *status.Reporter[T]) *HandlerWithReporter[T]
func (HandlerWithReporter[T]) Apply ¶ added in v2.10.1
func (h HandlerWithReporter[T]) Apply() error
func (HandlerWithReporter[T]) Delete ¶ added in v2.10.1
func (h HandlerWithReporter[T]) Delete() error
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) // MarkAsManaged sets all non-patch objects to be managed/reconciled by setting the annotation. MarkAsManaged(objects []*unstructured.Unstructured) }
type MissingOperatorError ¶ added in v2.10.1
type MissingOperatorError struct {
// contains filtered or unexported fields
}
func NewMissingOperatorError ¶ added in v2.10.1
func NewMissingOperatorError(operatorName string, err error) *MissingOperatorError
func (*MissingOperatorError) Error ¶ added in v2.10.1
func (e *MissingOperatorError) Error() string
func (*MissingOperatorError) Unwrap ¶ added in v2.10.1
func (e *MissingOperatorError) Unwrap() error