We are working on sops with gpg to encrypt and decrypt yaml files. When performing encryption or decryption using this approach most of the time it works but some times it fails with "no public key" available error. We are testing using gpg 2.1.18 version. This happens with both encrypt and decrypt.
We have verified with the gpg --list-keys command and it shows a valid public key.
pub rsa2048 2020-08-21 [SC] [expires: 2022-08-21]
681E3A89EB1DAFD36EB883120A73BB48E26694D8
uid [ unknown] Docker <Docker@cluster.local>
sub rsa2048 2020-08-21 [E] [expires: 2022-08-21]
Not sure what we are missing here. It would be really helpful if we can get some help here.
Thank you in advance!