sops
sops copied to clipboard
unknown type: time.Time
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.
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
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
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.
as a workaround: ensuring single or double quotes around the datetime string fixes this