v1alpha1

package
v0.7.6-7-gd9d9e9d6 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file expect in compliance with the License.

Index

Constants

View Source
const (
	// used for PersistentVolumeClaims that are not yet bound
	VolumeStatePending = VolumeState("Pending")
	// used for PersistentVolumeClaims that are bound
	VolumeStateBound = VolumeState("Bound")
	// used for PersistentVolumeClaims that lost their underlying
	// PersistentVolume. The claim was bound to a PersistentVolume and this
	// volume does not exist any longer and all data on it was lost.
	VolumeStateLost = VolumeState("Lost")
)
View Source
const Version = "v1alpha1"

Variables

View Source
var SchemeGroupVersion = schema.GroupVersion{
	Group:   volume.GroupName,
	Version: Version,
}

Functions

func AddToScheme

func AddToScheme(scheme *runtime.Scheme) error

func AddToSchemeWithGV

func AddToSchemeWithGV(scheme *runtime.Scheme, schemeGroupVersion schema.GroupVersion) error

Types

type Volume

type Volume = zip.Object[VolumeSpec, VolumeStatus]

Volume is the mutable API object that represents a volume.

type VolumeList

type VolumeList = zip.ObjectList[VolumeSpec, VolumeStatus]

VolumeList is the mutable API object that represents a list of volumes.

type VolumeService

type VolumeService interface {
	Create(context.Context, *Volume) (*Volume, error)
	Delete(context.Context, *Volume) (*Volume, error)
	Get(context.Context, *Volume) (*Volume, error)
	List(context.Context, *VolumeList) (*VolumeList, error)
}

VolumeService is the interface of available methods which can be performed by an implementing network driver.

func NewVolumeServiceHandler

func NewVolumeServiceHandler(ctx context.Context, impl VolumeService, opts ...zip.ClientOption) (VolumeService, error)

NewVolumeServiceHandler returns a service based on an inline API client which essentially wraps the specific call, enabling pre- and post- call hooks. This is useful for wrapping the command with decorators, for example, a cache, error handlers, etc. Simultaneously, it enables access to the service via inline code without having to make invocations to an external handler.

type VolumeServiceHandler

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

VolumeServiceHandler provides a Zip API Object Framework service for the volume.

func (*VolumeServiceHandler) Create

func (client *VolumeServiceHandler) Create(ctx context.Context, req *Volume) (*Volume, error)

Create implements VolumeService

func (*VolumeServiceHandler) Delete

func (client *VolumeServiceHandler) Delete(ctx context.Context, req *Volume) (*Volume, error)

Delete implements VolumeService

func (*VolumeServiceHandler) Get

func (client *VolumeServiceHandler) Get(ctx context.Context, req *Volume) (*Volume, error)

Get implements VolumeService

func (*VolumeServiceHandler) List

func (client *VolumeServiceHandler) List(ctx context.Context, req *VolumeList) (*VolumeList, error)

List implements VolumeService

type VolumeSpec

type VolumeSpec struct {
	// Driver is the name of the implementing strategy.  Volume drivers let you
	// store volumes on remote hosts or cloud providers, to encrypt the contents
	// of volumes, or to add other functionality.
	Driver string `json:"driver,omitempty"`

	// The source of the mount.  For named volumes, this is the name of the
	// volume.  For anonymous volumes, this field is omitted.
	Source string `json:"source,omitempty"`

	// The destination takes as its value the path where the file or directory is
	// mounted in the machine.
	Destination string `json:"destination,omitempty"`

	// File permission mode (Linux only).
	Mode string `json:"mode,omitempty"`

	// Mark whether the volume is readonly.
	ReadOnly bool `json:"readOnly,omitempty"`
}

VolumeSpec contains the desired behavior of the volume.

type VolumeState

type VolumeState string

VolumeState indicates the state of the volume.

func (VolumeState) String

func (vs VolumeState) String() string

String implements fmt.Stringer

type VolumeStatus

type VolumeStatus struct {
	// State is the current state of the volume.
	State VolumeState `json:"state"`

	// DriverConfig is driver-specific attributes which are populated by the
	// underlying volume implementation.
	DriverConfig interface{} `json:"driverConfig,omitempty"`
}

VolumeStatus contains the complete status of the volume.

type VolumeTemplateSpec

type VolumeTemplateSpec struct {
	// Metadata of the components used or created from this template.
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec defines the behavior of the volume.
	Spec VolumeSpec `json:"spec,omitempty"`
}

VolumeTemplateSpec describes the data a volume should have when created from a template.

Jump to

Keyboard shortcuts

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