settings

package
v0.0.0-...-2154193 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusReasonUnauthorized          = "Unauthorized"
	StatusReasonForbidden             = "Forbidden"
	StatusReasonInvalid               = "Invalid"
	StatusReasonRequestEntityTooLarge = "RequestEntityTooLarge"
)

Variables

This section is empty.

Functions

func ValidateSettings

func ValidateSettings(input []byte) ([]byte, error)

ValidateSettings validates the settings of the policy the validation logic is adapted from: https://github.com/kubernetes/kubernetes/blob/master/pkg/apis/admissionregistration/validation/validation.go

Types

type Settings

type Settings struct {
	Variables   []Variable   `json:"variables"`
	Validations []Validation `json:"validations"`
}

Settings defines the settings of the policy

func NewSettingsFromValidationReq

func NewSettingsFromValidationReq(validationReq *kubewardenProtocol.ValidationRequest) (Settings, error)

type Validation

type Validation struct {
	Expression        string `json:"expression"`
	Message           string `json:"message"`
	MessageExpression string `json:"messageExpression"`
	Reason            string `json:"reason"`
}

func (*Validation) UnmarshalJSON

func (v *Validation) UnmarshalJSON(data []byte) error

type Variable

type Variable struct {
	Name       string `json:"name"`
	Expression string `json:"expression"`
}

Jump to

Keyboard shortcuts

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