MCPcopy Create free account
hub / github.com/containerd/nerdctl / setUpdateFlags

Function setUpdateFlags

cmd/nerdctl/container/container_update.go:75–92  ·  view source on GitHub ↗
(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

73}
74
75func setUpdateFlags(cmd *cobra.Command) {
76 cmd.Flags().Float64("cpus", 0.0, "Number of CPUs")
77 cmd.Flags().Uint64("cpu-period", 0, "Limit CPU CFS (Completely Fair Scheduler) period")
78 cmd.Flags().Int64("cpu-quota", -1, "Limit CPU CFS (Completely Fair Scheduler) quota")
79 cmd.Flags().Uint64("cpu-shares", 0, "CPU shares (relative weight)")
80 cmd.Flags().StringP("memory", "m", "", "Memory limit")
81 cmd.Flags().String("memory-reservation", "", "Memory soft limit")
82 cmd.Flags().String("memory-swap", "", "Swap limit equal to memory plus swap: '-1' to enable unlimited swap")
83 cmd.Flags().String("kernel-memory", "", "Kernel memory limit (deprecated)")
84 cmd.Flags().String("cpuset-cpus", "", "CPUs in which to allow execution (0-3, 0,1)")
85 cmd.Flags().String("cpuset-mems", "", "MEMs in which to allow execution (0-3, 0,1)")
86 cmd.Flags().Int64("pids-limit", -1, "Tune container pids limit (set -1 for unlimited)")
87 cmd.Flags().Uint16("blkio-weight", 0, "Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)")
88 cmd.Flags().String("restart", "no", `Restart policy to apply when a container exits (implemented values: "no"|"always|on-failure:n|unless-stopped")`)
89 cmd.RegisterFlagCompletionFunc("restart", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
90 return []string{"no", "always", "on-failure", "unless-stopped"}, cobra.ShellCompDirectiveNoFileComp
91 })
92}
93
94func updateAction(cmd *cobra.Command, args []string) error {
95 globalOptions, err := helpers.ProcessRootCmdFlags(cmd)

Callers 1

UpdateCommandFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…