mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Do not display the digest or size of swarm secrets
Signed-off-by: cyli <cyli@twistedmatrix.com>
(cherry picked from commit 2c0613540a
)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
This commit is contained in:
parent
fad605e8c5
commit
aa6211e153
3 changed files with 4 additions and 9 deletions
|
@ -6,9 +6,7 @@ import "os"
|
||||||
type Secret struct {
|
type Secret struct {
|
||||||
ID string
|
ID string
|
||||||
Meta
|
Meta
|
||||||
Spec SecretSpec
|
Spec SecretSpec
|
||||||
Digest string
|
|
||||||
SecretSize int64
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SecretSpec represents a secret specification from a secret in swarm
|
// SecretSpec represents a secret specification from a secret in swarm
|
||||||
|
|
|
@ -50,15 +50,14 @@ func runSecretList(dockerCli *command.DockerCli, opts listOptions) error {
|
||||||
fmt.Fprintf(w, "%s\n", s.ID)
|
fmt.Fprintf(w, "%s\n", s.ID)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fmt.Fprintf(w, "ID\tNAME\tCREATED\tUPDATED\tSIZE")
|
fmt.Fprintf(w, "ID\tNAME\tCREATED\tUPDATED")
|
||||||
fmt.Fprintf(w, "\n")
|
fmt.Fprintf(w, "\n")
|
||||||
|
|
||||||
for _, s := range secrets {
|
for _, s := range secrets {
|
||||||
created := units.HumanDuration(time.Now().UTC().Sub(s.Meta.CreatedAt)) + " ago"
|
created := units.HumanDuration(time.Now().UTC().Sub(s.Meta.CreatedAt)) + " ago"
|
||||||
updated := units.HumanDuration(time.Now().UTC().Sub(s.Meta.UpdatedAt)) + " ago"
|
updated := units.HumanDuration(time.Now().UTC().Sub(s.Meta.UpdatedAt)) + " ago"
|
||||||
size := units.HumanSizeWithPrecision(float64(s.SecretSize), 3)
|
|
||||||
|
|
||||||
fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\n", s.ID, s.Spec.Annotations.Name, created, updated, size)
|
fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", s.ID, s.Spec.Annotations.Name, created, updated)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,7 @@ import (
|
||||||
// SecretFromGRPC converts a grpc Secret to a Secret.
|
// SecretFromGRPC converts a grpc Secret to a Secret.
|
||||||
func SecretFromGRPC(s *swarmapi.Secret) swarmtypes.Secret {
|
func SecretFromGRPC(s *swarmapi.Secret) swarmtypes.Secret {
|
||||||
secret := swarmtypes.Secret{
|
secret := swarmtypes.Secret{
|
||||||
ID: s.ID,
|
ID: s.ID,
|
||||||
Digest: s.Digest,
|
|
||||||
SecretSize: s.SecretSize,
|
|
||||||
Spec: swarmtypes.SecretSpec{
|
Spec: swarmtypes.SecretSpec{
|
||||||
Annotations: swarmtypes.Annotations{
|
Annotations: swarmtypes.Annotations{
|
||||||
Name: s.Spec.Annotations.Name,
|
Name: s.Spec.Annotations.Name,
|
||||||
|
|
Loading…
Add table
Reference in a new issue