runoncedurationoverride

package
v0.0.0-...-2220ef3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Resource = "runoncedurationoverrides"
	Singular = "runoncedurationoverride"
	Name     = "runoncedurationoverride"
)

Variables

This section is empty.

Functions

func NewMutator

func NewMutator(config *Config) (mutator *podMutator, err error)

func Patch

func Patch(original runtime.RawExtension, mutated *corev1.Pod) (patches []byte, err error)

Patch takes 2 byte arrays and returns a new response with json patch. The original object should be passed in as raw bytes to avoid the roundtripping problem described in https://github.com/kubernetes-sigs/kubebuilder/issues/510.

Types

type Admission

type Admission interface {
	// GetConfiguration returns the configuration in use by the admission logic.
	GetConfiguration() *Config

	// IsApplicable returns true if the given resource inside the request is
	// applicable to this admission controller. Otherwise it returns false.
	IsApplicable(request *admissionv1.AdmissionRequest) bool

	// IsExempt returns true if the given resource is exempt from being admitted.
	// Otherwise it returns false. On any error, response is set with appropriate
	// status and error message.
	// If response is not nil, the caller should not proceed with the admission.
	IsExempt(request *admissionv1.AdmissionRequest) (exempt bool, response *admissionv1.AdmissionResponse)

	// Admit makes an attempt to admit the specified resource in the request.
	// It returns an AdmissionResponse that is set appropriately. On success,
	// the response should contain the patch for update.
	Admit(admissionSpec *admissionv1.AdmissionRequest) *admissionv1.AdmissionResponse
}

Admission interface encapsulates the admission logic for ClusterResourceOverride plugin.

func NewAdmission

func NewAdmission(configLoaderFunc ConfigLoaderFunc) (admission Admission, err error)

NewInClusterAdmission returns a new instance of Admission that is appropriate to be consumed in cluster.

func NewInClusterAdmission

func NewInClusterAdmission() (admission Admission, err error)

NewInClusterAdmission returns a new instance of Admission that is appropriate to be consumed in cluster.

type Config

type Config struct {
	ActiveDeadlineSeconds int64
}

func ConvertExternalConfig

func ConvertExternalConfig(object *RunOnceDurationOverride) *Config

func (*Config) String

func (c *Config) String() string

type ConfigLoaderFunc

type ConfigLoaderFunc func() (config *Config, err error)

ConfigLoaderFunc loads a Config object from appropriate source and returns it.

type RunOnceDurationOverride

type RunOnceDurationOverride struct {
	metav1.TypeMeta `json:",inline"`
	Spec            RunOnceDurationOverrideSpec `json:"spec,omitempty"`
}

RunOnceDurationOverride is the configuration for the RunOnceDurationOverride admission controller which overrides activeDeadlineSeconds for run-once pods.

func Decode

func Decode(reader io.Reader) (object *RunOnceDurationOverride, err error)

DecodeUnstructured decodes a raw stream into a an unstructured.Unstructured instance.

func DecodeWithFile

func DecodeWithFile(path string) (object *RunOnceDurationOverride, err error)

type RunOnceDurationOverrideSpec

type RunOnceDurationOverrideSpec struct {
	ActiveDeadlineSeconds int64 `json:"activeDeadlineSeconds"`
}

Jump to

Keyboard shortcuts

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