util

package
v0.0.0-...-8bbc6b9 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2016 License: Apache-2.0, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package util implements various utility functions used in both testing and implementation of OpenShift. Package util may not depend on any other package in the OpenShift package tree.

Index

Constants

View Source
const (
	OverwriteExistingDstKey = 1 << iota
	ErrorOnExistingDstKey
	ErrorOnDifferentDstKeyValue
)

MergeInto flags

Variables

This section is empty.

Functions

func AddObjectAnnotations

func AddObjectAnnotations(obj runtime.Object, annotations map[string]string) error

AddObjectAnnotations adds new annotation(s) to a single runtime.Object

func AddObjectLabels

func AddObjectLabels(obj runtime.Object, labels labels.Set) error

AddObjectLabels adds new label(s) to a single runtime.Object

func MergeInto

func MergeInto(dst, src interface{}, flags int) error

MergeInto merges items from a src map into a dst map. Returns an error when the maps are not of the same type. Flags:

  • ErrorOnExistingDstKey When set: Return an error if any of the dst keys is already set.
  • ErrorOnDifferentDstKeyValue When set: Return an error if any of the dst keys is already set to a different value than src key.
  • OverwriteDstKey When set: Overwrite existing dst key value with src key value.

func NoNamespaceKeyFunc

func NoNamespaceKeyFunc(ctx kapi.Context, prefix string, name string) (string, error)

NoNamespaceKeyFunc is the default function for constructing etcd paths to a resource relative to prefix enforcing If a namespace is on context, it errors.

func UniqueStrings

func UniqueStrings(strings []string) []string

UniqueStrings returns a sorted, uniquified slice of the specified strings

Types

This section is empty.

Directories

Path Synopsis
docker
dockerfile
Package dockerfile has utilities that complement Docker's official Dockerfile parser.
Package dockerfile has utilities that complement Docker's official Dockerfile parser.
Package errors provides utility functions for various errors
Package errors provides utility functions for various errors
Package file implements utility functions used to work with arbitrary files.
Package file implements utility functions used to work with arbitrary files.
Package namer contains a name generator for unique names
Package namer contains a name generator for unique names

Jump to

Keyboard shortcuts

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