Documentation ¶
Index ¶
Constants ¶
const ( Resource = "runoncedurationoverrides" Singular = "runoncedurationoverride" Name = "runoncedurationoverride" )
Variables ¶
This section is empty.
Functions ¶
func NewMutator ¶
func Patch ¶
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 ¶
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
type ConfigLoaderFunc ¶
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"`
}