types

package
v0.56.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PatchReplaceOp = "replace"
	PatchTestOp    = "test"
	PatchAddOp     = "add"
)
View Source
const MiB = 1024 * 1024

Variables

This section is empty.

Functions

func EscapeJSONPointer added in v0.56.0

func EscapeJSONPointer(ptr string) string

func GeneratePatchPayload added in v0.55.0

func GeneratePatchPayload(patches ...PatchOperation) ([]byte, error)

func GenerateTestReplacePatch added in v0.55.0

func GenerateTestReplacePatch(path string, oldValue, newValue interface{}) ([]byte, error)

func GetFilesystemOverhead added in v0.56.0

func GetFilesystemOverhead(volumeMode *k8sv1.PersistentVolumeMode, storageClass *string, cdiConfig *cdiv1.CDIConfig) cdiv1.Percent

func GetSizeIncludingFSOverhead added in v0.56.0

func GetSizeIncludingFSOverhead(size *resource.Quantity, storageClass *string, volumeMode *k8sv1.PersistentVolumeMode, cdiConfig *cdiv1.CDIConfig) (*resource.Quantity, error)

func GetSizeIncludingGivenOverhead added in v0.56.0

func GetSizeIncludingGivenOverhead(size *resource.Quantity, overhead cdiv1.Percent) (*resource.Quantity, error)

func HasSharedAccessMode added in v0.45.0

func HasSharedAccessMode(accessModes []k8sv1.PersistentVolumeAccessMode) bool

func IsPVCBlock added in v0.50.0

func IsPVCBlock(volumeMode *k8sv1.PersistentVolumeMode) bool

func IsPVCBlockFromStore

func IsPVCBlockFromStore(store cache.Store, namespace string, claimName string) (pvc *k8sv1.PersistentVolumeClaim, exists bool, isBlockDevice bool, err error)

func IsPreallocated added in v0.40.0

func IsPreallocated(annotations map[string]string) bool

func IsReadOnlyAccessMode added in v0.56.0

func IsReadOnlyAccessMode(accessModes []k8sv1.PersistentVolumeAccessMode) bool

func PVCNameFromVirtVolume added in v0.44.1

func PVCNameFromVirtVolume(volume *virtv1.Volume) string

func VirtVolumesToPVCMap added in v0.44.1

func VirtVolumesToPVCMap(volumes []*virtv1.Volume, pvcStore cache.Store, namespace string) (map[string]*k8sv1.PersistentVolumeClaim, error)

Types

type CloneSource added in v0.44.1

type CloneSource struct {
	Namespace string
	Name      string
}

func GetCloneSource added in v0.44.1

func GetCloneSource(ctx context.Context, client kubecli.KubevirtClient, vm *virtv1.VirtualMachine, dvSpec *cdiv1.DataVolumeSpec) (*CloneSource, error)

func GetCloneSourceWithInformers added in v0.46.0

func GetCloneSourceWithInformers(vm *virtv1.VirtualMachine, dvSpec *cdiv1.DataVolumeSpec, dataSourceInformer cache.SharedIndexInformer) (*CloneSource, error)

type PatchOperation added in v0.42.0

type PatchOperation struct {
	Op    string      `json:"op"`
	Path  string      `json:"path"`
	Value interface{} `json:"value"`
}

func UnmarshalPatch added in v0.55.0

func UnmarshalPatch(patch []byte) ([]PatchOperation, error)

Jump to

Keyboard shortcuts

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