nsutils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnnotationsBasedOnParent

func AnnotationsBasedOnParent(parentNS *objectcontext.ObjectContext, nsName string) map[string]string

AnnotationsBasedOnParent returns labels for a namespace based on the ones of the namespace of the parent.

func ComposeNamespace

func ComposeNamespace(name string, labels map[string]string, annotations map[string]string) *corev1.Namespace

ComposeNamespace returns a namespace object based on the given parameters.

func Depth

func Depth(namespace client.Object) int

Depth returns the depth of a namespace from its annotation.

func DisplayName

func DisplayName(namespace client.Object) string

DisplayName returns the displayName annotation of a namespace.

func DisplayNameSlice

func DisplayNameSlice(ns *objectcontext.ObjectContext) []string

DisplayNameSlice returns a slice of strings that contains the hierarchy of a namespace in accordance to its display-name.

func IsChildless

func IsChildless(namespace *objectcontext.ObjectContext) bool

IsChildless checks if the given namespace has any subnamespaces, and returns true if it does not have any subnamespaces.

func IsNamespace

func IsNamespace(obj client.Object) bool

IsNamespace returns true if an object is of type namespace.

func IsRoot

func IsRoot(namespace client.Object) bool

IsRoot returns true if the namespace is the root namespace.

func IsSecondaryRoot

func IsSecondaryRoot(namespace client.Object) bool

IsSecondaryRoot returns true if a namespace is a secondary root.

func LabelsBasedOnParent

func LabelsBasedOnParent(parentNS *objectcontext.ObjectContext, nsName string) map[string]string

LabelsBasedOnParent returns labels for a namespace based on the ones of the namespace of the parent.

func Parent

func Parent(namespace client.Object) string

Parent returns the parent label of a namespace.

func SNSFromNamespace

func SNSFromNamespace(namespace *objectcontext.ObjectContext) (*objectcontext.ObjectContext, error)

SNSFromNamespace returns the subnamespace corresponding to a namespace.

Types

This section is empty.

Jump to

Keyboard shortcuts

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