# Bug in Dynatrace 0.15.0 - Erreur : Pod XX invalid: spec.initContainers\[1\].name: Duplicate value: "install-oneagent"

**URL:** <https://community.dynatrace.com/t/bug-in-dynatrace-0-15-0-erreur-pod-xx-invalid-spec-initcontainers-1-name-duplicate-value-install-oneagent/44802>\
**Category:** Developer Q&A Forum\
**Tags:** coding-assistance, data-ingest\
**Created:** [March 21, 2024, 9:44pm UTC](https://community.dynatrace.com/t/bug-in-dynatrace-0-15-0-erreur-pod-xx-invalid-spec-initcontainers-1-name-duplicate-value-install-oneagent/44802 "2024-03-21T21:44:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Whisper40](https://avatars.discourse-cdn.com/v4/letter/w/71e660/32.png) [@Whisper40](https://community.dynatrace.com/u/Whisper40)\
**Post date:** [March 21, 2024, 9:44pm UTC](https://community.dynatrace.com/t/bug-in-dynatrace-0-15-0-erreur-pod-xx-invalid-spec-initcontainers-1-name-duplicate-value-install-oneagent/44802/1 "2024-03-21T21:44:20Z")

</div>

Hello,

We encountered a pod injection problem when using Dynatrace in applicationMonitoring.

What we did:  
Dynakube: Disable monitoring of all applications

```markup
feature.dynatrace.com/automatic-injection : false

```

On a specific pod: We enable injection  
annotations :

```markup
oneagent.dynatrace.com/inject : 'true'

```

We’ve gone from version 0.12.1 to version 0.15.0 and now pods can’t be scheduled due to incorrect deployment generated by mutatingwebhook.

So what’s wrong ? :

All dynatrace pods are deployed, and the webhook is trying to update the configuration of my app to inject Dynatrace but it fails because of this error :

invalid: spec.initContainers[1].name:  
Duplicate value: “install-oneagent”

The problem is that the Webhook is trying to inject 2 initContainers with the same name on my fresh app deployment that does not contains any initContainer.

I’ve analyzed the subject in greater depth.  
The problem lies in the mutatingwebhook delivered by Dynatrace.  
There’s a webhook idempotency problem. This is due to the option used

reinvocationPolicy: “IfNeeded”

The webhook is obviously called twice, which causes the “install-oneagent” init container to be doubled.  
The webhook has to check if the initContainer has been already added.

This bug has clearly been introduced in releasenote version 0.15

Kubernetes doc related to this : [Dynamic Admission Control | Kubernetes](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#reinvocation-policy)

Slack editor has encountered the same problem has yours ! :

> **[A Simple Kubernetes Admission Webhook](https://slack.engineering/simple-kubernetes-webhook/)**
>
> While adding a recent feature to our Kubernetes compute platform, we had the need to mutate newly-created pods based on annotations set by users. The mutation needed to follow simple business rules, and didn’t need to keep track of any state. Surely...

“we added reinvocationPolicy: IfNeeded to the MutatingWebhookConfiguration, resulting in the webhook often getting called twice. This is one of the reasons why mutations should be idempotent!”

We are exactly is the case described in the documentation due to idempotency problem :

“In the third case above, reinvoking the webhook will result in duplicated containers in the pod spec, which makes the request invalid and rejected by the API server.”

So the problem is not on the Mutating object but within the dynatrace-webhook pod.

If i try to set&nbsp;reinvocationPolicy: “Never”, the problem disappeared and pods can be scheduled.

Hope you fix this issue fast and take necessary actions in order it does not reproduce again, because yes it is a critical issue that can lead to a huge downtime.

---

<div class="post-metadata">

**Author:** ![sinisa\_zubic](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sinisa_zubic/32/32498_2.png) [@sinisa\_zubic](https://community.dynatrace.com/u/sinisa_zubic)\
**Post date:** [March 22, 2024, 8:54am UTC](https://community.dynatrace.com/t/bug-in-dynatrace-0-15-0-erreur-pod-xx-invalid-spec-initcontainers-1-name-duplicate-value-install-oneagent/44802/2 "2024-03-22T08:54:41Z")

</div>

Hi&nbsp;[@Whisper40](https://community.dynatrace.com/user/73703)

Please create a support ticket via&nbsp;[https://one.dynatrace.com/hc/en-us/requests](https://one.dynatrace.com/hc/en-us/requests)&nbsp;with the same description. Tech support will help you with this issue.

Best,  
Sini
