func updatePlacement(flags *pflag.FlagSet, placement *swarm.Placement) { field, _ := flags.GetStringSlice(flagConstraintAdd) placement.Constraints = append(placement.Constraints, field...) toRemove := buildToRemoveSet(flags, flagConstraintRemove) placement.Constraints = removeItems(placement.Constraints, toRemove, itemKey) }
func placementFromGRPC(p *swarmapi.Placement) *types.Placement { var r *types.Placement if p != nil { r = &types.Placement{} r.Constraints = p.Constraints } return r }