@@ -11,6 +11,7 @@ import (
1111 "github.com/docker/cli/cli/command"
1212 "github.com/docker/cli/cli/command/completion"
1313 "github.com/docker/cli/opts"
14+ "github.com/docker/cli/opts/swarmopts"
1415 "github.com/docker/docker/api/types"
1516 "github.com/docker/docker/api/types/container"
1617 mounttypes "github.com/docker/docker/api/types/mount"
@@ -55,7 +56,7 @@ func newUpdateCommand(dockerCLI command.Cli) *cobra.Command {
5556 flags .Var (newListOptsVar (), flagContainerLabelRemove , "Remove a container label by its key" )
5657 flags .Var (newListOptsVar (), flagMountRemove , "Remove a mount by its target path" )
5758 // flags.Var(newListOptsVar().WithValidator(validatePublishRemove), flagPublishRemove, "Remove a published port by its target port")
58- flags .Var (& opts .PortOpt {}, flagPublishRemove , "Remove a published port by its target port" )
59+ flags .Var (& swarmopts .PortOpt {}, flagPublishRemove , "Remove a published port by its target port" )
5960 flags .Var (newListOptsVar (), flagConstraintRemove , "Remove a constraint" )
6061 flags .Var (newListOptsVar (), flagDNSRemove , "Remove a custom DNS server" )
6162 flags .SetAnnotation (flagDNSRemove , "version" , []string {"1.25" })
@@ -804,7 +805,7 @@ func getUpdatedSecrets(ctx context.Context, apiClient client.SecretAPIClient, fl
804805 }
805806
806807 if flags .Changed (flagSecretAdd ) {
807- values := flags .Lookup (flagSecretAdd ).Value .(* opts .SecretOpt ).Value ()
808+ values := flags .Lookup (flagSecretAdd ).Value .(* swarmopts .SecretOpt ).Value ()
808809
809810 addSecrets , err := ParseSecrets (ctx , apiClient , values )
810811 if err != nil {
@@ -852,7 +853,7 @@ func getUpdatedConfigs(ctx context.Context, apiClient client.ConfigAPIClient, fl
852853 resolveConfigs := []* swarm.ConfigReference {}
853854
854855 if flags .Changed (flagConfigAdd ) {
855- resolveConfigs = append (resolveConfigs , flags .Lookup (flagConfigAdd ).Value .(* opts .ConfigOpt ).Value ()... )
856+ resolveConfigs = append (resolveConfigs , flags .Lookup (flagConfigAdd ).Value .(* swarmopts .ConfigOpt ).Value ()... )
856857 }
857858
858859 // if credSpecConfigNameis non-empty at this point, it means its a new
@@ -1091,7 +1092,7 @@ func updatePorts(flags *pflag.FlagSet, portConfig *[]swarm.PortConfig) error {
10911092 newPorts := []swarm.PortConfig {}
10921093
10931094 // Clean current ports
1094- toRemove := flags .Lookup (flagPublishRemove ).Value .(* opts .PortOpt ).Value ()
1095+ toRemove := flags .Lookup (flagPublishRemove ).Value .(* swarmopts .PortOpt ).Value ()
10951096portLoop:
10961097 for _ , port := range portSet {
10971098 for _ , pConfig := range toRemove {
@@ -1107,7 +1108,7 @@ portLoop:
11071108
11081109 // Check to see if there are any conflict in flags.
11091110 if flags .Changed (flagPublishAdd ) {
1110- ports := flags .Lookup (flagPublishAdd ).Value .(* opts .PortOpt ).Value ()
1111+ ports := flags .Lookup (flagPublishAdd ).Value .(* swarmopts .PortOpt ).Value ()
11111112
11121113 for _ , port := range ports {
11131114 if _ , ok := portSet [portConfigToString (& port )]; ok {
0 commit comments