Documentation ¶
Index ¶
- Constants
- Variables
- func AddBuiltInNoProxy(noProxy string) string
- func AddFinalizer(obj metav1.Object, finalizer string)
- func ContainsFinalizer(obj metav1.Object, finalizer string) bool
- func EncodePrivateKeyToPEM(privateKey *rsa.PrivateKey) []byte
- func EncodeVars(vars map[string]string) map[string]string
- func GeneratePrivateKey(bitSize int) (*rsa.PrivateKey, error)
- func GeneratePublicKey(publicKey *rsa.PublicKey) ([]byte, error)
- func GetBackingImage(backingImageCache ctllhv1.BackingImageCache, ...) (*v1beta2.BackingImage, error)
- func GetBackingImageDataSourceName(backingImageCache ctllhv1.BackingImageCache, ...) (string, error)
- func GetBackingImageName(backingImageCache ctllhv1.BackingImageCache, ...) (string, error)
- func GetImageDefaultStorageClassParameters() map[string]string
- func GetImageStorageClassName(imageName string) string
- func GetImageStorageClassParameters(backingImageCache ctllhv1.BackingImageCache, ...) (map[string]string, error)
- func GetProvisionedPVCProvisioner(pvc *corev1.PersistentVolumeClaim) string
- func GetValue(data map[string]interface{}, keys ...string) (interface{}, bool)
- func IsRetriableNetworkError(err error) bool
- func IsStillExists(err error) bool
- func LoadCSIDriverConfig(settingCache ctlharvesterv1.SettingCache) (map[string]settings.CSIDriverInfo, error)
- func NewStillExists(qualifiedResource schema.GroupResource, name string) *apierrors.StatusError
- func ReGenerateNTPServers(ntpSettings *NTPSettings, curNTPServers []string) string
- func RemoveFinalizer(obj metav1.Object, finalizer string)
- func ResponseBody(obj interface{}) []byte
- func ResponseError(rw http.ResponseWriter, statusCode int, err error)
- func ResponseErrorMsg(rw http.ResponseWriter, statusCode int, errMsg string)
- func ResponseOK(rw http.ResponseWriter)
- func ResponseOKWithBody(rw http.ResponseWriter, obj interface{})
- func VirtClientUpdateVmi(ctx context.Context, client rest.Interface, ...) error
- type HTTPProxyConfig
- type NTPSettings
Constants ¶
View Source
const ( RemovedPVCsAnnotationKey = prefix + "/removedPersistentVolumeClaims" AdditionalCASecretName = "harvester-additional-ca" AdditionalCAFileName = "additional-ca.pem" AnnotationMigrationTarget = prefix + "/migrationTargetNodeName" AnnotationMigrationUID = prefix + "/migrationUID" AnnotationMigrationState = prefix + "/migrationState" AnnotationTimestamp = prefix + "/timestamp" AnnotationVolumeClaimTemplates = prefix + "/volumeClaimTemplates" AnnotationUpgradePatched = prefix + "/upgrade-patched" AnnotationImageID = prefix + "/imageId" AnnotationReservedMemory = prefix + "/reservedMemory" AnnotationHash = prefix + "/hash" AnnotationRunStrategy = prefix + "/vmRunStrategy" AnnotationSnapshotFreezeFS = prefix + "/snapshotFreezeFS" LabelImageDisplayName = prefix + "/imageDisplayName" LabelSetting = prefix + "/setting" LabelVMName = prefix + "/vmName" AnnotationStorageClassName = prefix + "/storageClassName" AnnotationStorageProvisioner = prefix + "/storageProvisioner" AnnotationIsDefaultStorageClassName = "storageclass.kubernetes.io/is-default-class" // AnnotationMigratingPrefix is used to store the migrating vm in the annotation of ResourceQuota // eg: harvesterhci.io/migrating-vm1: jsonOfResourceList, harvesterhci.io/migrating-vm2: jsonOfResourceList AnnotationMigratingPrefix = prefix + "/migrating-" // AnnotationInsufficientResourceQuota is indicated the resource is insufficient of Namespace AnnotationInsufficientResourceQuota = prefix + "/insufficient-resource-quota" AnnotationDefaultUserdataSecret = prefix + "/default-userdata-secret" // Add to rancher-monitoring addon to record grafana pv name AnnotationGrafanaPVName = prefix + "/grafana-pv-name" ContainerdRegistrySecretName = "harvester-containerd-registry" ContainerdRegistryFileName = "registries.yaml" BackupTargetSecretName = "harvester-backup-target-secret" InternalTLSSecretName = "tls-rancher-internal" Rke2IngressNginxAppName = "rke2-ingress-nginx" CattleSystemNamespaceName = "cattle-system" CattleMonitoringSystemNamespace = "cattle-monitoring-system" LonghornSystemNamespaceName = "longhorn-system" LonghornDefaultManagerURL = "http://longhorn-backend.longhorn-system:9500/v1" KubeSystemNamespace = "kube-system" FleetLocalNamespaceName = "fleet-local" LocalClusterName = "local" HarvesterSystemNamespaceName = "harvester-system" RancherLoggingName = "rancher-logging" RancherMonitoringPrometheus = "rancher-monitoring-prometheus" RancherMonitoringAlertmanager = "rancher-monitoring-alertmanager" RancherMonitoring = "rancher-monitoring" RancherMonitoringGrafana = "rancher-monitoring-grafana" CattleLoggingSystemNamespaceName = "cattle-logging-system" HarvesterUpgradeImageRepository = "rancher/harvester-upgrade" GrafanaPVCName = "rancher-monitoring-grafana" RancherMonitoringName = "rancher-monitoring" CattleMonitoringSystemNamespaceName = "cattle-monitoring-system" HarvesterVMImportController = "vm-import-controller-harvester-vm-import-controller" HTTPProxyEnv = "HTTP_PROXY" HTTPSProxyEnv = "HTTPS_PROXY" NoProxyEnv = "NO_PROXY" LonghornOptionBackingImageName = "backingImage" LonghornOptionMigratable = "migratable" AddonValuesAnnotation = "harvesterhci.io/addon-defaults" LabelUpgradeReadMessage = prefix + "/read-message" LabelUpgradeState = prefix + "/upgradeState" UpgradeStateLoggingInfraPrepared = "LoggingInfraPrepared" AnnotationArchiveName = prefix + "/archiveName" LabelUpgradeLog = prefix + "/upgradeLog" LabelUpgradeLogComponent = prefix + "/upgradeLogComponent" UpgradeLogInfraComponent = "infra" UpgradeLogShipperComponent = "shipper" UpgradeLogAggregatorComponent = "aggregator" UpgradeLogDownloaderComponent = "downloader" UpgradeLogFlowComponent = "clusterflow" UpgradeLogArchiveComponent = "log-archive" UpgradeLogOperatorComponent = "operator" UpgradeLogOutputComponent = "clusteroutput" UpgradeLogPackagerComponent = "packager" UpgradeNodeDrainTaintKey = "kubevirt.io/drain" UpgradeNodeDrainTaintValue = "draining" FieldCattlePrefix = "field.cattle.io" CattleAnnotationResourceQuota = FieldCattlePrefix + "/resourceQuota" ManagementCattlePrefix = "management.cattle.io" LabelManagementDefaultResourceQuota = "resourcequota." + ManagementCattlePrefix + "/default-resource-quota" DefaultFleetControllerConfigMapName = "fleet-controller" DefaultFleetControllerConfigMapNamespace = "cattle-fleet-system" RancherInternalCASetting = "internal-cacerts" RancherInternalServerURLSetting = "internal-server-url" APIServerURLKey = "apiServerURL" APIServerCAKey = "apiServerCA" RKEControlPlaneRoleLabel = "rke.cattle.io/control-plane-role" )
View Source
const ( AnnStorageProvisioner = "volume.kubernetes.io/storage-provisioner" AnnBetaStorageProvisioner = "volume.beta.kubernetes.io/storage-provisioner" LonghornDataLocality = "dataLocality" )
View Source
const (
StatusReasonStillExists metav1.StatusReason = "StillExists"
)
Variables ¶
View Source
var (
PersistentVolumeClaimsKind = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "PersistentVolumeClaim"}
)
Functions ¶
func AddBuiltInNoProxy ¶ added in v1.0.0
func AddFinalizer ¶ added in v1.1.2
func ContainsFinalizer ¶ added in v1.1.2
func EncodePrivateKeyToPEM ¶
func EncodePrivateKeyToPEM(privateKey *rsa.PrivateKey) []byte
EncodePrivateKeyToPEM encodes Private Key from RSA to PEM format
func GeneratePrivateKey ¶
func GeneratePrivateKey(bitSize int) (*rsa.PrivateKey, error)
GeneratePrivateKey creates a RSA Private Key of specified byte size
func GeneratePublicKey ¶
GeneratePublicKey take a rsa.PublicKey and return bytes suitable for writing to .pub file returns in the format "ssh-rsa ..."
func GetBackingImage ¶ added in v1.2.2
func GetBackingImage(backingImageCache ctllhv1.BackingImageCache, image *harvesterv1.VirtualMachineImage) (*v1beta2.BackingImage, error)
func GetBackingImageDataSourceName ¶ added in v1.2.2
func GetBackingImageDataSourceName(backingImageCache ctllhv1.BackingImageCache, image *harvesterv1.VirtualMachineImage) (string, error)
func GetBackingImageName ¶ added in v1.1.0
func GetBackingImageName(backingImageCache ctllhv1.BackingImageCache, image *harvesterv1.VirtualMachineImage) (string, error)
func GetImageDefaultStorageClassParameters ¶ added in v1.1.0
func GetImageStorageClassName ¶ added in v1.1.0
func GetImageStorageClassParameters ¶ added in v1.1.0
func GetImageStorageClassParameters(backingImageCache ctllhv1.BackingImageCache, image *harvesterv1.VirtualMachineImage) (map[string]string, error)
func GetProvisionedPVCProvisioner ¶ added in v1.1.0
func GetProvisionedPVCProvisioner(pvc *corev1.PersistentVolumeClaim) string
GetProvisionedPVCProvisioner do not use this function when the PVC is just created
func GetValue ¶ added in v1.2.2
GetValue retrieve value from map[string]interface{} by keys example: GetValue(map[string]interface{}{"a": map[string]interface{}{"b": "c"}}, "a", "b") -> "c"
func IsRetriableNetworkError ¶ added in v1.1.2
func IsStillExists ¶ added in v1.0.1
func LoadCSIDriverConfig ¶ added in v1.2.0
func LoadCSIDriverConfig(settingCache ctlharvesterv1.SettingCache) (map[string]settings.CSIDriverInfo, error)
LoadCSIDriverConfig loads the CSI driver configuration from settings.
func NewStillExists ¶ added in v1.0.1
func NewStillExists(qualifiedResource schema.GroupResource, name string) *apierrors.StatusError
func ReGenerateNTPServers ¶ added in v1.2.0
func ReGenerateNTPServers(ntpSettings *NTPSettings, curNTPServers []string) string
func RemoveFinalizer ¶ added in v1.1.2
func ResponseBody ¶
func ResponseBody(obj interface{}) []byte
func ResponseError ¶
func ResponseError(rw http.ResponseWriter, statusCode int, err error)
func ResponseErrorMsg ¶
func ResponseErrorMsg(rw http.ResponseWriter, statusCode int, errMsg string)
func ResponseOK ¶
func ResponseOK(rw http.ResponseWriter)
func ResponseOKWithBody ¶
func ResponseOKWithBody(rw http.ResponseWriter, obj interface{})
Types ¶
type HTTPProxyConfig ¶ added in v1.0.0
type NTPSettings ¶ added in v1.2.0
type NTPSettings struct {
NTPServers []string `json:"ntpServers,omitempty"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.