server

package
v4.2.263+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultPodMutatePatchValdationFunction = admission_controller_utils.ValidatePatchFunc(func(patch jsonpatch.JsonPatchOperation) error {
		return nil
	})
	OKD3_9tPodMutatePatchValdationFunction = admission_controller_utils.ValidatePatchFunc(func(patch jsonpatch.JsonPatchOperation) error {

		allowedPatchOperations := map[string]bool{
			"add": true,
		}
		if allowed, exist := allowedPatchOperations[patch.Operation]; !exist || !allowed {
			return errors.Errorf("cannot patch with operation %s", patch.Operation)
		}

		return nil
	})
)

Functions

func NewControllerPodResourceRecommendation

func NewControllerPodResourceRecommendation() *controllerRecommendation

Types

type AdmissionController

type AdmissionController interface {
	MutatePod(http.ResponseWriter, *http.Request)
}

func NewAdmissionControllerWithConfig

func NewAdmissionControllerWithConfig(cfg Config, sigsK8SClient client.Client, resourceRecommendator resource.ResourceRecommendator, controllerValidator controller_validator.Validator, podMutatePatchValdationFunction admission_controller_utils.ValidatePatchFunc) (AdmissionController, error)

NewAdmissionControllerWithConfig creates AdmissionController with configuration and dependencies

type Config

type Config struct {
	Enable bool
}

Jump to

Keyboard shortcuts

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