resources

package
v1.44.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IdentityResourceCustomizer = func(object ctrl.Object) ctrl.Object {
	return object
}

IdentityResourceCustomizer is a ResourceCustomizer that does nothing.

Functions

func CloseQuietly

func CloseQuietly(closer io.Closer)

CloseQuietly unconditionally close an io.Closer It should not be used to replace the Close statement(s).

func DirExists

func DirExists(dirName string) bool

DirExists tells if a directory exists and can be listed for files.

func ObjectOrCollect

func ObjectOrCollect(ctx context.Context, c client.Client, namespace string, collection *kubernetes.Collection, force bool, obj ctrl.Object) error

func Open

func Open(name string) (*os.File, error)

Open a safe wrapper of os.Open.

func Resource

func Resource(name string) ([]byte, error)

Resource provides an easy way to access to embedded assets.

func ResourceAsString

func ResourceAsString(name string) (string, error)

ResourceAsString returns the named resource content as string.

func ResourceOrCollect

func ResourceOrCollect(ctx context.Context, c client.Client, namespace string, collection *kubernetes.Collection,
	force bool, customizer ResourceCustomizer, name string) error

func Resources

func Resources(dirName string) ([]string, error)

Resources lists all file names in the given path (starts with '/').

func ResourcesOrCollect

func ResourcesOrCollect(ctx context.Context, c client.Client, namespace string, collection *kubernetes.Collection,
	force bool, customizer ResourceCustomizer, names ...string) error

func WithPrefix

func WithPrefix(pathPrefix string) ([]string, error)

WithPrefix lists all file names that begins with the give path prefix If pathPrefix is a path of directories then be sure to end it with a '/'.

Types

type ResourceCustomizer

type ResourceCustomizer func(object ctrl.Object) ctrl.Object

ResourceCustomizer can be used to inject code that changes the objects before they are created.

Jump to

Keyboard shortcuts

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