guestfs

package
v0.48.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 19 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

This section is empty.

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 SetDefaultImageSet

func SetDefaultImageSet()

SetDefaultImageSet sets the default function to set the image

func SetImageSetFunc

func SetImageSetFunc(f ImageSet)

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

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 ImageSet

type ImageSet func(virtClient kubecli.KubevirtClient) error

ImageSet is a function to set the setImage

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