podpreset-webhook icon indicating copy to clipboard operation
podpreset-webhook copied to clipboard

A bug when 2+ Podpreset are trying to apply presets, only the last one will be applied

Open mahmoudcb opened this issue 4 years ago • 5 comments

I have 2 PodPresets that should be applied to the Pod. Here are the logs

{"level":"info","ts":1591409049.4927325,"logger":"podpreset_webhook_handler","msg":"PodPreset matches pod labels","PodPreset":"chartboost-config-repo","Pod":""}
{"level":"info","ts":1591409049.4928012,"logger":"podpreset_webhook_handler","msg":"PodPreset matches pod labels","PodPreset":"datadog-agent-host","Pod":""}
{"level":"info","ts":1591409049.4928439,"logger":"podpreset_webhook_handler","msg":"applied podpresets","Names":"datadog-agent-host,datadog-agent-host","Pod Name":"test-deployment-7f7f79757f-"}

It's clear from the logs that it is somehow trying to apply datadog-agent-host 2 times.

I'm suspecting mutatePodsFn and filterPodPresets functions aren't returning the correct lists.

mahmoudcb avatar Jun 09 '20 13:06 mahmoudcb

Hmm, this looks like a duplicate of #2 which was supposedly addressed by #3. Do you still see the issue?

danopia avatar Oct 22 '20 13:10 danopia

Hi - i am using the latest tag on an EKS cluster but it seems that the labels matching is being completely ingnored, any pod is matching the last podpreset. I also see that the changes in the PR you mention https://github.com/redhat-cop/podpreset-webhook/pull/3 doesn't seem to be present in master... thanks for your support

riccardo-salamanna avatar Oct 15 '21 18:10 riccardo-salamanna

@danopia The #3 patch did fix this issue. However this fix have then been lost/reverted in one of the later commits.

tjabodog avatar Nov 10 '21 12:11 tjabodog

Yes, I agree, the fix I referenced was reverted by this huge PR: https://github.com/redhat-cop/podpreset-webhook/pull/11

I've never actually used this project so I'll be unsubscribing from this thread. Apologies

danopia avatar Nov 10 '21 13:11 danopia

@sabre1041 @mathianasj any plans to fix this?

konman1989 avatar Apr 26 '22 14:04 konman1989