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
Creation of kubernetes secrets from ejson failed: error from server (badrequest): error when creating "/var/folders/6g/t31p0nvn02l3236fm3v07xsr0000gn/t/mydata20171026-34510-1mbtgtg": secret in version "v1" cannot be handled as a secret: v1.secret: data: decode base64: illegal base64 data at input byte 8, parsing 56 ...xlwyxnz\n"... at {"apiversion":"v1","data":{"mypassword":"bxlwyxnz\n","mypassword2":"bxlwyxnz\n"},"kind":"secret","metadata":{"annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiversion\":\"v1\",\"data\":{\"mypassword\":\"bxlwyxnz\\n\",\"mypassword2\":\"bxlwyxnz\\n\"},\"kind\":\"secret\",\"metadata\":{\"annotations\":{\"kubernetes-deploy.shopify.io/ejson-secret\":\"true\"},\"labels\":{\"name\":\"mydata\"},\"name\":\"mydata\",\"namespace\":\"production\"},\"type\":\"opaque\"}\n","kubernetes-deploy.shopify.io/ejson-secret":"true"},"labels":{"name":"mydata"},"name":"mydata","namespace":"production"},"type":"opaque"}
The text was updated successfully, but these errors were encountered:
I've just run into this issue as well. Running GKE: 1.8.1-gke.0. The error looks like kubernetes-deploy is appending a new line \n onto the value of each secret.
:007 > str = "aooajsdjadad"
=> "aooajsdjadad"
:008 > Base64.encode64(str)
=> "YW9vYWpzZGphZGFk\n"
:009 > Base64.strict_encode64(str)
=> "YW9vYWpzZGphZGFk"```
I will attempt to open a PR for this change.
Secret generation code is calling
Base64.encode(value)
which which is inserting a newline which breaks the yaml that is being fed to kubectl.results in the following yaml:
resulting in the following error:
The text was updated successfully, but these errors were encountered: