spaces

package
v2.11.26 Latest Latest
Warning

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

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

Documentation

Overview

Package spaces provides a cf compatible way of managing spaces in the cluster. All spaces are denoted by the label `app.kubernetes.io/managed-by=kf`.

Namespaces without that label are ignored.

Index

Constants

This section is empty.

Variables

Functions

func ConditionDeleted

func ConditionDeleted(ctx context.Context, _ *v1alpha1.Space, apiErr error) (bool, error)

ConditionDeleted is a ConditionFuncE that succeeds if the error returned by the cluster was a not found error.

func ConditionReadyTrue

func ConditionReadyTrue(ctx context.Context, obj *v1alpha1.Space, err error) (bool, error)

ConditionReadyTrue is a ConditionFuncE that waits for Condition{Ready v1alpha1.SpaceConditionReady } to become true and fails with an error if the condition becomes false.

func ExtractConditions

func ExtractConditions(obj *v1alpha1.Space) (extracted []apis.Condition)

ExtractConditions converts the native condition types into an apis.Condition array with the Type, Status, Reason, and Message fields intact.

func IsStatusFinal

func IsStatusFinal(space *v1alpha1.Space) bool

IsStatusFinal checks if the space has been fully synchronized.

func ObservedGenerationMatchesGeneration

func ObservedGenerationMatchesGeneration(obj *v1alpha1.Space) bool

ObservedGenerationMatchesGeneration is a predicate that returns true if the object's ObservedGeneration matches the genration of the object.

func WithConditionReporter added in v2.11.16

func WithConditionReporter(ctx context.Context, reporter ConditionReporter) context.Context

WithConditionReporter adds a callback to condition waits.

Types

type Client

type Client interface {
	Create(ctx context.Context, obj *v1alpha1.Space) (*v1alpha1.Space, error)
	Transform(ctx context.Context, name string, transformer Mutator) (*v1alpha1.Space, error)
	Get(ctx context.Context, name string) (*v1alpha1.Space, error)
	Delete(ctx context.Context, name string) error
	List(ctx context.Context) ([]v1alpha1.Space, error)
	Upsert(ctx context.Context, newObj *v1alpha1.Space, merge Merger) (*v1alpha1.Space, error)
	WaitFor(ctx context.Context, name string, interval time.Duration, condition Predicate) (*v1alpha1.Space, error)

	// Utility functions
	WaitForDeletion(ctx context.Context, name string, interval time.Duration) (*v1alpha1.Space, error)
	WaitForConditionReadyTrue(ctx context.Context, name string, interval time.Duration) (*v1alpha1.Space, error)

	// ClientExtension can be used by the developer to extend the client.
	ClientExtension
}

Client is the interface for interacting with v1alpha1.Space types as Space CF style objects.

func NewClient

func NewClient(kclient cv1alpha1.SpacesGetter) Client

NewClient creates a new space client.

type ClientExtension

type ClientExtension interface {
}

ClientExtension holds additional functions that should be exposed by client.

type ConditionFuncE

type ConditionFuncE func(ctx context.Context, instance *v1alpha1.Space, apiErr error) (done bool, err error)

ConditionFuncE is a callback used by waitForE. Done should be set to true once the condition succeeds and shouldn't be called anymore. The error will be passed back to the user.

This function MAY retrieve a nil instance and an apiErr. It's up to the function to decide how to handle the apiErr.

type ConditionReporter added in v2.11.16

type ConditionReporter func(message string)

ConditionReporter reports on changes to conditions while waiting.

type Merger

type Merger func(newObj, oldObj *v1alpha1.Space) *v1alpha1.Space

Merger is a type to merge an existing value with a new one.

type Mutator

type Mutator func(*v1alpha1.Space) error

Mutator is a function that changes v1alpha1.Space.

type Predicate

type Predicate func(*v1alpha1.Space) bool

Predicate is a boolean function for a v1alpha1.Space.

type ResourceInfo

type ResourceInfo struct{}

func NewResourceInfo

func NewResourceInfo() *ResourceInfo

NewResourceInfo returns a new instance of ResourceInfo

func (*ResourceInfo) FriendlyName

func (*ResourceInfo) FriendlyName() string

FriendlyName gets the user-facing name of the resource.

func (*ResourceInfo) GroupVersionKind

func (*ResourceInfo) GroupVersionKind(context.Context) schema.GroupVersionKind

GroupVersionKind gets the GVK struct for the resource.

func (*ResourceInfo) GroupVersionResource

func (*ResourceInfo) GroupVersionResource(context.Context) schema.GroupVersionResource

GroupVersionResource gets the GVR struct for the resource.

func (*ResourceInfo) Namespaced

func (*ResourceInfo) Namespaced() bool

Namespaced returns true if the type belongs in a namespace.

Directories

Path Synopsis
Package fake is a generated GoMock package.
Package fake is a generated GoMock package.

Jump to

Keyboard shortcuts

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