util

package
v0.0.2-pre Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

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"
	AnnotationImageID              = prefix + "/imageId"
	AnnotationReservedMemory       = prefix + "/reservedMemory"
	AnnotationHash                 = prefix + "/hash"
	AnnotationRunStrategy          = prefix + "/vmRunStrategy"

	BackupTargetSecretName      = "harvester-backup-target-secret"
	InternalTLSSecretName       = "tls-rancher-internal"
	Rke2IngressNginxAppName     = "rke2-ingress-nginx"
	CattleSystemNamespaceName   = "cattle-system"
	LonghornSystemNamespaceName = "longhorn-system"
	KubeSystemNamespace         = "kube-system"

	HTTPProxyEnv  = "HTTP_PROXY"
	HTTPSProxyEnv = "HTTPS_PROXY"
	NoProxyEnv    = "NO_PROXY"
)
View Source
const (
	StatusReasonStillExists metav1.StatusReason = "StillExists"
)

Variables

This section is empty.

Functions

func AddBuiltInNoProxy

func AddBuiltInNoProxy(noProxy string) string

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

func GeneratePublicKey(publicKey *rsa.PublicKey) ([]byte, error)

GeneratePublicKey take a rsa.PublicKey and return bytes suitable for writing to .pub file returns in the format "ssh-rsa ..."

func IsStillExists

func IsStillExists(err error) bool

func NewStillExists

func NewStillExists(qualifiedResource schema.GroupResource, name string) *apierrors.StatusError

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{})

func VirtClientUpdateVmi

func VirtClientUpdateVmi(ctx context.Context, client rest.Interface, managementNamespace, namespace, name string, obj runtime.Object) error

Types

type HTTPProxyConfig

type HTTPProxyConfig struct {
	HTTPProxy  string `json:"httpProxy,omitempty"`
	HTTPSProxy string `json:"httpsProxy,omitempty"`
	NoProxy    string `json:"noProxy,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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