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
- func AddConfigLabels(c *configapi.Config, labels labels.Set) fielderrors.ValidationErrorList
- func AddObjectLabels(obj runtime.Object, labels labels.Set) error
- func MergeInto(dst, src interface{}, flags int) error
- func ReportError(allErrs *fielderrors.ValidationErrorList, index int, ...)
- func UniqueStrings(strings []string) []string
Constants ¶
const ( OverwriteExistingDstKey = 1 << iota ErrorOnExistingDstKey ErrorOnDifferentDstKeyValue )
MergeInto flags
Variables ¶
This section is empty.
Functions ¶
func AddConfigLabels ¶ added in v0.4.3
func AddConfigLabels(c *configapi.Config, labels labels.Set) fielderrors.ValidationErrorList
AddConfigLabels adds new label(s) to all resources defined in the given Config.
func AddObjectLabels ¶ added in v0.4.3
AddObjectLabels adds new label(s) to a single runtime.Object
func MergeInto ¶ added in v0.2.1
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 ReportError ¶ added in v0.4.3
func ReportError(allErrs *fielderrors.ValidationErrorList, index int, err fielderrors.ValidationError)
ReportError reports the single item validation error and properly set the prefix and index to match the Config item JSON index
func UniqueStrings ¶ added in v0.2.2
UniqueStrings returns a sorted, uniquified slice of the specified strings
Types ¶
This section is empty.