object

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: Apache-2.0 Imports: 5 Imported by: 57

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ObjMetadata

type ObjMetadata struct {
	Namespace string
	Name      string
	GroupKind schema.GroupKind
}

ObjMetadata organizes and stores the indentifying information for an object. This struct (as a string) is stored in a grouping object to keep track of sets of applied objects.

func CreateObjMetadata

func CreateObjMetadata(namespace string, name string, gk schema.GroupKind) (*ObjMetadata, error)

CreateObjMetadata returns a pointer to an ObjMetadata struct filled with the passed values. This function normalizes and validates the passed fields and returns an error for bad parameters.

func InfoToObjMeta added in v0.8.0

func InfoToObjMeta(info *resource.Info) ObjMetadata

InfoToObjMeta takes information from the provided info and returns an ObjMetadata that identifies the resource.

func InfosToObjMetas added in v0.8.0

func InfosToObjMetas(infos []*resource.Info) []ObjMetadata

infosToObjMetas takes a slice of infos and extract the GroupKind, name and namespace for each resource and returns it as a slice of ObjMetadata.

func ParseObjMetadata

func ParseObjMetadata(inv string) (*ObjMetadata, error)

ParseObjMetadata takes a string, splits it into its five fields, and returns a pointer to an ObjMetadata struct storing the five fields. Example inventory string:

test-namespace_test-name_apps_ReplicaSet

Returns an error if unable to parse and create the ObjMetadata struct.

func (*ObjMetadata) Equals

func (o *ObjMetadata) Equals(other *ObjMetadata) bool

Equals compares two ObjMetadata and returns true if they are equal. This does not contain any special treatment for the extensions API group.

func (*ObjMetadata) String

func (o *ObjMetadata) String() string

String create a string version of the ObjMetadata struct.

Jump to

Keyboard shortcuts

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