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 ¶
- func DatasetInputFromPod(pod *corev1.Pod) (map[int]*DatasetInput, error)
- func PatchPodWithDatasetLabels(pod *corev1.Pod, datasets map[int]*DatasetInput) ([]jsonpatch.JsonPatchOperation, error)
- func RetrieveDatasetsFromAPIServer(ctx context.Context, client client.Client, pod *corev1.Pod, ...) error
- type DatasetInput
- type DatasetPodMutator
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)
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 ¶
+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) InjectDecoder ¶
func (m *DatasetPodMutator) InjectDecoder(d admission.Decoder) error
InjectDecoder injects the decoder.
Click to show internal directories.
Click to hide internal directories.