Dherik
Dherik

Reputation: 19070

Kubernetes edit secret error: "cannot restore slice from..."

I'm trying to edit a kubernetes secret using:

kubectl edit secret mysecret -o yaml

And adding a new variable on data:

data:
  NEW_VAR: true

But I receive the error:

cannot restore slice from bool

If I try to use some number, like:

data:
  NEW_VAR: 1

I receive another error after close the editor:

cannot restore slice from int64

What this error means?

Upvotes: 2

Views: 4979

Answers (1)

Dherik
Dherik

Reputation: 19070

This error happens when the variable is not a valid base64 value.

So, to use the value true, you need to use his base64 representation:

NEW_VAR: dHJ1ZQ==

Upvotes: 4

Related Questions