imageupload

package
v1.5.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: Apache-2.0 Imports: 31 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// PodPhaseAnnotation is the annotation on a PVC containing the upload pod phase
	PodPhaseAnnotation = "cdi.kubevirt.io/storage.pod.phase"

	// PodReadyAnnotation tells whether the uploadserver pod is ready
	PodReadyAnnotation = "cdi.kubevirt.io/storage.pod.ready"

	UsePopulatorAnnotation = "cdi.kubevirt.io/storage.usePopulator"
	PVCPrimeNameAnnotation = "cdi.kubevirt.io/storage.populator.pvcPrime"

	//UploadProxyURIAsync is a URI of the upload proxy, the endpoint is asynchronous
	UploadProxyURIAsync = "/v1beta1/upload-async"

	//UploadProxyURI is a URI of the upload proxy, the endpoint is synchronous for backwards compatibility
	UploadProxyURI = "/v1beta1/upload"

	// ProvisioningFailed stores the 'ProvisioningFailed' event condition used for PVC error handling
	ProvisioningFailed = "ProvisioningFailed"
	// ErrClaimNotValid stores the 'ErrClaimNotValid' event condition used for DV error handling
	ErrClaimNotValid = "ErrClaimNotValid"

	// OptimisticLockErrorMsg is returned by kube-apiserver when trying to update an old version of a resource
	// https://github.com/kubernetes/kubernetes/blob/b89f564539fad77cd22de1b155d84638daf8c83f/staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store.go#L240
	OptimisticLockErrorMsg = "the object has been modified; please apply your changes to the latest version and try again"
)

Variables

View Source
var GetHTTPClientFn = GetHTTPClient

GetHTTPClientFn allows overriding the default http client (useful for unit testing)

View Source
var UploadProcessingCompleteFunc processingCompleteFunc = waitUploadProcessingComplete

UploadProcessingCompleteFunc the function called while determining if post transfer processing is complete.

Functions

func ConstructUploadProxyPath added in v0.15.0

func ConstructUploadProxyPath(uploadProxyURL string) (string, error)

ConstructUploadProxyPath - receives uploadproxy address and concatenates to it URI

func ConstructUploadProxyPathAsync added in v0.26.1

func ConstructUploadProxyPathAsync(uploadProxyURL, token string, insecure bool) (string, error)

ConstructUploadProxyPathAsync - receives uploadproxy address and concatenates to it URI

func GetHTTPClient

func GetHTTPClient(insecure bool) *http.Client

func NewImageUploadCommand

func NewImageUploadCommand() *cobra.Command

NewImageUploadCommand returns a cobra.Command for handling the uploading of VM images

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