From d5d838f9f351b27c867966a71d16ba759632a099 Mon Sep 17 00:00:00 2001 From: Evan Hazlett Date: Mon, 7 Nov 2016 16:18:53 -0500 Subject: [PATCH] embed spec when converting from grpc Signed-off-by: Evan Hazlett Upstream-commit: a9d41184296c971c650f7d97a67ae5c9b44d4200 Component: engine --- .../engine/daemon/cluster/convert/secret.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/components/engine/daemon/cluster/convert/secret.go b/components/engine/daemon/cluster/convert/secret.go index acfc863efa..f8cb4ff80c 100644 --- a/components/engine/daemon/cluster/convert/secret.go +++ b/components/engine/daemon/cluster/convert/secret.go @@ -12,21 +12,20 @@ func SecretFromGRPC(s *swarmapi.Secret) swarmtypes.Secret { ID: s.ID, Digest: s.Digest, SecretSize: s.SecretSize, + Spec: swarmtypes.SecretSpec{ + Annotations: swarmtypes.Annotations{ + Name: s.Spec.Annotations.Name, + Labels: s.Spec.Annotations.Labels, + }, + Data: s.Spec.Data, + }, } - // Meta secret.Version.Index = s.Meta.Version.Index + // Meta secret.CreatedAt, _ = ptypes.Timestamp(s.Meta.CreatedAt) secret.UpdatedAt, _ = ptypes.Timestamp(s.Meta.UpdatedAt) - secret.Spec = swarmtypes.SecretSpec{ - Annotations: swarmtypes.Annotations{ - Name: s.Spec.Annotations.Name, - Labels: s.Spec.Annotations.Labels, - }, - Data: s.Spec.Data, - } - return secret }