Skip to content

Commit

Permalink
comments on base64-ness of secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
thockin committed Feb 23, 2015
1 parent 607b736 commit 3e7248f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
8 changes: 5 additions & 3 deletions docs/design/secrets.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ type Secret struct {
ObjectMeta

// Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN.
// The serialized form of the secret data is a base64 encoded string.
// The serialized form of the secret data is a base64 encoded string,
// representing the arbitrary (possibly non-string) data value here.
Data map[string][]byte `json:"data,omitempty"`

// Used to facilitate programatic handling of secret data.
Expand Down Expand Up @@ -398,8 +399,9 @@ To create a pod that uses an ssh key stored as a secret, we first need to create
}
```

**Note:** The values of secret data are encoded as base64-encoded strings. Newlines are not
valid within these strings and must be omitted.
**Note:** The serialized JSON and YAML values of secret data are encoded as
base64 strings. Newlines are not valid within these strings and must be
omitted.

Now we can create a pod which references the secret with the ssh key and consumes it in a volume:

Expand Down
3 changes: 2 additions & 1 deletion pkg/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,8 @@ type Secret struct {
ObjectMeta `json:"metadata,omitempty"`

// Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN.
// The serialized form of the secret data is a base64 encoded string.
// The serialized form of the secret data is a base64 encoded string,
// representing the arbitrary (possibly non-string) data value here.
Data map[string][]byte `json:"data,omitempty"`

// Used to facilitate programatic handling of secret data.
Expand Down
3 changes: 2 additions & 1 deletion pkg/api/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,8 @@ type Secret struct {
TypeMeta `json:",inline"`

// Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN.
// The serialized form of the secret data is a base64 encoded string.
// The serialized form of the secret data is a base64 encoded string,
// representing the arbitrary (possibly non-string) data value here.
Data map[string][]byte `json:"data,omitempty" description:"data contains the secret data. Each key must be a valid DNS_SUBDOMAIN. Each value must be a base64 encoded string"`

// Used to facilitate programatic handling of secret data.
Expand Down
3 changes: 2 additions & 1 deletion pkg/api/v1beta2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,8 @@ type Secret struct {
TypeMeta `json:",inline"`

// Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN.
// The serialized form of the secret data is a base64 encoded string.
// The serialized form of the secret data is a base64 encoded string,
// representing the arbitrary (possibly non-string) data value here.
Data map[string][]byte `json:"data,omitempty" description:"data contains the secret data. Each key must be a valid DNS_SUBDOMAIN. Each value must be a base64 encoded string"`

// Used to facilitate programatic handling of secret data.
Expand Down
3 changes: 2 additions & 1 deletion pkg/api/v1beta3/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,8 @@ type Secret struct {
ObjectMeta `json:"metadata,omitempty"`

// Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN.
// The serialized form of the secret data is a base64 encoded string.
// The serialized form of the secret data is a base64 encoded string,
// representing the arbitrary (possibly non-string) data value here.
Data map[string][]byte `json:"data,omitempty" description:"data contains the secret data. Each key must be a valid DNS_SUBDOMAIN. Each value must be a base64 encoded string"`

// Used to facilitate programatic handling of secret data.
Expand Down

0 comments on commit 3e7248f

Please sign in to comment.