You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm used to extensively describe the contents of my YAML files with comments. But with sops I have the problem, that each comment line, which is located right above of a key-value-pair which stands on top of a hierarchy level, disappears when the yaml file gets encrypted with sops.
My environment:
Windows 10
Sops version 3.1.1
My document in clear text:
# level 1, pos 1 comment
key1: value
# level 1, pos 2 comment
key2: value
# level 1, pos 3 comment
key3:
# level 2, pos 1 comment
key1: value
# level 2, pos 2 comment
key2: value
Please note that the comment lines "# level 1, pos 1 comment" and "# level 2, pos 1 comment" are already missing here in the encrypted document.
The actual decrypted document:
key1: value
# level 1, pos 2 comment
key2: value
# level 1, pos 3 comment
# level 2, pos 1 comment
key3:
key1: value
# level 2, pos 2 comment
key2: value
Please note the missing comment lines "# level 1, pos 1 comment" and "# level 2, pos 1 comment".
The expected decrypted document:
The same document as shown above under 2).
My workaround:
I'm adding dummy key-value-pairs as the first line on each hierarchy level, like this:
protect: the comment below from sops encryption
# level 1, pos 1 comment
key1: value
# level 1, pos 2 comment
key2: value
# level 1, pos 3 comment
key3:
protect: the comment below from sops encryption
# level 2, pos 1 comment
key1: value
# level 2, pos 2 comment
key2: value
The downside of this workaround is that I'm seeing the "protect: the comment below from sops encryption" key-value-pairs in my configuration target environment (the receiver of the yaml file) which is a bit confusing because these keys have nothing to do with the target environment.
It would be great if someone could fix this issue.
Thanks.
The text was updated successfully, but these errors were encountered:
This is a known issue. See #374. It's not easy to fix, and I don't think I or anyone at Mozilla who works on SOPS has time to fix this, but we would definitely review a patch that fixes this issue.
Apparently there is no open bug for this, so I'm leaving this open.
I'm used to extensively describe the contents of my YAML files with comments. But with sops I have the problem, that each comment line, which is located right above of a key-value-pair which stands on top of a hierarchy level, disappears when the yaml file gets encrypted with sops.
My environment:
Windows 10
Sops version 3.1.1
My document in clear text:
Please note that the comment lines "# level 1, pos 1 comment" and "# level 2, pos 1 comment" are already missing here in the encrypted document.
Please note the missing comment lines "# level 1, pos 1 comment" and "# level 2, pos 1 comment".
The expected decrypted document:
The same document as shown above under 2).
My workaround:
I'm adding dummy key-value-pairs as the first line on each hierarchy level, like this:
The downside of this workaround is that I'm seeing the "protect: the comment below from sops encryption" key-value-pairs in my configuration target environment (the receiver of the yaml file) which is a bit confusing because these keys have nothing to do with the target environment.
It would be great if someone could fix this issue.
Thanks.
The text was updated successfully, but these errors were encountered: