diff --git a/Dockerfile b/Dockerfile index 8dfbf8f5e..4e9bcc8d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,9 @@ WORKDIR /api-build COPY api/go.mod api/go.sum ./ RUN go mod download +# cheap trick to make the build faster (As long as go.mod wasn't changes +RUN go list -f '{{.Path}}@{{.Version}}' -m all | sed 1d | xargs go get + # Copy and build api code COPY api . RUN go build -ldflags="-s -w" -o mizuagent . diff --git a/cli/cmd/root.go b/cli/cmd/root.go index cf2e42dc9..c807fe1ca 100644 --- a/cli/cmd/root.go +++ b/cli/cmd/root.go @@ -17,7 +17,7 @@ func init() { if len(args) != 0 { return rootCmd.Help() } - + mizu.Run() return nil } @@ -32,7 +32,10 @@ func init() { rootCmd.Flags().StringVarP(&config.Configuration.MizuImage, "mizu-image", "", "gcr.io/up9-docker-hub/mizu/develop:latest", "Custom image for mizu collector") rootCmd.Flags().Uint16VarP(&config.Configuration.MizuPodPort, "mizu-port", "", 8899, "Port which mizu cli will attempt to forward from the mizu collector pod") rootCmd.Flags().StringVarP(&config.Configuration.TappedPodName, "pod", "", "", "View traffic of this pod") - rootCmd.MarkFlagRequired("pod") + err := rootCmd.MarkFlagRequired("pod") + if err != nil { + panic(err) + } } // Execute adds all child commands to the root command and sets flags appropriately.