embed spec when converting from grpc

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Upstream-commit: a9d41184296c971c650f7d97a67ae5c9b44d4200
Component: engine
This commit is contained in:
Evan Hazlett
2016-11-09 14:27:45 -05:00
parent 5cd25dda5d
commit d5d838f9f3
@@ -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
}