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

Code before:
		},
		{
			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: "add multiple labels to the pulled image. The label should be in the format of `key=value`",
				},
			},
			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,
					Required:    true,
				},
			},
			Action: func(c *cli.Context) error {
				return cleanUp(containerdSocket, namespace, containerID)
			},

Review comment (suggestion):
nit: could condense this a bit:
```suggestion
					Usage: "label to add to the pulled image in `key=value` format",
```

Code after:
		},
		{
			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,
					Required:    true,
				},
			},
			Action: func(c *cli.Context) error {
				return cleanUp(containerdSocket, namespace, containerID)
			},