util

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2019 License: Apache-2.0 Imports: 23 Imported by: 6

Documentation

Overview

* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Copyright 2019 Red Hat, Inc. *

Index

Constants

View Source
const (
	KubeVirtFinalizer string = "foregroundDeleteKubeVirt"

	ConditionReasonDeploymentFailedExisting = "ExistingDeployment"
	ConditionReasonDeploymentFailedError    = "DeploymentFailed"
	ConditionReasonDeletionFailedError      = "DeletionFailed"
	ConditionReasonDeploymentCreated        = "AllResourcesCreated"
	ConditionReasonDeploymentReady          = "AllComponentsReady"
	ConditionReasonDeploying                = "DeploymentInProgress"
	ConditionReasonUpdating                 = "UpdateInProgress"
	ConditionReasonDeleting                 = "DeletionInProgress"
)
View Source
const (
	// Name of env var containing the operator's image name
	OperatorImageEnvName        = "OPERATOR_IMAGE"
	VirtApiShasumEnvName        = "VIRT_API_SHASUM"
	VirtControllerShasumEnvName = "VIRT_CONTROLLER_SHASUM"
	VirtHandlerShasumEnvName    = "VIRT_HANDLER_SHASUM"
	VirtLauncherShasumEnvName   = "VIRT_LAUNCHER_SHASUM"
	KubeVirtVersionEnvName      = "KUBEVIRT_VERSION"
	// Deprecated, use TargetDeploymentConfig instead
	TargetInstallNamespace = "TARGET_INSTALL_NAMESPACE"
	// Deprecated, use TargetDeploymentConfig instead
	TargetImagePullPolicy = "TARGET_IMAGE_PULL_POLICY"
	// JSON containing all relevant deployment properties, replaces TargetInstallNamespace and TargetImagePullPolicy
	TargetDeploymentConfig = "TARGET_DEPLOYMENT_CONFIG"

	// these names need to match field names from KubeVirt Spec if they are set from there
	AdditionalPropertiesNamePullPolicy = "ImagePullPolicy"

	// lookup key in AdditionalProperties
	AdditionalPropertiesMonitorNamespace = "monitorNamespace"

	// lookup key in AdditionalProperties
	AdditionalPropertiesMonitorServiceAccount = "monitorAccount"

	// account to use if one is not explicitly named
	DefaultMonitorNamespace = "openshift-monitoring"

	// account to use if one is not explicitly named
	DefaultMonitorAccount = "prometheus-k8s"
)

Variables

This section is empty.

Functions

func AddFinalizer

func AddFinalizer(kv *virtv1.KubeVirt)

func DaemonsetIsReady added in v0.16.0

func DaemonsetIsReady(kv *v1.KubeVirt, daemonset *appsv1.DaemonSet, stores Stores) bool

func DeploymentIsReady added in v0.16.0

func DeploymentIsReady(kv *v1.KubeVirt, deployment *appsv1.Deployment, stores Stores) bool

func IsManagedByOperator added in v0.20.0

func IsManagedByOperator(labels map[string]string) bool

func IsSCCStoreEmpty added in v0.20.0

func IsSCCStoreEmpty(store cache.Store) bool

func IsServiceMonitorEnabled added in v0.20.6

func IsServiceMonitorEnabled(clientset kubecli.KubevirtClient) (bool, error)

func IsStoreEmpty

func IsStoreEmpty(store cache.Store) bool

func SetConditionTimestamps added in v0.20.0

func SetConditionTimestamps(kvOrig *virtv1.KubeVirt, kvUpdated *virtv1.KubeVirt)

func SetOperatorVersion added in v0.16.0

func SetOperatorVersion(kv *virtv1.KubeVirt)

func UpdateConditionsAvailable added in v0.20.0

func UpdateConditionsAvailable(kv *virtv1.KubeVirt)

func UpdateConditionsCreated added in v0.20.0

func UpdateConditionsCreated(kv *virtv1.KubeVirt)

func UpdateConditionsDeleting added in v0.20.0

func UpdateConditionsDeleting(kv *virtv1.KubeVirt)

func UpdateConditionsDeletionFailed added in v0.20.0

func UpdateConditionsDeletionFailed(kv *virtv1.KubeVirt, err error)

func UpdateConditionsDeploying added in v0.20.0

func UpdateConditionsDeploying(kv *virtv1.KubeVirt)

func UpdateConditionsFailedError added in v0.20.0

func UpdateConditionsFailedError(kv *virtv1.KubeVirt, err error)

func UpdateConditionsFailedExists added in v0.20.0

func UpdateConditionsFailedExists(kv *virtv1.KubeVirt)

func UpdateConditionsUpdating added in v0.20.0

func UpdateConditionsUpdating(kv *virtv1.KubeVirt)

func VerifyEnv added in v0.20.0

func VerifyEnv() error

Types

type Informers

type Informers struct {
	ServiceAccount           cache.SharedIndexInformer
	ClusterRole              cache.SharedIndexInformer
	ClusterRoleBinding       cache.SharedIndexInformer
	Role                     cache.SharedIndexInformer
	RoleBinding              cache.SharedIndexInformer
	Crd                      cache.SharedIndexInformer
	Service                  cache.SharedIndexInformer
	Deployment               cache.SharedIndexInformer
	DaemonSet                cache.SharedIndexInformer
	ValidationWebhook        cache.SharedIndexInformer
	SCC                      cache.SharedIndexInformer
	InstallStrategyConfigMap cache.SharedIndexInformer
	InstallStrategyJob       cache.SharedIndexInformer
	InfrastructurePod        cache.SharedIndexInformer
	PodDisruptionBudget      cache.SharedIndexInformer
	ServiceMonitor           cache.SharedIndexInformer
}

type KubeVirtDeploymentConfig

