utils

package
v0.0.0-...-cc682f1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetImageRegistry

func GetImageRegistry(image string) (string, error)

Retrieves the registry (domain) part of the input image. If a registry is not found, the default registry (docker.io) is returned. Reference: https://github.com/docker/distribution/blob/release/2.7/reference/reference.go

func GetImageRepository

func GetImageRepository(image string) (string, error)

Retrieves the repository part of input image that contains both a repo path and tag. An error is returned if the image input is empty.

Reference (docker-specific, but should apply to others):

https://github.com/docker/distribution/blob/release/2.7/reference/reference.go
https://docs.docker.com/engine/reference/commandline/tag/

func RemoveTagFromStackImages

func RemoveTagFromStackImages(stack *kabanerov1alpha2.StackVersion, stackName string) error

Removes the tag portion of all images associated with the input stack version.

func SecretAnnotationFilter

func SecretAnnotationFilter(secretList *corev1.SecretList, filterStrings ...string) (*corev1.Secret, error)

Custom filter method that allows the retrieval of a secret containing an annotation with a key of the form [string]-[number] (i.e kabanero.io/git-0), and a value that contains a hostname/domain (i.e. github.com). If there are multiple matching secrets, the annotation with the lexically lowest value key is used. If no secret matches annotation key, but there are secrets with an annotation value that matches the hostname/domain, the first one seen is used. If a secret could not be found, nil is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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