Jenkins credentials with same id

Hello everyone,

Today I noticed accidentally I created two Jenkins credentials with different types using the same id, and I wondered why during this time my pipeline doesn’t fail because of this misconfiguration.

When I renamed it the most recently added credential was renamed and I couldn’t find out the actual behavior behind this. I really appreciate it if anyone explains it to me.
Jenkins 2.306

Kind Regards

it looks like credentials is stored as an array not a map. Quickly glancing at the code, it should check but maybe some places are missed, or maybe one of the types don’t implement the ID interface

What are the two types/classes of credentials? Did you make them via ui/jcasc/vault/what?

I think its worth writing up a bug report with those details.