type KubeVirtDeploymentConfig struct {
	ID          string `json:"id,omitempty" optional:"true"`
	Namespace   string `json:"namespace,omitempty" optional:"true"`
	Registry    string `json:"registry,omitempty" optional:"true"`
	ImagePrefix string `json:"imagePrefix,omitempty" optional:"true"`

	// the KubeVirt version
	// matches the image tag, if tags are used, either by the manifest, or by the KubeVirt CR
	// used on the KubeVirt CR status and on annotations, and for determing up-/downgrade path, even when using shasums for the images
	KubeVirtVersion string `json:"kubeVirtVersion,omitempty" optional:"true"`

	// the shasums of every image we use
	VirtOperatorSha   string `json:"virtOperatorSha,omitempty" optional:"true"`
	VirtApiSha        string `json:"virtApiSha,omitempty" optional:"true"`
	VirtControllerSha string `json:"virtControllerSha,omitempty" optional:"true"`
	VirtHandlerSha    string `json:"virtHandlerSha,omitempty" optional:"true"`
	VirtLauncherSha   string `json:"virtLauncherSha,omitempty" optional:"true"`

	// everything else, which can e.g. come from KubeVirt CR spec
	AdditionalProperties map[string]string `json:"additionalProperties,omitempty" optional:"true"`
}

func GetConfigFromEnv added in v0.20.0

func GetConfigFromEnv() (*KubeVirtDeploymentConfig, error)

func GetObservedConfigFromKV added in v0.20.0

func GetObservedConfigFromKV(kv *v1.KubeVirt) *KubeVirtDeploymentConfig

func GetTargetConfigFromKV added in v0.20.0

func GetTargetConfigFromKV(kv *v1.KubeVirt) *KubeVirtDeploymentConfig

func (*KubeVirtDeploymentConfig) GetApiVersion added in v0.20.0

func (c *KubeVirtDeploymentConfig) GetApiVersion() string

func (*KubeVirtDeploymentConfig) GetControllerVersion added in v0.20.0

func (c *KubeVirtDeploymentConfig) GetControllerVersion() string

func (*KubeVirtDeploymentConfig) GetDeploymentID added in v0.20.0

func (c *KubeVirtDeploymentConfig) GetDeploymentID() string

func (*KubeVirtDeploymentConfig) GetHandlerVersion added in v0.20.0

func (c *KubeVirtDeploymentConfig) GetHandlerVersion() string

func (*KubeVirtDeploymentConfig) GetImagePrefix added in v0.20.8

func (c *KubeVirtDeploymentConfig) GetImagePrefix() string

func (*KubeVirtDeploymentConfig) GetImagePullPolicy added in v0.20.0

func (c *KubeVirtDeploymentConfig) GetImagePullPolicy() k8sv1.PullPolicy

func (*KubeVirtDeploymentConfig) GetImageRegistry added in v0.20.0

func (c *KubeVirtDeploymentConfig) GetImageRegistry() string

func (*KubeVirtDeploymentConfig) GetJson added in v0.20.0

func (c *KubeVirtDeploymentConfig) GetJson() (string, error)

func (*KubeVirtDeploymentConfig) GetKubeVirtVersion added in v0.20.0

func (c *KubeVirtDeploymentConfig) GetKubeVirtVersion() string

func (*KubeVirtDeploymentConfig) GetLauncherVersion added in v0.20.0

func (c *KubeVirtDeploymentConfig) GetLauncherVersion() string

func (*KubeVirtDeploymentConfig) GetMonitorNamespace added in v0.20.6

func (c *KubeVirtDeploymentConfig) GetMonitorNamespace() string

func (*KubeVirtDeploymentConfig) GetMonitorServiceAccount added in v0.20.6

func (c *KubeVirtDeploymentConfig) GetMonitorServiceAccount() string

func (*KubeVirtDeploymentConfig) GetNamespace added in v0.20.0

func (c *KubeVirtDeploymentConfig) GetNamespace() string

func (*KubeVirtDeploymentConfig) GetOperatorVersion added in v0.20.0

func (c *KubeVirtDeploymentConfig) GetOperatorVersion() string

func (*KubeVirtDeploymentConfig) GetVerbosity added in v0.20.0

func (c *KubeVirtDeploymentConfig) GetVerbosity() string

func (*KubeVirtDeploymentConfig) SetObservedDeploymentConfig added in v0.20.0

func (c *KubeVirtDeploymentConfig) SetObservedDeploymentConfig(kv *v1.KubeVirt) error

func (*KubeVirtDeploymentConfig) SetTargetDeploymentConfig added in v0.20.0

func (c *KubeVirtDeploymentConfig) SetTargetDeploymentConfig(kv *v1.KubeVirt) error

func (*KubeVirtDeploymentConfig) UseShasums added in v0.20.0

func (c *KubeVirtDeploymentConfig) UseShasums() bool

type Stores

type Stores struct {
	ServiceAccountCache           cache.Store
	ClusterRoleCache              cache.Store
	ClusterRoleBindingCache       cache.Store
	RoleCache                     cache.Store
	RoleBindingCache              cache.Store
	CrdCache                      cache.Store
	ServiceCache                  cache.Store
	DeploymentCache               cache.Store
	DaemonSetCache                cache.Store
	ValidationWebhookCache        cache.Store
	SCCCache                      cache.Store
	InstallStrategyConfigMapCache cache.Store
	InstallStrategyJobCache       cache.Store
	InfrastructurePodCache        cache.Store
	PodDisruptionBudgetCache      cache.Store
	ServiceMonitorCache           cache.Store
	IsOnOpenshift                 bool
	ServiceMonitorEnabled         bool
}

func (*Stores) AllEmpty

func (s *Stores) AllEmpty() bool

Jump to

Keyboard shortcuts

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