Skip to content

Instantly share code, notes, and snippets.

View Becram's full-sized avatar

Bee Becram

View GitHub Profile
@Becram
Becram / webhook-mutate.go
Last active May 7, 2022 16:20
webhook-medium-2
// Mutate returns a new mutated pod according to lifespan tolerations rules
func (mpl containerResources) Mutate(pod *corev1.Pod) (*corev1.Pod, error) {
mpl.Logger = mpl.Logger.WithField("mutation", mpl.Name())
mpod := pod.DeepCopy()
resources, err := parseResources()
if err != nil {
return &corev1.Pod{}, err
}