webhookutil

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchKinds

func MatchKinds(obj runtime.Object, reqKind metav1.GroupVersionKind) error

MatchKinds returns error if given obj GVK is not equal to the reqKind GVK

Types

type TracedLogger

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

TracedLogger is a helper wrapper around the klog to ensure that given UID is always logged. Is workaround cause in klog we do not have options to create a logger with Field which will be added for each logged entry like we can do in logrus or zap.

func NewTracedLogger

func NewTracedLogger(uid types.UID) *TracedLogger

NewTracedLogger returns new instance of the TracedLogger

func (*TracedLogger) Error

func (l *TracedLogger) Error(args ...interface{})

Error logs to the ERROR, WARNING, and INFO logs.

func (*TracedLogger) Errorf

func (l *TracedLogger) Errorf(format string, args ...interface{})

Errorf logs to the ERROR, WARNING, and INFO logs.

func (*TracedLogger) Info

func (l *TracedLogger) Info(args ...interface{})

Info logs to the INFO log.

func (*TracedLogger) Infof

func (l *TracedLogger) Infof(format string, args ...interface{})

Infof logs to the INFO log.

func (*TracedLogger) V

V returns TracedLogger with a given log level

type TracedVLogger

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

TracedVLogger contains logger with a log level

func (TracedVLogger) Info

func (v TracedVLogger) Info(args ...interface{})

Info logs to the INFO log.

func (TracedVLogger) Infof

func (v TracedVLogger) Infof(format string, args ...interface{})

Infof logs to the INFO log with format.

func (TracedVLogger) Infoln

func (v TracedVLogger) Infoln(args ...interface{})

Infoln logs to the INFO log.

type UUIDGenerator

type UUIDGenerator func() types.UID

UUIDGenerator generates new UUID

func (UUIDGenerator) New

func (generator UUIDGenerator) New() types.UID

New returns new UUID. If UUIDGenerator is not initialised, then implementation from "k8s.io/apimachinery/pkg/util/UUID" is used otherwise UUIDGenerator is called and result returned.

type WebhookError

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

WebhookError holds info about error message and its status code

func NewWebhookError

func NewWebhookError(msg string, code int32) *WebhookError

NewWebhookError returns new error

func (*WebhookError) Code

func (m *WebhookError) Code() int32

Code returns error status code

func (*WebhookError) Error

func (m *WebhookError) Error() string

Error returns error message

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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