template

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CoreGroupPrefix  = "api"
	NamedGroupPrefix = "apis"

	// DefaultDeleteCollectionWorkers defines the default value for deleteCollectionWorkers
	DefaultDeleteCollectionWorkers = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FixupFunc

type FixupFunc func(runtime.Object) runtime.Object

type REST

type REST struct {

	// is this Rest for CRD resource.
	CRD *apiextensionsv1.CustomResourceDefinition
	// contains filtered or unexported fields
}

REST implements a RESTStorage for Shadow API

func NewREST

func NewREST(dryRunClient clientgorest.Interface, clusternetclient *clusternet.Clientset, parameterCodec runtime.ParameterCodec,
	manifestLister applisters.ManifestLister, reservedNamespace string) *REST

NewREST returns a RESTStorage object that will work against API services.

func (*REST) Categories

func (r *REST) Categories() []string

func (*REST) ConvertToTable

func (r *REST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error)

func (*REST) Create

func (r *REST) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error)

Create inserts a new item into Manifest according to the unique key from the object.

func (*REST) Delete

func (r *REST) Delete(ctx context.Context, name string, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions) (runtime.Object, bool, error)

Delete removes the item from storage. options can be mutated by rest.BeforeDelete due to a graceful deletion strategy.

func (*REST) DeleteCollection

func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *internalversion.ListOptions) (runtime.Object, error)

DeleteCollection removes all items returned by List with a given ListOptions from storage.

DeleteCollection is currently NOT atomic. It can happen that only subset of objects will be deleted from storage, and then an error will be returned. In case of success, the list of deleted objects will be returned. Copied from k8s.io/apiserver/pkg/registry/generic/registry/store.go and modified.

func (*REST) Destroy

func (r *REST) Destroy()

func (*REST) Get

func (r *REST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error)

Get retrieves the item from Manifest.

func (*REST) GroupVersion

func (r *REST) GroupVersion() schema.GroupVersion

func (*REST) GroupVersionKind

func (r *REST) GroupVersionKind(_ schema.GroupVersion) schema.GroupVersionKind

func (*REST) List

func (r *REST) List(ctx context.Context, options *internalversion.ListOptions) (runtime.Object, error)

List returns a list of items matching labels.

func (*REST) NamespaceScoped

func (r *REST) NamespaceScoped() bool

func (*REST) New

func (r *REST) New() runtime.Object

func (*REST) NewList

func (r *REST) NewList() runtime.Object

func (*REST) SetCRD

func (*REST) SetGroup

func (r *REST) SetGroup(group string)

func (*REST) SetKind

func (r *REST) SetKind(kind string)

func (*REST) SetName

func (r *REST) SetName(name string)

func (*REST) SetNamespaceScoped

func (r *REST) SetNamespaceScoped(namespaceScoped bool)

func (*REST) SetShortNames

func (r *REST) SetShortNames(ss []string)

func (*REST) SetVersion

func (r *REST) SetVersion(version string)

func (*REST) ShortNames

func (r *REST) ShortNames() []string

func (*REST) Update

func (r *REST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo,
	createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc,
	forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error)

Update performs an atomic update and set of the object. Returns the result of the update or an error. If the registry allows create-on-update, the create flow will be executed. A bool is returned along with the object and any errors, to indicate object creation.

func (*REST) Watch

func (r *REST) Watch(ctx context.Context, options *internalversion.ListOptions) (watch.Interface, error)

Watch makes a matcher for the given label and field.

type ScaleREST

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

ScaleREST implements a ScaleREST Storage for Shadow API

func NewScaleREST

func NewScaleREST(store *REST) *ScaleREST

NewScaleREST returns a ScaleREST Storage object that will work against API services.

func (*ScaleREST) Destroy

func (r *ScaleREST) Destroy()

func (*ScaleREST) Get

func (r *ScaleREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error)

Get retrieves object from ScaleREST storage.

func (*ScaleREST) GroupVersionKind

func (r *ScaleREST) GroupVersionKind(containingGV schema.GroupVersion) schema.GroupVersionKind

GroupVersionKind returns GroupVersionKind for Scale object

func (*ScaleREST) New

func (r *ScaleREST) New() runtime.Object

New creates a new Scale object

func (*ScaleREST) Update

func (r *ScaleREST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error)

Update alters scale subset of object.

type WatchWrapper

type WatchWrapper struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewWatchWrapper

func NewWatchWrapper(ctx context.Context, watcher watch.Interface, fixup FixupFunc, size int) *WatchWrapper

func (*WatchWrapper) ResultChan

func (w *WatchWrapper) ResultChan() <-chan watch.Event

func (*WatchWrapper) Run

func (w *WatchWrapper) Run()

func (*WatchWrapper) Stop

func (w *WatchWrapper) Stop()

Jump to

Keyboard shortcuts

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