kubevirt

package
v3.0.0-...-d6c4d9c Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FinalizerNamespace will ensure the deletion of the dedicated namespace.
	FinalizerNamespace = "kubermatic.k8c.io/cleanup-kubevirt-namespace"
	// KubeVirtImagesNamespace namespace contains globally available custom images and cached standard images.
	KubeVirtImagesNamespace = "kubevirt-images"
	// FinalizerClonerRoleBinding will ensure the deletion of the DataVolume cloner role-binding.
	FinalizerClonerRoleBinding = "kubermatic.k8c.io/cleanup-kubevirt-cloner-rbac"
)

Variables

This section is empty.

Functions

func DescribeInstanceType

func DescribeInstanceType(ctx context.Context, kubeconfig string, it *kubevirtv1.InstancetypeMatcher) (*provider.NodeCapacity, error)

DescribeInstanceType returns the NodeCapacity from the VirtualMachine instancetype.

func GenerateKubeconfigWithToken

func GenerateKubeconfigWithToken(restConfig *restclient.Config, sa *corev1.ServiceAccount, token string) ([]byte, error)

func GetCredentialsForCluster

func GetCredentialsForCluster(cloud kubermaticv1.CloudSpec, secretKeySelector provider.SecretKeySelectorValueFunc) (kubeconfig string, err error)

GetCredentialsForCluster returns the credentials for the passed in cloud spec or an error.

func GetKubermaticStandardInstancetypes

GetKubermaticStandardInstancetypes returns the Kubermatic standard VirtualMachineInstancetypes.

func GetKubermaticStandardPreferences

GetKubermaticStandardPreferences returns the Kubermatic standard VirtualMachinePreferences.

func ListStorageClasses

func ListStorageClasses(ctx context.Context, client ctrlruntimeclient.Client, annotationFilter storageClassAnnotationFilter) (apiv2.StorageClassList, error)

ListStorageClasses returns list of storage classes filtered by annotations.

func ReconcileInfraTokenAccess

func ReconcileInfraTokenAccess(ctx context.Context, namespace string, client ctrlruntimeclient.Client) error

ReconcileInfraTokenAccess generates a service account token for KubeVirt CSI access.

Types

type Client

type Client struct {
	ctrlruntimeclient.Client
	// RestConfig represents a rest client configuration
	RestConfig *restclient.Config
}

Client represents a struct that includes controller runtime client and rest configuration that is needed for service accounts kubeconfig generation.

func NewClient

func NewClient(kubeconfig string, opts ClientOptions) (*Client, error)

NewClient returns controller runtime client that points to KubeVirt infra cluster.

func NewFakeClient

func NewFakeClient(kubeconfig string, opts ClientOptions) (*Client, error)

NewFakeClient returns controller runtime fake client.

type ClientOptions

type ClientOptions struct {
	// ControllerRuntimeOptions represents the options coming from controller runtime.
	ControllerRuntimeOptions ctrlruntimeclient.Options
	// FakeObjects allows to inject custom objects for testing.
	FakeObjects []ctrlruntimeclient.Object
	// contains filtered or unexported fields
}

ClientOptions allows to pass specific options that influence the client behaviour.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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