From ac22c9c95aca3e25ed7352deeeefc724827e18e2 Mon Sep 17 00:00:00 2001 From: "Kevin C. Wells" Date: Wed, 4 Apr 2018 18:28:25 +0000 Subject: [PATCH] Default to --native = true This commit temporarily sets the default value for --native to true, making running inside a container an opt-in behavior. This will make the testing and transition to containerized mixer easier. Eventually this switch will be flipped back to false, making containerized the default running mode. To run in container, append '--native=false' to your command. Signed-off-by: Kevin C. Wells --- builder/builder.go | 2 +- mixer/cmd/root.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/builder/builder.go b/builder/builder.go index 65fb726..e4cfe40 100644 --- a/builder/builder.go +++ b/builder/builder.go @@ -49,7 +49,7 @@ const Version = "4.6.1" // Native controls whether mixer runs the command on the native machine or in a // container. -var Native = false +var Native = true // Offline controls whether mixer attempts to automatically cache upstream // bundles. In offline mode, all necessary bundles must exist in local-bundles. diff --git a/mixer/cmd/root.go b/mixer/cmd/root.go index 0c0ccd5..3435427 100644 --- a/mixer/cmd/root.go +++ b/mixer/cmd/root.go @@ -204,7 +204,7 @@ func init() { // TODO: Remove this once we drop the old config format RootCmd.PersistentFlags().BoolVar(&config.UseNewConfig, "new-config", false, "EXPERIMENTAL: use the new TOML config format") - RootCmd.PersistentFlags().BoolVar(&builder.Native, "native", false, "Run mixer command on native host instead of in a container") + RootCmd.PersistentFlags().BoolVar(&builder.Native, "native", true, "Run mixer command on native host instead of in a container") RootCmd.PersistentFlags().BoolVar(&builder.Offline, "offline", false, "Skip caching upstream-bundles; work entirely with local-bundles") RootCmd.AddCommand(initCmd) @@ -247,6 +247,9 @@ func reconstructCommand(cmd *cobra.Command, args []string) []string { } // For each flag that was set, append its name and value cmd.Flags().Visit(func(flag *pflag.Flag) { + if flag.Name == "native" { + return + } command = append(command, "--"+flag.Name+"="+flag.Value.String()) }) // Append args