Browse code

Do not display the digest or size of swarm secrets

Signed-off-by: cyli <cyli@twistedmatrix.com>
(cherry picked from commit 2c0613540a25d45069d142542e572bb6338e4155)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>

cyli authored on 2016/11/23 06:37:02
Showing 3 changed files
... ...
@@ -6,9 +6,7 @@ import "os"
6 6
 type Secret struct {
7 7
 	ID string
8 8
 	Meta
9
-	Spec       SecretSpec
10
-	Digest     string
11
-	SecretSize int64
9
+	Spec SecretSpec
12 10
 }
13 11
 
14 12
 // SecretSpec represents a secret specification from a secret in swarm
... ...
@@ -50,15 +50,14 @@ func runSecretList(dockerCli *command.DockerCli, opts listOptions) error {
50 50
 			fmt.Fprintf(w, "%s\n", s.ID)
51 51
 		}
52 52
 	} else {
53
-		fmt.Fprintf(w, "ID\tNAME\tCREATED\tUPDATED\tSIZE")
53
+		fmt.Fprintf(w, "ID\tNAME\tCREATED\tUPDATED")
54 54
 		fmt.Fprintf(w, "\n")
55 55
 
56 56
 		for _, s := range secrets {
57 57
 			created := units.HumanDuration(time.Now().UTC().Sub(s.Meta.CreatedAt)) + " ago"
58 58
 			updated := units.HumanDuration(time.Now().UTC().Sub(s.Meta.UpdatedAt)) + " ago"
59
-			size := units.HumanSizeWithPrecision(float64(s.SecretSize), 3)
60 59
 
61
-			fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\n", s.ID, s.Spec.Annotations.Name, created, updated, size)
60
+			fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", s.ID, s.Spec.Annotations.Name, created, updated)
62 61
 		}
63 62
 	}
64 63
 
... ...
@@ -9,9 +9,7 @@ import (
9 9
 // SecretFromGRPC converts a grpc Secret to a Secret.
10 10
 func SecretFromGRPC(s *swarmapi.Secret) swarmtypes.Secret {
11 11
 	secret := swarmtypes.Secret{
12
-		ID:         s.ID,
13
-		Digest:     s.Digest,
14
-		SecretSize: s.SecretSize,
12
+		ID: s.ID,
15 13
 		Spec: swarmtypes.SecretSpec{
16 14
 			Annotations: swarmtypes.Annotations{
17 15
 				Name:   s.Spec.Annotations.Name,