Skip to content

Commit

Permalink
Remove antctl-bin dir and use bin for antctl binaries builds
Browse files Browse the repository at this point in the history
Signed-off-by: Weiqiang TANG <[email protected]>
  • Loading branch information
weiqiangt committed Dec 13, 2019
1 parent 81c90ed commit f33dbbe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ GO ?= go
LDFLAGS :=
GOFLAGS :=
BINDIR := $(CURDIR)/bin
ANTCTL_BINDIR := $(CURDIR)/antctl-bin
GO_FILES := $(shell find . -type d -name '.cache' -prune -o -type f -name '*.go' -print)
GOPATH ?= $$(go env GOPATH)
GOPATH ?= $$($(GO) env GOPATH)
DOCKER_CACHE := $(CURDIR)/.cache

.PHONY: all
Expand Down Expand Up @@ -80,11 +79,11 @@ docker-tidy: $(DOCKER_CACHE)
# TODO: strip binary when building realses
ANTCTL_BINARIES := antctl-darwin antctl-linux antctl-windows
$(ANTCTL_BINARIES): antctl-%:
@GOOS=$* $(GO) build -o $(ANTCTL_BINDIR)/$@ $(GOFLAGS) -ldflags '$(LDFLAGS)' github.com/vmware-tanzu/antrea/cmd/antctl
@GOOS=$* $(GO) build -o $(BINDIR)/$@ $(GOFLAGS) -ldflags '$(LDFLAGS)' github.com/vmware-tanzu/antrea/cmd/antctl
@if [[ $@ != *windows ]]; then \
chmod 0755 $(ANTCTL_BINDIR)/$@; \
chmod 0755 $(BINDIR)/$@; \
else \
mv $(ANTCTL_BINDIR)/$@ $(ANTCTL_BINDIR)/$@.exe; \
mv $(BINDIR)/$@ $(BINDIR)/$@.exe; \
fi

.PHONY: antctl
Expand Down Expand Up @@ -139,7 +138,6 @@ lint: .linter
.PHONY: clean
clean:
@rm -rf $(BINDIR)
@rm -rf $(ANTCTL_BINDIR)
@rm -rf $(DOCKER_CACHE)
@rm -f .mockgen .protoc

Expand Down
4 changes: 2 additions & 2 deletions build/yamls/antrea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ rules:
verbs:
- create
- nonResourceURLs:
- /apis/antctl.antrea.tanzu.vmware.com/v1
- /apis/antctl.antrea.tanzu.vmware.com/v1/*
- /apis/antctl.antrea.tanzu.vmware.com/v1
- /apis/antctl.antrea.tanzu.vmware.com/v1/*
verbs:
- get
---
Expand Down
2 changes: 1 addition & 1 deletion cmd/antctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var commandName = path.Base(os.Args[0])
var rootCmd = &cobra.Command{
Use: commandName,
Short: commandName + " is the command line tool for Antrea",
Long: commandName + " is the command line tool for Antrea that supports showing runtime information of Controller or Agent.",
Long: commandName + " is the command line tool for Antrea that supports showing runtime information of ${component}",
}

func init() {
Expand Down

0 comments on commit f33dbbe

Please sign in to comment.