github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/swarmkit/cmd/swarmctl/node/update.go (about)

     1  package node
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/spf13/cobra"
     7  )
     8  
     9  var (
    10  	updateCmd = &cobra.Command{
    11  		Use:   "update <node ID>",
    12  		Short: "Update a node",
    13  		RunE: func(cmd *cobra.Command, args []string) error {
    14  			if err := updateNode(cmd, args); err != nil {
    15  				if err == errNoChange {
    16  					return fmt.Errorf("No change for node %s", args[0])
    17  				}
    18  				return err
    19  			}
    20  			return nil
    21  		},
    22  	}
    23  )
    24  
    25  func init() {
    26  	flags := updateCmd.Flags()
    27  	flags.StringSlice(flagLabel, nil, "node label (key=value)")
    28  }