|
@@ -2,6 +2,7 @@ package convert // import "github.com/docker/docker/daemon/cluster/convert"
|
|
|
|
|
|
import (
|
|
import (
|
|
swarmtypes "github.com/docker/docker/api/types/swarm"
|
|
swarmtypes "github.com/docker/docker/api/types/swarm"
|
|
|
|
+ types "github.com/docker/docker/api/types/swarm"
|
|
swarmapi "github.com/docker/swarmkit/api"
|
|
swarmapi "github.com/docker/swarmkit/api"
|
|
gogotypes "github.com/gogo/protobuf/types"
|
|
gogotypes "github.com/gogo/protobuf/types"
|
|
)
|
|
)
|
|
@@ -22,12 +23,19 @@ func SecretFromGRPC(s *swarmapi.Secret) swarmtypes.Secret {
|
|
secret.CreatedAt, _ = gogotypes.TimestampFromProto(s.Meta.CreatedAt)
|
|
secret.CreatedAt, _ = gogotypes.TimestampFromProto(s.Meta.CreatedAt)
|
|
secret.UpdatedAt, _ = gogotypes.TimestampFromProto(s.Meta.UpdatedAt)
|
|
secret.UpdatedAt, _ = gogotypes.TimestampFromProto(s.Meta.UpdatedAt)
|
|
|
|
|
|
|
|
+ if s.Spec.Templating != nil {
|
|
|
|
+ secret.Spec.Templating = &types.Driver{
|
|
|
|
+ Name: s.Spec.Templating.Name,
|
|
|
|
+ Options: s.Spec.Templating.Options,
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
return secret
|
|
return secret
|
|
}
|
|
}
|
|
|
|
|
|
// SecretSpecToGRPC converts Secret to a grpc Secret.
|
|
// SecretSpecToGRPC converts Secret to a grpc Secret.
|
|
func SecretSpecToGRPC(s swarmtypes.SecretSpec) swarmapi.SecretSpec {
|
|
func SecretSpecToGRPC(s swarmtypes.SecretSpec) swarmapi.SecretSpec {
|
|
- return swarmapi.SecretSpec{
|
|
|
|
|
|
+ spec := swarmapi.SecretSpec{
|
|
Annotations: swarmapi.Annotations{
|
|
Annotations: swarmapi.Annotations{
|
|
Name: s.Name,
|
|
Name: s.Name,
|
|
Labels: s.Labels,
|
|
Labels: s.Labels,
|
|
@@ -35,6 +43,15 @@ func SecretSpecToGRPC(s swarmtypes.SecretSpec) swarmapi.SecretSpec {
|
|
Data: s.Data,
|
|
Data: s.Data,
|
|
Driver: driverToGRPC(s.Driver),
|
|
Driver: driverToGRPC(s.Driver),
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if s.Templating != nil {
|
|
|
|
+ spec.Templating = &swarmapi.Driver{
|
|
|
|
+ Name: s.Templating.Name,
|
|
|
|
+ Options: s.Templating.Options,
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return spec
|
|
}
|
|
}
|
|
|
|
|
|
// SecretReferencesFromGRPC converts a slice of grpc SecretReference to SecretReference
|
|
// SecretReferencesFromGRPC converts a slice of grpc SecretReference to SecretReference
|