CLI make --pod required flag and faster api image build (#25)

* makefile fixes - docker build

* readme update, CLI usage fix

* added chmod

* typo

* run example incorreect in makefile

* no message

* no message

* no message

Co-authored-by: Alex Haiut <alex@up9.com>
This commit is contained in:
gadotroee 2021-05-03 11:25:15 +03:00 committed by GitHub
parent 0d277faaf8
commit 5727630846
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -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 .

View File

@ -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.