getsops / sops

Simple and flexible tool for managing secrets
https://getsops.io/
Mozilla Public License 2.0
15.9k stars 845 forks source link

unknown type: time.Time #944

Open trjate opened 2 years ago

trjate commented 2 years ago

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.

enote-kane commented 9 months ago

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
GiovanniLeo commented 6 months ago

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
felixfontein commented 6 months ago

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.

bvanderhorn commented 4 months ago

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