Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ObjectEncoder ¶
type ObjectEncoder[T any] interface { // Encode will encode the object for storage, returning a byte slice that // can be understood by the decode method. Encode(T) ([]byte, error) // Decode will decode the object, returning the object. Decode([]byte) (T, error) }
ObjectEncoder is used to encode an object for storage
func NewVersionedObjectEncoder ¶
func NewVersionedObjectEncoder[ InternalVersion any, StorageVersion any, IP ObjectPtr[InternalVersion], SP ObjectPtr[StorageVersion], ](scheme *runtime.Scheme) (ObjectEncoder[InternalVersion], error)
NewVersionedObjectEncoder implements an ObjectLoader that accepts an internal object type, but converts it to a versioned object before encoding.
This allows the schema to evolve and change while still being able to load older files.
type ObjectPtr ¶
ObjectPtr is a type constraint. It is used to validate a pointer of a given type implements Object
type State ¶
type State struct {
// contains filtered or unexported fields
}
State contains the current state of the CSI implementation, it tracks the volumes currently being managed.
This is its own type so both the Controller and CSI GRPC server have access to the state in a thread safe way.
func InitializeState ¶
func InitializeState(ctx context.Context, config *config.Config, metadataEncoder ObjectEncoder[metadata.Metadata]) (*State, error)
InitializeState will setup the persistent state required by the CSI implementation. It has two main jobs:
1. Ensure the tmpfs mount exists, creating if necessary 2. Loading config for existing volumes left over from a previous instance
func (*State) GetMetadataForBundle ¶
GetMetadataForBundle returns the metadata for a given bundle name, each metadata item relates to a single volume that may require a re-sync.