Skip to content

Instantly share code, notes, and snippets.

@rootfs
Created May 13, 2015 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rootfs/56952d3a193aa04dbdcc to your computer and use it in GitHub Desktop.
Save rootfs/56952d3a193aa04dbdcc to your computer and use it in GitHub Desktop.
code:
for name, data := range secretName.Data {
bytes := make([]byte, base64.StdEncoding.DecodedLen(len(data)))
l, err := base64.StdEncoding.Decode(bytes, data)
secret = string(bytes)
glog.Errorf("%s: secret info %v/%v/%v/%s len %d err %v", name, pod.Namespace, spec.VolumeSource.RBD.SecretName, data, secret, l, err)
}
output:
default/ceph-secret/[1 0 17 48 37 85 64 173 95 8 16 0 245 14 140 150 127 86 249 94 125 40 48 105 125 124 6 231]/ len 0 err illegal base64 data at input byte 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment