cdutils

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetImageReferenceByName

func GetImageReferenceByName(cd *cdv2.ComponentDescriptor, name string) (string, error)

GetImageReferenceByName returns the image reference of a resource with the given name from a component descriptor.

func GetImageReferenceFromList

func GetImageReferenceFromList(cdList *cdv2.ComponentDescriptorList, componentName, resourceName string) (string, error)

GetImageReferenceFromList returns the image reference of a resource with the given name from a component descriptor. If the component name and resource name is not unique the first found object is used.

func GetLabel

func GetLabel(labels []v2.Label, name string) (v2.Label, bool)

GetLabel returns the label with a given name

func GetLabelIdx

func GetLabelIdx(labels []v2.Label, name string) int

GetLabelIdx returns the index with a given name. if the label with the given name does not exist, -1 is returned.

func MergeIdentityObjectMeta

func MergeIdentityObjectMeta(a, b v2.IdentityObjectMeta) v2.IdentityObjectMeta

MergeIdentityObjectMeta merges two identity objects. Labels are merged by their name not by their index.

func MergeResources

func MergeResources(a, b v2.Resource) v2.Resource

MergeResources merges two resources whereas the second one will overwrite defined attributes. Labels are merged by their name not by their index.

func MergeSources

func MergeSources(a, b v2.Source) v2.Source

MergeSources merges two sources whereas the second one will overwrite defined attributes. Labels are merged by their name not by their index.

func ParseImageReference

func ParseImageReference(imageReference string) (string, string, string, error)

ParseImageReference takes an image reference e.g eu.gcr.io/gardener-project/gardener/gardenlet:v1.11.3 returns first argument: the image repository second argument: the tag or the SHA256 third argument: the separator (either ":" when it is a tag or "@" if it is a SHA256)

func SetExtraIdentityField

func SetExtraIdentityField(o *v2.IdentityObjectMeta, key, val string)

SetExtraIdentityField sets a extra identity field of a identity object.

func SetLabel

func SetLabel(labels []v2.Label, name string, val interface{}) ([]v2.Label, error)

SetLabel adds the given name and val as label to the given list

func SetRawLabel

func SetRawLabel(labels []v2.Label, name string, val []byte) []v2.Label

SetRawLabel adds the given name and val as label to the given list

func StringDefined

func StringDefined(s string) bool

StringDefined validates if a string is defined

Types

This section is empty.

Jump to

Keyboard shortcuts

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