webhooks

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Allow

func Allow(msg string) admission.Response

Allow is a replacement for controller-runtime's admission.Allowed() that allows you to set the message (human-readable) as opposed to the reason (machine-readable).

func CodeFromReason

func CodeFromReason(reason metav1.StatusReason) int32

CodeFromReason implements the needed subset of https://godoc.org/k8s.io/apimachinery/pkg/apis/meta/v1#StatusReason

func Deny

func Deny(reason metav1.StatusReason, msg string) admission.Response

Deny is a replacement for controller-runtime's admission.Denied() that allows you to set _both_ a human-readable message _and_ a machine-readable reason, and also sets the code correctly instead of hardcoding it to 403 Forbidden.

func DenyInvalid

func DenyInvalid(field *field.Path, msg string) admission.Response

DenyInvalid is a wrapper for Deny with reason metav1.StatusReasonInvalid

func IsHNCServiceAccount

func IsHNCServiceAccount(user *authnv1.UserInfo) bool

IsHNCServiceAccount is inspired by isGKServiceAccount from open-policy-agent/gatekeeper.

Types

This section is empty.

Jump to

Keyboard shortcuts

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