admissioncontroller

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

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

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

Documentation

Overview

Package mutate deals with AdmissionReview requests and responses, it takes in the request body and returns a readily converted JSON []byte that can be returned from a http Handler w/o needing to further convert or modify it, it also makes testing Mutate() kind of easy w/o need for a fake http server, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DatasetInputFromPod

func DatasetInputFromPod(pod *corev1.Pod) (map[int]*DatasetInput, error)

func PatchPodWithDatasetLabels

func PatchPodWithDatasetLabels(pod *corev1.Pod, datasets map[int]*DatasetInput) ([]jsonpatch.JsonPatchOperation, error)

func RetrieveDatasetsFromAPIServer

func RetrieveDatasetsFromAPIServer(ctx context.Context, client client.Client, pod *corev1.Pod, datasets map[int]*DatasetInput) error

Types

type DatasetInput

type DatasetInput struct {
	// contains filtered or unexported fields
}

func NewDatasetInput

func NewDatasetInput() *DatasetInput

func (*DatasetInput) AddToRequestedUse

func (d *DatasetInput) AddToRequestedUse(useas string) *DatasetInput

func (*DatasetInput) RequestedUseContains

func (d *DatasetInput) RequestedUseContains(useas string) bool

func (*DatasetInput) SetIndex

func (d *DatasetInput) SetIndex(idx int) *DatasetInput

func (*DatasetInput) SetName

func (d *DatasetInput) SetName(name string) *DatasetInput

func (*DatasetInput) String

func (d *DatasetInput) String() string

type DatasetPodMutator

type DatasetPodMutator struct {
	Client  client.Client
	Decoder admission.Decoder
}

+kubebuilder:webhook:path=/mutate-v1-pod,mutating=true,failurePolicy=fail,groups="",resources=pods,verbs=create,versions=v1,name=mpod.datashim.io, admissionReviewVersions=v1,sideEffects=NoneOnDryRun

func (*DatasetPodMutator) Handle

func (*DatasetPodMutator) InjectDecoder

func (m *DatasetPodMutator) InjectDecoder(d admission.Decoder) error

InjectDecoder injects the decoder.

Jump to

Keyboard shortcuts

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