sops icon indicating copy to clipboard operation
sops copied to clipboard

unknown type: time.Time

Open trjate opened this issue 3 years ago • 4 comments

sops -e -i secrets.yaml

kind: Secret
apiVersion: v1
metadata:
    name: linkerd-identity-issuer
    namespace: linkerd
    labels:
        linkerd.io/control-plane-component: identity
        linkerd.io/control-plane-ns: linkerd
    annotations:
        linkerd.io/created-by: linkerd/cli stable-2.10.2
        linkerd.io/identity-issuer-expiry: 2031-01-01T00:00:00Z
data:
    crt.pem: LS0tLS...
    key.pem: LS0tLS1CR...
---

=> Error encrypting tree: Error walking tree: Cannot walk value, unknown type: time.Time

Remove the linkerd.io/identity-issuer-expiry: 2031-01-01T00:00:00Z annotation an no problem.

trjate avatar Sep 23 '21 15:09 trjate

Still an issue with version 3.8.0:

$ echo 'test: 2023-10-04T15:42:23+00:00' | sops -e --input-type yaml /dev/stdin
Error encrypting tree: Error walking tree: Cannot walk value, unknown type: time.Time

enote-kane avatar Oct 04 '23 16:10 enote-kane

I have the same error but I think that via the flag --unencrypted-regex the issue can be solved but the problem still persists. Has someone found a way to overcome this? In my case, that value (a date) is needed This is my regexp unencrypted-regex: '^([a-zA-Z]+[Dd]ate[a-zA-Z]+)$' The values that should ignored are those

server:
    startDate: 2021-19-09
    expirationDate: 2023-19-09

GiovanniLeo avatar Jan 03 '24 12:01 GiovanniLeo

My guess is that the main reason this hasn't been implemented yet is that decryption will yield an equivalent date/time string, which can look very different from the input.

felixfontein avatar Jan 05 '24 17:01 felixfontein

as a workaround: ensuring single or double quotes around the datetime string fixes this

bvanderhorn avatar Feb 29 '24 09:02 bvanderhorn