Fix mizu image parameter (#53)

This commit is contained in:
gadotroee
2021-05-23 13:34:32 +03:00
committed by GitHub
parent 2e87a01346
commit 2f3215b71a
3 changed files with 5 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
FOLDER=$(GOOS).$(GOARCH) FOLDER=$(GOOS).$(GOARCH)
COMMIT_HASH=$(shell git rev-parse HEAD) COMMIT_HASH=$(shell git rev-parse HEAD)
GIT_BRANCH=$(shell git branch --show-current)
.PHONY: help .PHONY: help
.DEFAULT_GOAL := help .DEFAULT_GOAL := help
@@ -11,7 +12,7 @@ install:
go install mizu.go go install mizu.go
build: ## build mizu CLI binary (select platform via GOOS / GOARCH env variables) build: ## build mizu CLI binary (select platform via GOOS / GOARCH env variables)
go build -ldflags="-X 'github.com/up9inc/mizu/cli/mizu.GitCommitHash=$(COMMIT_HASH)'" -o bin/$(FOLDER)/mizu mizu.go go build -ldflags="-X 'github.com/up9inc/mizu/cli/mizu.GitCommitHash=$(COMMIT_HASH)' -X 'github.com/up9inc/mizu/cli/mizu.Branch=$(GIT_BRANCH)'" -o bin/$(FOLDER)/mizu mizu.go
build-all: ## build for all supported platforms build-all: ## build for all supported platforms
@echo "Compiling for every OS and Platform" @echo "Compiling for every OS and Platform"

View File

@@ -2,7 +2,7 @@ package cmd
import ( import (
"errors" "errors"
"fmt"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/up9inc/mizu/cli/config" "github.com/up9inc/mizu/cli/config"
@@ -34,6 +34,6 @@ func init() {
tapCmd.Flags().Uint16VarP(&config.Configuration.GuiPort, "gui-port", "p", 8899, "Provide a custom port for the web interface webserver") tapCmd.Flags().Uint16VarP(&config.Configuration.GuiPort, "gui-port", "p", 8899, "Provide a custom port for the web interface webserver")
tapCmd.Flags().StringVarP(&config.Configuration.Namespace, "namespace", "n", "", "Namespace selector") tapCmd.Flags().StringVarP(&config.Configuration.Namespace, "namespace", "n", "", "Namespace selector")
tapCmd.Flags().StringVarP(&config.Configuration.KubeConfigPath, "kubeconfig", "k", "", "Path to kubeconfig file") tapCmd.Flags().StringVarP(&config.Configuration.KubeConfigPath, "kubeconfig", "k", "", "Path to kubeconfig file")
tapCmd.Flags().StringVarP(&config.Configuration.MizuImage, "mizu-image", "", "gcr.io/up9-docker-hub/mizu/develop:latest", "Custom image for mizu collector") tapCmd.Flags().StringVarP(&config.Configuration.MizuImage, "mizu-image", "", fmt.Sprintf("gcr.io/up9-docker-hub/mizu/%s:latest", mizu.Branch), "Custom image for mizu collector")
tapCmd.Flags().Uint16VarP(&config.Configuration.MizuPodPort, "mizu-port", "", 8899, "Port which mizu cli will attempt to forward from the mizu collector pod") tapCmd.Flags().Uint16VarP(&config.Configuration.MizuPodPort, "mizu-port", "", 8899, "Port which mizu cli will attempt to forward from the mizu collector pod")
} }

View File

@@ -2,6 +2,7 @@ package mizu
var ( var (
Version = "v0.0.1" Version = "v0.0.1"
Branch = "develop"
GitCommitHash = "" // this var is overridden using ldflags in makefile when building GitCommitHash = "" // this var is overridden using ldflags in makefile when building
) )