k8sutil

package
v0.10.0-rc7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EncoderConfig = zapcore.EncoderConfig{
	MessageKey:       "M",
	LevelKey:         "L",
	TimeKey:          "T",
	NameKey:          "N",
	CallerKey:        "C",
	FunctionKey:      "",
	StacktraceKey:    "S",
	ConsoleSeparator: " ",
	EncodeLevel:      zapcore.CapitalColorLevelEncoder,
	EncodeCaller: func(ec zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder) {
		enc.AppendString(chalk.Dim.TextStyle(ec.TrimmedPath()))
	},
	EncodeName: func(name string, enc zapcore.PrimitiveArrayEncoder) {
		enc.AppendString(chalk.Dim.TextStyle(
			strings.Replace(name, "controller-runtime.manager.", "", 1)))
	},
	EncodeTime: func(t time.Time, enc zapcore.PrimitiveArrayEncoder) {
		enc.AppendString(t.Format("[15:04:05]"))
	},
	EncodeDuration: zapcore.SecondsDurationEncoder,
}

Functions

func CreateOrUpdate

func CreateOrUpdate(ctx context.Context, c client.Client, obj client.Object) error

func NewControllerRuntimeLogger added in v0.9.2

func NewControllerRuntimeLogger(level zapcore.Level) logr.Logger

func NewK8sClient

func NewK8sClient(options ClientOptions) (client.Client, error)

func NewRestConfig

func NewRestConfig(options ClientOptions) (*rest.Config, error)

Types

type ClientOptions

type ClientOptions struct {
	Kubeconfig *string
	RestConfig *rest.Config
	Scheme     *runtime.Scheme
}

type RequeueOp

type RequeueOp struct {
	// contains filtered or unexported fields
}

func DoNotRequeue

func DoNotRequeue() RequeueOp

func LoadResult

func LoadResult(result *reconcile.Result, err error) RequeueOp

func Requeue

func Requeue() RequeueOp

func RequeueAfter

func RequeueAfter(d time.Duration) RequeueOp

func RequeueErr

func RequeueErr(err error) RequeueOp

func (RequeueOp) Result

func (r RequeueOp) Result() (ctrl.Result, error)

func (RequeueOp) ResultPtr

func (r RequeueOp) ResultPtr() (result *ctrl.Result, err error)

func (RequeueOp) ShouldRequeue

func (r RequeueOp) ShouldRequeue() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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