cmd

package
v0.0.0-...-8e01d1d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "resolve-tags",
	Short: "resolve-tags is a tool for replacing tagged images with fully qualified images in Kubernetes yamls",
	Long: `resolve-tags can be run as either a kubectl plugin or as a binary. It takes in paths to file and
		   prints new manifests to STDOUT.

		   Note: When running as a binary, if the KUBECTL_PLUGINS_LOCAL_FLAG_FILENAME env variable is set,
		   it will override any files passed in.`,
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {

		if err := flag.CommandLine.Parse([]string{}); err != nil {
			return err
		}
		resolveApply()
		cwd, err := os.Getwd()
		if err != nil {
			return err
		}
		return resolveFilepaths(cwd)
	},
	RunE: func(cmd *cobra.Command, args []string) error {
		substitutes, err := resolve.Execute(files)
		if err != nil {
			return fmt.Errorf("unable to resolve: %v", err)
		}
		return outputResults(substitutes, cmd.OutOrStdout())
	},

	SilenceUsage: true,
}

RootCmd implements the resolve-tags command.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL