daemon/cluster/convert/swarm.go
Function SwarmFromGRPC
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func SwarmFromGRPC(c swarmapi.Cluster) types.Swarm {
swarm := types.Swarm{
ClusterInfo: types.ClusterInfo{
ID: c.ID,
Spec: types.Spec{
Function MergeSwarmSpecToGRPC
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func MergeSwarmSpecToGRPC(s types.Spec, spec swarmapi.ClusterSpec) (swarmapi.ClusterSpec, error) {
// We take the initSpec (either created from scratch, or returned by swarmkit),
// and will only change the value if the one taken from types.Spec is not nil or 0.
// In other words, if the value taken from types.Spec is nil or 0, we will maintain the status quo.
if s.Annotations.Name != "" {