Documentation ¶
Index ¶
- func AdminUserExists(ctx context.Context, harborClient *h.RESTClient) (bool, error)
- func BoolToString(b bool) string
- func CreateSpecHash(spec *helmclient.ChartSpec) (string, error)
- func GetValueFromSecret(sec *corev1.Secret, key string) (string, error)
- func InstanceToChartSpec(ctx context.Context, c client.Client, instance *v1alpha2.Instance) (*helmclient.ChartSpec, error)
- func NewRandomPassword(passwordStrength int32) (string, error)
- func ObjExists(ctx context.Context, cl client.Client, name, namespace string, ...) (bool, error)
- func ToHarborRegistry(spec v1alpha2.RegistrySpec, id int64, credential *model.RegistryCredential) *model.Registry
- func ToHarborRegistryCredential(ctx context.Context, c client.Client, namespace string, ...) (*model.RegistryCredential, error)
- type InterfaceHash
- type JSONPatch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdminUserExists ¶ added in v1.3.10
AdminUserExists checks whether the preconfigured 'admin' user already exists and returns accordingly. The user ID of the administrator account is fixed to '1'.
func BoolToString ¶
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 ¶
GetValueFromSecret returns a specific value of a secret key.
func InstanceToChartSpec ¶
func NewRandomPassword ¶
NewRandomPassword returns a random secret string with a given length.
func ObjExists ¶
func ObjExists(ctx context.Context, cl client.Client, name, namespace string, obj client.Object) (bool, error)
ObjExists returns a boolean value based on the existence of a runtime object.
func ToHarborRegistry ¶
func ToHarborRegistry(spec v1alpha2.RegistrySpec, id int64, credential *model.RegistryCredential) *model.Registry
ToHarborRegistry returns a Harbor registry constructed from the provided spec.
func ToHarborRegistryCredential ¶
func ToHarborRegistryCredential(ctx context.Context, c client.Client, namespace string, cred v1alpha2.RegistryCredential) (*model.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.