Repository: bottlerocket-os/bottlerocket
File: sources/host-ctr/cmd/host-ctr/main.go (Go)

Code before:
				return runCtr(containerdSocket, namespace, containerID, source, superpowered, registryConfig, containerType(cType), useCachedImage)
			},
		},
		{
			Name:        "pull-image",
			Usage:       "pull the specified container image",
			Description: "pull the specified container image to make it available in the containerd image store",
			Flags: []cli.Flag{
				&cli.StringFlag{
					Name:        "source",
					Usage:       "the image source",
					Destination: &source,
					Required:    true,
				},
				&cli.StringFlag{
					Name:        "registry-config",
					Usage:       "path to image registry configuration",
					Destination: &registryConfig,
				},
				&cli.BoolFlag{
					Name:        "skip-if-image-exists",
					Usage:       "skips registry authentication and image pull if the image already exists in the image store",
					Destination: &useCachedImage,
					Value:       false,
				},
				&cli.StringFlag{
					Name:        "labels",
					Usage:       "add labels to the pulled image. Each label should be in the format of `key=value` and separated by a comma",
					Destination: &labels,
					Value:       "",
				},
			},
			Action: func(c *cli.Context) error {
				return pullImageOnly(containerdSocket, namespace, source, registryConfig, useCachedImage, labels)
			},
		},
		{
			Name:  "clean-up",
			Usage: "delete specified container's resources if it exists",
			Flags: []cli.Flag{
				&cli.StringFlag{
					Name:        "container-id",
					Usage:       "the id of the container to clean up",
					Destination: &containerID,
					Required:    true,
				},
			},
			Action: func(c *cli.Context) error {
				return cleanUp(containerdSocket, namespace, containerID)
			},
		},

Review comment (suggestion):
A [StringSliceFlag](https://cli.urfave.org/v2/examples/flags/#multiple-values-per-single-flag) that lets you pass one label per instance of `--label` might be better here.

Code after:
					Value:       false,
				},
			},
			Action: func(c *cli.Context) error {
				return runCtr(containerdSocket, namespace, containerID, source, superpowered, registryConfig, containerType(cType), useCachedImage)
			},
		},
		{
			Name:        "pull-image",
			Usage:       "pull the specified container image",
			Description: "pull the specified container image to make it available in the containerd image store",
			Flags: []cli.Flag{
				&cli.StringFlag{
					Name:        "source",
					Usage:       "the image source",
					Destination: &source,
					Required:    true,
				},
				&cli.StringFlag{
					Name:        "registry-config",
					Usage:       "path to image registry configuration",
					Destination: &registryConfig,
				},
				&cli.BoolFlag{
					Name:        "skip-if-image-exists",
					Usage:       "skips registry authentication and image pull if the image already exists in the image store",
					Destination: &useCachedImage,
					Value:       false,
				},
				&cli.StringSliceFlag{
					Name:  "label",
					Usage: "label to add to the pulled image in `key=value` format",
				},
			},
			Action: func(c *cli.Context) error {
				labels := c.StringSlice("label")
				labelsMap, err := convertLabels(labels)
				if err != nil {
					return err
				}
				return pullImageOnly(containerdSocket, namespace, source, registryConfig, useCachedImage, labelsMap)
			},
		},
		{
			Name:  "clean-up",
			Usage: "delete specified container's resources if it exists",
			Flags: []cli.Flag{
				&cli.StringFlag{
					Name:        "container-id",
					Usage:       "the id of the container to clean up",
					Destination: &containerID,