-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #294 from amal-thundiyil/refactor
cleanup: minor changes to codebase
- Loading branch information
Showing
36 changed files
with
281 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
name: Go | ||
on: [push,pull_request] | ||
on: [push, pull_request] | ||
jobs: | ||
|
||
build: | ||
name: Build And Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.16 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.16 | ||
id: go | ||
|
||
- name: Set up Go 1.16 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.16 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
- name: Install CI tools | ||
run: make install-travis | ||
- name: Test | ||
run: make test | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
- name: Install CI tools | ||
run: make install-tools | ||
- name: Test | ||
run: make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,11 @@ | |
# Image URL to use all building/pushing image targets | ||
BRANCH ?= release | ||
RELEASE_TAG = $(shell cat VERSION) | ||
IMG_MANAGER ?= kubesphere/openelb:$(RELEASE_TAG) | ||
IMG_AGENT ?= kubesphere/openelb-agent:$(RELEASE_TAG) | ||
IMG_PROXY ?= kubesphere/openelb-proxy:$(RELEASE_TAG) | ||
IMG_FORWARD ?= kubesphere/openelb-forward:$(RELEASE_TAG) | ||
DOCKER_USERNAME ?= kubesphere | ||
IMG_MANAGER ?= $(DOCKER_USERNAME)/openelb:$(RELEASE_TAG) | ||
IMG_AGENT ?= $(DOCKER_USERNAME)/openelb-agent:$(RELEASE_TAG) | ||
IMG_PROXY ?= $(DOCKER_USERNAME)/openelb-proxy:$(RELEASE_TAG) | ||
IMG_FORWARD ?= $(DOCKER_USERNAME)/openelb-forward:$(RELEASE_TAG) | ||
|
||
CRD_OPTIONS ?= "crd:trivialVersions=true" | ||
|
||
|
@@ -28,7 +29,7 @@ vet: | |
|
||
# Run tests | ||
test: fmt vet | ||
KUBEBUILDER_ASSETS=$(shell $(GOBIN)/setup-envtest use -p path 1.19.x) go test -v ./api/... ./pkg/controllers/... ./pkg/... -coverprofile cover.out | ||
KUBEBUILDER_ASSETS="$(shell $(GOBIN)/setup-envtest use -p path 1.19.x)" go test -v ./api/... ./pkg/controllers/... ./pkg/... -coverprofile cover.out | ||
|
||
# Build manager binary | ||
manager: fmt vet | ||
|
@@ -40,13 +41,13 @@ deploy: generate | |
ifeq ($(uname), Darwin) | ||
sed -i '' -e 's@image: .*@image: '"${IMG_AGENT}"'@' ./config/${BRANCH}/agent_image_patch.yaml | ||
sed -i '' -e 's@image: .*@image: '"${IMG_MANAGER}"'@' ./config/${BRANCH}/manager_image_patch.yaml | ||
sed -i '' -e 's@NodeProxyDefaultForwardImage string = \".*\"@NodeProxyDefaultForwardImage string = \"'"${IMG_FORWARD}"'\"@' ./pkg/constant/constants.go | ||
sed -i '' -e 's@NodeProxyDefaultProxyImage string = \".*\"@NodeProxyDefaultProxyImage string = \"'"${IMG_PROXY}"'\"@' ./pkg/constant/constants.go | ||
sed -i '' -e 's@NodeProxyDefaultForwardImage string = \".*\"@NodeProxyDefaultForwardImage string = \"'"${IMG_FORWARD}"'\"@' ./pkg/constant/constant.go | ||
sed -i '' -e 's@NodeProxyDefaultProxyImage string = \".*\"@NodeProxyDefaultProxyImage string = \"'"${IMG_PROXY}"'\"@' ./pkg/constant/constant.go | ||
else | ||
sed -i -e 's@image: .*@image: '"${IMG_AGENT}"'@' ./config/${BRANCH}/agent_image_patch.yaml | ||
sed -i -e 's@image: .*@image: '"${IMG_MANAGER}"'@' ./config/${BRANCH}/manager_image_patch.yaml | ||
sed -i -e 's@NodeProxyDefaultForwardImage string = \".*\"@NodeProxyDefaultForwardImage string = \"'"${IMG_FORWARD}"'\"@' ./pkg/constant/constants.go | ||
sed -i -e 's@NodeProxyDefaultProxyImage string = \".*\"@NodeProxyDefaultProxyImage string = \"'"${IMG_PROXY}"'\"@' ./pkg/constant/constants.go | ||
sed -i -e 's@NodeProxyDefaultForwardImage string = \".*\"@NodeProxyDefaultForwardImage string = \"'"${IMG_FORWARD}"'\"@' ./pkg/constant/constant.go | ||
sed -i -e 's@NodeProxyDefaultProxyImage string = \".*\"@NodeProxyDefaultProxyImage string = \"'"${IMG_PROXY}"'\"@' ./pkg/constant/constant.go | ||
endif | ||
kustomize build config/${BRANCH} -o deploy/openelb.yaml | ||
@echo "Done, the yaml is in deploy folder named 'openelb.yaml'" | ||
|
@@ -58,7 +59,7 @@ generate: controller-gen | |
|
||
controller-gen: | ||
ifeq (, $(shell which controller-gen)) | ||
go get sigs.k8s.io/controller-tools/cmd/[email protected] | ||
go install sigs.k8s.io/controller-tools/cmd/[email protected] | ||
CONTROLLER_GEN=$(GOBIN)/controller-gen | ||
else | ||
CONTROLLER_GEN=$(shell which controller-gen) | ||
|
@@ -79,7 +80,7 @@ release: deploy | |
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --platform linux/amd64,linux/arm64 -t ${IMG_PROXY} -f ./images/proxy/Dockerfile . --push | ||
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --platform linux/amd64,linux/arm64 -t ${IMG_FORWARD} -f ./images/forward/Dockerfile . --push | ||
|
||
install-travis: | ||
install-tools: | ||
echo "install kubebuilder/kustomize etc." | ||
chmod +x ./hack/*.sh | ||
./hack/install_tools.sh |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.