storage

package
v0.30.5 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEtcdClients

func GetEtcdClients(config storagebackend.TransportConfig) (*clientv3.Client, clientv3.KV, error)

GetEtcdClients returns an initialized clientv3.Client and clientv3.KV.

Types

type EtcdObjectReader

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

EtcdObjectReader provides direct access to custom resource objects stored in etcd.

func NewEtcdObjectReader

func NewEtcdObjectReader(etcdClient *clientv3.Client, restOptions *generic.RESTOptions, crd *apiextensionsv1.CustomResourceDefinition) *EtcdObjectReader

NewEtcdObjectReader creates a reader for accessing custom resource objects directly from etcd.

func (*EtcdObjectReader) GetStoredCustomResource

func (s *EtcdObjectReader) GetStoredCustomResource(ns, name string) (*unstructured.Unstructured, error)

GetStoredCustomResource gets the storage representation of a custom resource from etcd.

func (*EtcdObjectReader) SetStoredCustomResource

func (s *EtcdObjectReader) SetStoredCustomResource(ns, name string, obj *unstructured.Unstructured) error

SetStoredCustomResource writes the storage representation of a custom resource to etcd.

func (*EtcdObjectReader) WaitForStorageVersion

func (s *EtcdObjectReader) WaitForStorageVersion(version string, ns, name string, timeout time.Duration, updateObjFn func()) error

WaitForStorageVersion calls the updateObjFn periodically and waits for the version of the custom resource stored in etcd to be set to the provided version. Typically updateObjFn should perform a noop update to the object so that when stored version of a CRD changes, the object is written at the updated storage version. If the timeout is exceeded a error is returned. This is useful when updating the stored version of an existing CRD because the update does not take effect immediately.

Jump to

Keyboard shortcuts

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