common

package
v0.0.0-...-4486d49 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// BITSIZE -
	BITSIZE int = 4096
)

Variables

This section is empty.

Functions

func CreateOrGetCustomConfigMap

func CreateOrGetCustomConfigMap(
	ctx context.Context,
	r ReconcilerCommon,
	configMap *corev1.ConfigMap,
) (string, error)

CreateOrGetCustomConfigMap -

func EncodePrivateKeyToPEM

func EncodePrivateKeyToPEM(privateKey *rsa.PrivateKey) string

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(privatekey *rsa.PublicKey) (string, error)

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

func GetGroupLabel

func GetGroupLabel(serviceName string) string

GetGroupLabel -

func GetLabels

func GetLabels(
	obj metav1.Object,
	groupLabel string,
	custom map[string]string,
) map[string]string

GetLabels - create default labels map, additional custom labels can be passed

func GetOwnerNameLabelSelector

func GetOwnerNameLabelSelector(groupLabel string) string

GetOwnerNameLabelSelector -

func GetOwnerNameSpaceLabelSelector

func GetOwnerNameSpaceLabelSelector(groupLabel string) string

GetOwnerNameSpaceLabelSelector -

func GetOwnerUIDLabelSelector

func GetOwnerUIDLabelSelector(groupLabel string) string

GetOwnerUIDLabelSelector -

func MergeVolumeMounts

func MergeVolumeMounts(vols []corev1.VolumeMount, newVols []corev1.VolumeMount) []corev1.VolumeMount

MergeVolumeMounts - merge container volume mounts in-place

func MergeVolumes

func MergeVolumes(vols []corev1.Volume, newVols []corev1.Volume) []corev1.Volume

MergeVolumes - merge pod volumes in-place

func SSHKeySecret

func SSHKeySecret(name string, namespace string, labels map[string]string) (*corev1.Secret, error)

SSHKeySecret - func

Types

type Probe

type Probe struct {
	// ProbeType, either readiness, or liveness
	ProbeType           ProbeType
	Command             string
	InitialDelaySeconds int32 // min value 1
	PeriodSeconds       int32 // min value 1
	TimeoutSeconds      int32 // min value 1
	FailureThreshold    int32 // min value 1
}

Probe details

func (*Probe) GetProbe

func (p *Probe) GetProbe() *corev1.Probe

GetProbe -

type ProbeType

type ProbeType string

ProbeType -

const (
	// ProbeTypeReadiness - readiness
	ProbeTypeReadiness ProbeType = "readiness"
	// ProbeTypeLiveness - liveness
	ProbeTypeLiveness ProbeType = "liveness"
)

type ReconcilerCommon

type ReconcilerCommon interface {
	GetClient() client.Client
	GetKClient() kubernetes.Interface
	GetLogger() logr.Logger
	GetScheme() *runtime.Scheme
}

ReconcilerCommon - common reconciler interface

Jump to

Keyboard shortcuts

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