Vault kv put creates a new version every time it is invoked

Hi Everyone,

I am just curious if it is possible to change the default behaviour which I observed:

$ vault kv get secrets/env/test; echo $?
No value found at secrets/env/test
2

So the secret does not exist. I create it with:

$ vault kv put secrets/env/test @/tmp/x; echo $?
Key              Value
---              -----
created_time     2021-09-28T07:39:08.684133653Z
deletion_time    n/a
destroyed        false
version          1
0

But when I invoke above command once again the secret version is updated every time even if its value does not change at all (/tmp/x stays exactly the same):

vault kv secrets/env/test @/tmp/x; echo $?
Key              Value
---              -----
created_time     2021-09-28T07:40:09.165498565Z
deletion_time    n/a
destroyed        false
version          2
0

Is there a way to avoid version update if the underlying secret did not change at all?

Best regards,
Rafal.

No, each write is a new version, even if nothing has changed. I wish there was a flag to disable it, but no. Even patch will do the same thing.