guestfs

package
v1.4.0-alpha.0 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: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// KvmDevice defines the resource as in pkg/virt-controller/services/template.go, but we don't import the package to avoid compile conflicts when the os is windows
	KvmDevice = "devices.kubevirt.io/kvm"
)

Variables

View Source
var (
	ImagePtr = &image
)

Functions

func NewGuestfsShellCommand

func NewGuestfsShellCommand(clientConfig clientcmd.ClientConfig) *cobra.Command

NewGuestfsShellCommand returns a cobra.Command for starting libguestfs-tool pod and attach it to a pvc

func SetAttacher

func SetAttacher(f AttacherCreator)

SetAttacher allows overriding the default attacher function. Useful for creating a mock function for the testing.

func SetClient

func SetClient(f ClientCreator)

SetClient allows overriding the default Kubernetes client. Useful for creating a mock function for the testing.

func SetDefaulAttacher

func SetDefaulAttacher()

SetDefaulAttacher sets the default function to attach to a pod

func SetDefaulClient

func SetDefaulClient()

SetDefaulClient sets the default function to create the Kubernetes client

func SetDefaultImageInfoGetFunc added in v0.49.1

func SetDefaultImageInfoGetFunc()

SetDefaultImageInfoGetFunc sets the default function to get image info

func SetDefaultImageSet

func SetDefaultImageSet()

SetDefaultImageSet sets the default function to set the image

func SetImageInfoGetFunc added in v0.49.1

func SetImageInfoGetFunc(f ImageInfoGet)

SetImageInfoGetFunc sets the function to get image info

func SetImageSetFunc

func SetImageSetFunc(f ImageSet)

SetImageSetFunc sets the function to set the image

Types

type AttacherCreator

type AttacherCreator func(client *K8sClient, p *corev1.Pod, command string) error

AttacherCreator is a function that attach a command to a pod using the Kubernetes client

type ClientCreator

type ClientCreator func(config *rest.Config, virtClientConfig clientcmd.ClientConfig) (*K8sClient, error)

ClientCreator is a function to return the Kubernetes client

type ImageInfoGet added in v0.49.1

type ImageInfoGet func(virtClient kubecli.KubevirtClient) (*kubecli.GuestfsInfo, error)

ImageInfoGet is a function to get image info

var ImageInfoGetFunc ImageInfoGet

type ImageSet

type ImageSet func(virtClient kubecli.KubevirtClient) error

ImageSet is a function to set the setImage

var ImageSetFunc ImageSet

type K8sClient

type K8sClient struct {
	Client kubernetes.Interface

	VirtClient kubecli.KubevirtClient
	// contains filtered or unexported fields
}

K8sClient holds the information of the Kubernetes client

Jump to

Keyboard shortcuts

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