utils

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FLUX_LABEL          = "flux.codesink.net.flux"
	FluxcloudImage      = "justinbarrick/fluxcloud"
	FluxcloudVersion    = "v0.3.4"
	FluxOperatorImage   = "justinbarrick/flux-operator"
	FluxImage           = "quay.io/weaveworks/flux"
	FluxVersion         = "1.8.1"
	HelmOperatorImage   = "quay.io/weaveworks/helm-operator"
	HelmOperatorVersion = "0.4.0"
	MemcachedImage      = "memcached"
	MemcachedVersion    = "1.4.36-alpine"
	TillerImage         = "gcr.io/kubernetes-helm/tiller"
	TillerVersion       = "v2.9.1"
)

Variables

This section is empty.

Functions

func BoolEnv

func BoolEnv(name string) bool

Get an environment variable, pass through strconv.ParseBool, return false if there is an error.

func ClearObjectHash

func ClearObjectHash(obj runtime.Object)

Takes a Kubernetes object and removes the annotation with its hash.

func FluxLabels

func FluxLabels(cr *v1alpha1.Flux) map[string]string

Return the labels that should be set on any object owned by a Flux.

func FluxNamespace

func FluxNamespace(cr *v1alpha1.Flux) string

Return the namespace the CR's resources should be created in.

func GetObject

func GetObject(object runtime.Object, existing []runtime.Object) runtime.Object

Return the object from existing that matches Name, Namespace, and Kind with object.

func GetObjectHash

func GetObjectHash(obj runtime.Object) string

Takes a Kubernetes object and returns the hash in its annotations as a string.

func Getenv

func Getenv(name, value string) string

Getenv returns an environment variable or `value` if it does not exist.

func HashObject

func HashObject(obj runtime.Object) string

Return a SHA1 hash of a Kubernetes object

func LatestRelease added in v0.0.2

func LatestRelease(repo string) (string, error)

func ListOptionsForFlux

func ListOptionsForFlux(cr *v1alpha1.Flux) *metav1.ListOptions

Return the list options that can be used to find an object owned by a Flux.

func NewObjectMeta

func NewObjectMeta(cr *v1alpha1.Flux, name string) metav1.ObjectMeta

Returns an ObjectMeta for a CR, if name is an empty string it defaults to `"flux-"` + `cr.Name`

func ObjectName

func ObjectName(object runtime.Object) string

Return a human readable name for an object.

func ObjectNameMatches

func ObjectNameMatches(first runtime.Object, second runtime.Object) bool

Return true if first and second have the same Name, Namespace, and Kind.

func OwnedByFlux

func OwnedByFlux(cr *v1alpha1.Flux, obj runtime.Object) bool

Return true if the object is owned by the Flux.

func ReadableObjectName

func ReadableObjectName(cr *v1alpha1.Flux, object runtime.Object) string

Return a human readable string representing the object.

func SetObjectHash

func SetObjectHash(obj runtime.Object)

Takes a Kubernetes object and adds an annotation with its hash.

func SetObjectOwner

func SetObjectOwner(cr *v1alpha1.Flux, obj runtime.Object)

Set the owner of an object.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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