admission

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: Apache-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package admission handles kubernetes admissions, it takes admission requests and returns admission reviews; for example, to mutate or validate pods

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolvePod

func ResolvePod(a MutationRequest) (*corev1.Pod, error)

ResolvePod extracts a pod from an admission request

Types

type MutationRequest

type MutationRequest struct {
	Logger  *logrus.Entry
	Request *admissionv1.AdmissionRequest

	DefaultImage       string
	DefaultGitUsername string
	DefaultGitToken    string

	Client kubernetes.Interface
}

MutationRequest is a container for admission logic

func (MutationRequest) CreatePodPatch

func (a MutationRequest) CreatePodPatch(pod *corev1.Pod, params appContext.Parameters) ([]byte, error)

CreatePodPatch returns a json patch containing all the mutations needed for a given pod

func (MutationRequest) ProcessAdmissionRequest

func (a MutationRequest) ProcessAdmissionRequest() (*admissionv1.AdmissionReview, error)

ProcessAdmissionRequest takes an admission request and mutates the pod within, it returns an admission review with mutations as a json patch (if any)

Jump to

Keyboard shortcuts

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