utils

package
v0.38.6 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Overview

Util functions used by generated code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsString

func ContainsString(slice []string, s string) bool

Helper functions to check a string from a slice of strings.

func ContextWithLogger

func ContextWithLogger(ctx context.Context, logger logr.Logger) context.Context

store the logger in the context for propagation to children

func GetInClusterNamesapce

func GetInClusterNamesapce() (string, error)

returns the namespace in which the current process is executing, if running inside k8s else, return err

func LoggerFromContext

func LoggerFromContext(ctx context.Context) logr.Logger

retrieve the logger from the context returns the default logger if not set

func RemoveString

func RemoveString(slice []string, s string) (result []string)

Helper functions to remove string from a slice of strings.

Types

This section is empty.

Jump to

Keyboard shortcuts

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