collapseconfiguration

package
v0.0.326 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAttrs

func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, error)

GetAttrs returns labels.Set, fields.Set, and error in case the given runtime.Object is not a CollapseConfiguration.

func MatchCollapseConfiguration

func MatchCollapseConfiguration(label labels.Selector, field fields.Selector) storage.SelectionPredicate

MatchCollapseConfiguration returns a generic SelectionPredicate that pairs the supplied label/field selectors with the type's GetAttrs.

func NewREST

func NewREST(scheme *runtime.Scheme, storageImpl storage.Interface, optsGetter generic.RESTOptionsGetter) (*registry.REST, error)

NewREST returns a RESTStorage object that exposes CollapseConfiguration resources. The CRD is cluster-scoped (NamespaceScoped() == false in strategy.go) and is normally read by the storage server's deflate path at DeflateContainerProfileSpec time.

func SelectableFields

func SelectableFields(obj *softwarecomposition.CollapseConfiguration) fields.Set

SelectableFields returns a field set that represents the object. CollapseConfiguration is cluster-scoped, so the namespaceScoped flag is false — `metadata.namespace` is intentionally absent from the selectable set.

Types

type CollapseConfigurationStrategy

type CollapseConfigurationStrategy struct {
	runtime.ObjectTyper
	names.NameGenerator
}

CollapseConfigurationStrategy carries the per-object lifecycle hooks the generic registry calls during Create/Update/Delete. CollapseConfiguration is cluster-scoped, has no immutable fields, and validates that each per-prefix entry has a non-empty Prefix and a positive Threshold.

func NewStrategy

NewStrategy creates and returns a CollapseConfigurationStrategy instance.

func (CollapseConfigurationStrategy) AllowCreateOnUpdate

func (CollapseConfigurationStrategy) AllowCreateOnUpdate() bool

func (CollapseConfigurationStrategy) AllowUnconditionalUpdate

func (CollapseConfigurationStrategy) AllowUnconditionalUpdate() bool

func (CollapseConfigurationStrategy) Canonicalize

func (CollapseConfigurationStrategy) NamespaceScoped

func (CollapseConfigurationStrategy) NamespaceScoped() bool

NamespaceScoped declares the resource as cluster-scoped.

func (CollapseConfigurationStrategy) PrepareForCreate

func (CollapseConfigurationStrategy) PrepareForUpdate

func (CollapseConfigurationStrategy) PrepareForUpdate(_ context.Context, _, _ runtime.Object)

func (CollapseConfigurationStrategy) Validate

Validate runs spec-level checks on a Create. Returns an empty list when the object is well-formed.

func (CollapseConfigurationStrategy) ValidateUpdate

ValidateUpdate runs the same spec-level checks as Validate; the spec is fully mutable on update.

func (CollapseConfigurationStrategy) WarningsOnCreate

func (CollapseConfigurationStrategy) WarningsOnUpdate

func (CollapseConfigurationStrategy) WarningsOnUpdate(_ context.Context, _, _ runtime.Object) []string

type CustomREST added in v0.0.320

type CustomREST = genericrest.Store

This file wires the resource-agnostic genericrest.Store (see pkg/registry/genericrest/store.go) with collapseconfigurations-specific configuration, as a parallel, gated alternative to the genericregistry.Store based implementation in etcd.go (which remains the reference implementation for differential testing -- see custom_rest_test.go). Cluster-scoped, and has real (not no-op) Strategy validation: validateCollapseConfigurationSpec (strategy.go) rejects negative global thresholds, an out-of-[1,32]-range NetworkCIDRFloorBits, and malformed/duplicate per-prefix CollapseConfigs entries. This requires no special handling here: genericrest.Store.Create/Update invoke rest.BeforeCreate/rest.BeforeUpdate against r.Strategy at the same point genericregistry.Store does, so this validation is exercised identically by both implementations without any extra wiring. Not inverted: DefaultQualifiedResource is plural, SingularQualifiedResource is singular, matching normal convention.

func NewCustomREST added in v0.0.320

func NewCustomREST(scheme *runtime.Scheme, storageImpl storage.Interface, optsGetter generic.RESTOptionsGetter) (*CustomREST, error)

NewCustomREST returns the custom rest.Storage implementation for collapseconfigurations. Its signature intentionally matches NewREST's so it can be wired in as a drop-in alternative in pkg/apiserver/apiserver.go.

Jump to

Keyboard shortcuts

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