Add support for push-image with --build local (#1257)

The PR https://github.com/kubernetes/kompose/pull/1147 introduced a
push-image parameter for the 'up' command that allows to disable
pushing the image to the registry. The PR changed the behavior of the
'convert' command that now no longer pushes the image.

This commit introduces the same parameter for the 'convert' command
and reintroduces the original behavior of pushing the image.
This commit is contained in:
Christian Fetzer 2020-03-08 06:58:01 +01:00 committed by GitHub
parent 992df58d8f
commit 2bdb3261a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,6 +45,7 @@ var (
ConvertDeploymentConfig bool
ConvertReplicas int
ConvertController string
ConvertPushImage bool
ConvertOpt kobject.ConvertOptions
ConvertYAMLIndent int
)
@ -75,6 +76,7 @@ var convertCmd = &cobra.Command{
Build: ConvertBuild,
BuildRepo: ConvertBuildRepo,
BuildBranch: ConvertBuildBranch,
PushImage: ConvertPushImage,
CreateDeploymentConfig: ConvertDeploymentConfig,
EmptyVols: ConvertEmptyVols,
Volumes: ConvertVolumes,
@ -130,6 +132,7 @@ func init() {
// Standard between the two
convertCmd.Flags().StringVar(&ConvertBuild, "build", "none", `Set the type of build ("local"|"build-config"(OpenShift only)|"none")`)
convertCmd.Flags().BoolVar(&ConvertPushImage, "push-image", true, "If we should push the docker image we built")
convertCmd.Flags().BoolVarP(&ConvertYaml, "yaml", "y", false, "Generate resource files into YAML format")
convertCmd.Flags().MarkDeprecated("yaml", "YAML is the default format now.")
convertCmd.Flags().MarkShorthandDeprecated("y", "YAML is the default format now.")