Documentation ¶
Index ¶
- Constants
- Variables
- func NewGuestfsShellCommand(clientConfig clientcmd.ClientConfig) *cobra.Command
- func SetAttacher(f AttacherCreator)
- func SetClient(f ClientCreator)
- func SetDefaulAttacher()
- func SetDefaulClient()
- func SetDefaultImageInfoGetFunc()
- func SetDefaultImageSet()
- func SetImageInfoGetFunc(f ImageInfoGet)
- func SetImageSetFunc(f ImageSet)
- type AttacherCreator
- type ClientCreator
- type ImageInfoGet
- type ImageSet
- type K8sClient
Constants ¶
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 ¶
var (
ExportedImage string
)
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 ¶
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