Skip to content

Commit

Permalink
Fix apache#1103: Use ENV variables instead of empty strings
Browse files Browse the repository at this point in the history
  • Loading branch information
bouskaJ committed Nov 27, 2019
1 parent ac715fa commit 9c77e93
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 0 additions & 4 deletions e2e/test_support.go
Expand Up @@ -87,10 +87,6 @@ func kamel(args ...string) *cobra.Command {
var c *cobra.Command
var err error

kamelArgs := os.Getenv("KAMEL_ARGS")
kamelDefaultArgs := strings.Fields(kamelArgs)
args = append(kamelDefaultArgs, args...)

kamelBin := os.Getenv("KAMEL_BIN")
if kamelBin != "" {
fmt.Printf("Using external kamel binary on path %s\n", kamelBin)
Expand Down
14 changes: 8 additions & 6 deletions pkg/cmd/install.go
Expand Up @@ -19,6 +19,7 @@ package cmd

import (
"fmt"
"os"
"regexp"
"strings"
"time"
Expand Down Expand Up @@ -66,10 +67,10 @@ func newCmdInstall(rootCmdOptions *RootCmdOptions) *cobra.Command {
cmd.Flags().StringVar(&impl.registry.Secret, "registry-secret", "", "A secret used to push/pull images to the Docker registry")
cmd.Flags().BoolVar(&impl.registry.Insecure, "registry-insecure", false, "Configure to configure registry access in insecure mode or not")
cmd.Flags().StringSliceVarP(&impl.properties, "property", "p", nil, "Add a camel property")
cmd.Flags().StringVar(&impl.camelVersion, "camel-version", "", "Set the camel version")
cmd.Flags().StringVar(&impl.camelVersion, "camel-version", os.Getenv("KAMEL_CAMEL_VERSION"), "Set the camel version")
cmd.Flags().StringVar(&impl.runtimeVersion, "runtime-version", "", "Set the camel-k runtime version")
cmd.Flags().StringVar(&impl.baseImage, "base-image", "", "Set the base image used to run integrations")
cmd.Flags().StringVar(&impl.operatorImage, "operator-image", "", "Set the operator image used for the operator deployment")
cmd.Flags().StringVar(&impl.baseImage, "base-image", os.Getenv("KAMEL_BASE_IMAGE"), "Set the base image used to run integrations")
cmd.Flags().StringVar(&impl.operatorImage, "operator-image", os.Getenv("KAMEL_OPERATOR_IMAGE"), "Set the operator image used for the operator deployment")
cmd.Flags().StringSliceVar(&impl.kits, "kit", nil, "Add an integration kit to build at startup")
cmd.Flags().StringVar(&impl.buildStrategy, "build-strategy", "", "Set the build strategy")
cmd.Flags().StringVar(&impl.buildTimeout, "build-timeout", "", "Set how long the build process can last")
Expand All @@ -79,9 +80,10 @@ func newCmdInstall(rootCmdOptions *RootCmdOptions) *cobra.Command {
"(HTTP_PROXY|HTTPS_PROXY|NO_PROXY)")

// maven settings
cmd.Flags().StringVar(&impl.localRepository, "local-repository", "", "Location of the local maven repository")
cmd.Flags().StringVar(&impl.mavenSettings, "maven-settings", "", "Configure the source of the maven settings (configmap|secret:name[/key])")
cmd.Flags().StringSliceVar(&impl.mavenRepositories, "maven-repository", nil, "Add a maven repository")
cmd.Flags().StringVar(&impl.localRepository, "local-repository", os.Getenv("KAMEL_LOCAL_REPOSITORY"), "Location of the local maven repository")
cmd.Flags().StringVar(&impl.mavenSettings, "maven-settings", os.Getenv("KAMEL_MAVEN_SETTINGS"), "Configure the source of the maven settings (configmap|secret:name[/key])")
kamelMavenRepository := os.Getenv("KAMEL_MAVEN_REPOSITORY")
cmd.Flags().StringSliceVar(&impl.mavenRepositories, "maven-repository", strings.Split(kamelMavenRepository, ","), "Add a maven repository")

// completion support
configureBashAnnotationForFlag(
Expand Down

0 comments on commit 9c77e93

Please sign in to comment.