releaseutil

package
v2.5.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectAnnotations

func InjectAnnotations(resource string, annos map[AnnotationKey]string) string

InjectAnnotations adds key-value pairs to resource annotations. If resource is not a valid kubernetes resource, it does nothing and returns original resource.

func MatchRelease

func MatchRelease(a, b runtime.Object) bool

MatchRelease matches two object and check if they are from same release

func MatchReleaseByString

func MatchReleaseByString(a, b string) bool

MatchReleaseByString matches two object string and check if they are from same release

func Reverse

func Reverse(list []*rspb.Release, sortFn func([]*rspb.Release))

Reverse reverses the list of releases sorted by the sort func.

func SortByDate

func SortByDate(list []*rspb.Release)

SortByDate returns the list of releases sorted by a release's last deployed time (in seconds).

func SortByName

func SortByName(list []*rspb.Release)

SortByName returns the list of releases sorted in lexicographical order.

func SortByRevision

func SortByRevision(list []*rspb.Release)

SortByRevision returns the list of releases sorted by a release's revision number (release.Version).

func SplitManifests

func SplitManifests(bigFile string) map[string]string

SplitManifests takes a string of manifest and returns a map contains individual manifests

Types

type AnnotationKey

type AnnotationKey string

AnnotationKey is annotation key of kubernetes object

const (
	// DefaultPathKey is the key of chart logic path. Logic path splits components by
	// slash. For example:
	// A chart like:
	// rootchart --> subchart1
	//           |-> subchart2
	// The logic path of every charts:
	// rootchart: rootchart
	// subchart1: rootchart/subchart1
	// subchart2: rootchart/subchart2
	// If a kubernetes resource object have an annotation key named "helm.sh/path", Then
	// its value should meet the requirements.
	DefaultPathKey AnnotationKey = "helm.sh/path"
	// defaultNamespaceKey is the key of release namespace
	DefaultNamespaceKey AnnotationKey = "helm.sh/namespace"
	// defaultReleaseKey is the key of release name
	DefaultReleaseKey AnnotationKey = "helm.sh/release"
)

type FilterFunc

type FilterFunc func(*rspb.Release) bool

FilterFunc returns true if the release object satisfies the predicate of the underlying filter func.

func All

func All(filters ...FilterFunc) FilterFunc

All returns a FilterFunc that filters a list of releases determined by the predicate 'f0 && f1 && ... && fn'.

func Any

func Any(filters ...FilterFunc) FilterFunc

Any returns a FilterFunc that filters a list of releases determined by the predicate 'f0 || f1 || ... || fn'.

func StatusFilter

func StatusFilter(status rspb.Status_Code) FilterFunc

StatusFilter filters a set of releases by status code.

func (FilterFunc) Check

func (fn FilterFunc) Check(rls *rspb.Release) bool

Check applies the FilterFunc to the release object.

func (FilterFunc) Filter

func (fn FilterFunc) Filter(rels []*rspb.Release) (rets []*rspb.Release)

Filter applies the filter(s) to the list of provided releases returning the list that satisfies the filtering predicate.

type SimpleHead

type SimpleHead struct {
	Version  string `json:"apiVersion"`
	Kind     string `json:"kind,omitempty"`
	Metadata *struct {
		Name        string            `json:"name"`
		Annotations map[string]string `json:"annotations"`
	} `json:"metadata,omitempty"`
}

SimpleHead defines what the structure of the head of a manifest file

Jump to

Keyboard shortcuts

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