hooks

package
v0.0.0-...-6a2407b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewArgoCDApplicationValidator

func NewArgoCDApplicationValidator(c client.Client, dec *admission.Decoder, config *ArgoCDApplicationValidatorConfig, repositoryPermissive bool) http.Handler

NewArgoCDApplicationValidator creates a webhook handler for ArgoCD Application.

func NewContourHTTPProxyMutator

func NewContourHTTPProxyMutator(c client.Client, dec *admission.Decoder, defaultClass string, config *HTTPProxyMutatorConfig) http.Handler

NewContourHTTPProxyMutator creates a webhook handler for Contour HTTPProxy.

func NewContourHTTPProxyValidator

func NewContourHTTPProxyValidator(c client.Client, dec *admission.Decoder) http.Handler

NewContourHTTPProxyValidator creates a webhook handler for Contour HTTPProxy.

func NewDeleteValidator

func NewDeleteValidator(c client.Client, dec *admission.Decoder) http.Handler

NewDeleteValidator creates a webhook handler to validate DELETE requests.

func NewDeploymentReplicaCountScaleValidator

func NewDeploymentReplicaCountScaleValidator(c client.Client, decoder *admission.Decoder) http.Handler

func NewDeploymentReplicaCountValidator

func NewDeploymentReplicaCountValidator(c client.Client, decoder *admission.Decoder) http.Handler

NewDeploymentReplicaCountValidator returns a webhook handler to validate CREATE and UPDATE for Deployment resource.

This webhook denies a resources if the resource has the annotation `admission.cybozu.com/force-replica-count: "0"` and its .spec.replicas is not zero.

func NewGrafanaDashboardValidator

func NewGrafanaDashboardValidator(c client.Client, dec *admission.Decoder) http.Handler

NewGrafanaDashboardValidator creates a webhook handler for GrafanaDashboard.

func NewPodMutator

func NewPodMutator(c client.Client, dec *admission.Decoder, ephemeralStoragePermissive bool) http.Handler

NewPodMutator creates a webhook handler for Pod.

func NewPodValidator

func NewPodValidator(c client.Client, dec *admission.Decoder, validImagePrefixes []string, imagePermissive bool) http.Handler

NewPodValidator creates a webhook handler for Pod.

func NewPreventDeleteValidator

func NewPreventDeleteValidator(c client.Client, dec *admission.Decoder) http.Handler

NewPreventDeleteValidator creates a webhook handler to validate DELETE requests only for resources annotated with `prevent: delete`.

Types

type ArgoCDApplicationRule

type ArgoCDApplicationRule struct {
	Repository       string   `json:"repository"`
	RepositoryPrefix string   `json:"repositoryPrefix"`
	Projects         []string `json:"projects"`
}

ArgoCDApplicationRule is a rule for applications

type ArgoCDApplicationValidatorConfig

type ArgoCDApplicationValidatorConfig struct {
	Rules []ArgoCDApplicationRule `json:"rules"`
}

ArgoCDApplicationValidatorConfig is a config for application validator

type Config

type Config struct {
	ArgoCDApplicationValidatorConfig ArgoCDApplicationValidatorConfig `json:"ArgoCDApplicationValidator"`
	HTTPProxyMutatorConfig           HTTPProxyMutatorConfig           `json:"HTTPProxyMutatorConfig"`
}

Config is a config for neco-admission

type HTTPProxyIPFilterPolicy

type HTTPProxyIPFilterPolicy struct {
	Source string `json:"source"`
	Cidr   string `json:"cidr"`
}

type HTTPProxyMutatorConfig

type HTTPProxyMutatorConfig struct {
	Policies []HTTPProxyPolicy `json:"policies"`
}

type HTTPProxyPolicy

type HTTPProxyPolicy struct {
	Name          string                    `json:"name"`
	IpAllowPolicy []HTTPProxyIPFilterPolicy `json:"ipAllowPolicy"`
}

Jump to

Keyboard shortcuts

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