guestfs

package
v1.5.0 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: 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 CreateAttacherFunc = CreateAttacher
View Source
var CreateClientFunc = CreateClient

Following variables allow overriding the default functions (useful for unit testing)

View Source
var ImageInfoGetFunc = GetImageInfo
View Source
var ImageSetFunc = SetImage

Functions

func CreateAttacher added in v1.5.0

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

CreateAttacher attaches the stdin, stdout, and stderr to the container shell

func GetImageInfo added in v1.5.0

func GetImageInfo(virtClient kubecli.KubevirtClient) (*kubecli.GuestfsInfo, error)

GetImageInfo gets the image info based on the information on KubeVirt CR

func NewGuestfsShellCommand

func NewGuestfsShellCommand() *cobra.Command

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

func SetImage added in v1.5.0

func SetImage(virtClient kubecli.KubevirtClient) (string, error)

SetImage sets the image name based on the information retrieved by the KubeVirt server.

Types

type K8sClient

type K8sClient struct {
	Client kubernetes.Interface

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

K8sClient holds the information of the Kubernetes client

func CreateClient added in v1.5.0

func CreateClient(virtClient kubecli.KubevirtClient) (*K8sClient, error)

Jump to

Keyboard shortcuts

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