gc

package
v2.24.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeleteVerb  = "delete"
	AnyVerb     = "*"
	AnyResource = "*"
)

Variables

This section is empty.

Functions

func MatchRule

func MatchRule(resourceGroup string, apiRes metav1.APIResource, rule authorizationv1.ResourceRule) bool

Types

type GC

type GC struct {
	// contains filtered or unexported fields
}
var Instance *GC

Instance a global instance of the GC service.

TODO: since the GC service is quite heavy, as it has to discover

resources that can be subject to GC, we share single global
instance, however as long term, we should find a better way
to let consumer of the service to access it.

func New

func New(cli *client.Client, ns string, opts ...OptsFn) *GC

func (*GC) Run

func (gc *GC) Run(
	ctx context.Context,
	selector labels.Selector,
	predicate func(context.Context, unstructured.Unstructured) (bool, error),
) (int, error)

func (*GC) Start

func (gc *GC) Start(ctx context.Context) error

type OptsFn

type OptsFn func(*options)

func WithPropagationPolicy

func WithPropagationPolicy(policy metav1.DeletionPropagation) OptsFn

func WithUnremovables

func WithUnremovables(items ...schema.GroupVersionKind) OptsFn

type Resource

type Resource struct {
	meta.RESTMapping
}

func (Resource) GroupVersionKind

func (r Resource) GroupVersionKind() schema.GroupVersionKind

func (Resource) GroupVersionResource

func (r Resource) GroupVersionResource() schema.GroupVersionResource

func (Resource) IsNamespaced

func (r Resource) IsNamespaced() bool

func (Resource) String

func (r Resource) String() string

type Resources

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

func (*Resources) Get

func (r *Resources) Get() []Resource

func (*Resources) Len

func (r *Resources) Len() int

func (*Resources) Set

func (r *Resources) Set(resources []Resource)

Jump to

Keyboard shortcuts

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