<p>I'm new at K8S, so perhaps there is a simple solution to my problem.<br />
Using this <a href="https://medium.com/ibm-cloud/diving-into-kubernetes-mutatingadmissionwebhook-6ef3c5695f74" rel="nofollow noreferrer">tutorial</a>, <strong>I'm creating a mutation webhook</strong> whose goal is to add information to pod specifications (using mutation webhooks).<br />
The webhook should patch only new pod deployments and not replica sets, scale-ups, or scale-outs.</p>
<p><strong>How can I distinguish between those cases (new deployments and not)</strong> with <a href="https://pkg.go.dev/k8s.io/api/core/v1" rel="nofollow noreferrer">corev1 pkg</a> or any other way?
Thanks!</p>

Lior Kesten
<p>You can check the content of <a href="https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#request" rel="nofollow noreferrer">the <code>request.kind</code>, <code>request.subresource</code> and <code>request.operatrion</code> field of the <code>AdmissionReview</code> object</a> sent to the admission control webhook to distinguish a CREATE/UPDATE Deployment request from a scale request or a CREATE/UPDATE ReplicaSet request.</p>
