helper

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolToString

func BoolToString(b bool) string

BoolToString returns a string depending on the given boolean value.

func CreateSpecHash

func CreateSpecHash(spec *helmclient.ChartSpec) (string, error)

CreateSpecHash returns a hash string constructed with the helm chart spec.

func GetValueFromSecret

func GetValueFromSecret(sec *corev1.Secret, key string) (string, error)

GetValueFromSecret returns a specific value of a secret key.

func InstanceToChartSpec

func InstanceToChartSpec(ctx context.Context, c client.Client, instance *v1alpha2.Instance) (*helmclient.ChartSpec, error)

func NewRandomPassword

func NewRandomPassword(passwordStrength int32) (string, error)

NewRandomPassword returns a random secret string with a given length.

func ObjExists

func ObjExists(ctx context.Context, client client.Client, name, namespace string, obj runtime.Object) (bool, error)

ObjExists returns a boolean value based on the existence of a runtime object.

func PullFinalizer

func PullFinalizer(o metav1.Object, finalizer string)

func PushFinalizer

func PushFinalizer(o metav1.Object, finalizer string)

func ToHarborRegistry

func ToHarborRegistry(spec v1alpha2.RegistrySpec, id int64, credential *legacymodel.RegistryCredential) *legacymodel.Registry

ToHarborRegistry returns a Harbor registry constructed from the provided spec.

func ToHarborRegistryCredential

func ToHarborRegistryCredential(ctx context.Context, c client.Client, namespace string, regcred v1alpha2.RegistryCredential) (*legacymodel.RegistryCredential, error)

Types

type InterfaceHash

type InterfaceHash []byte

func GenerateHashFromInterfaces

func GenerateHashFromInterfaces(interfaces []interface{}) (InterfaceHash, error)

GenerateHashFromInterfaces returns a hash sum based on a slice of given interfaces.

func (*InterfaceHash) Short

func (hash *InterfaceHash) Short() string

Short returns the first 8 characters of an interface hash.

func (*InterfaceHash) String

func (hash *InterfaceHash) String() string

String returns the string value of an interface hash.

type JSONPatch

type JSONPatch struct {
	Ops []jsonPatchOp
}

func (*JSONPatch) AddOp

func (p *JSONPatch) AddOp(op, path string, value interface{})

func (*JSONPatch) Data

func (p *JSONPatch) Data(obj runtime.Object) ([]byte, error)

func (*JSONPatch) Type

func (p *JSONPatch) Type() types.PatchType

Jump to

Keyboard shortcuts

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