Skip to content

Commit

Permalink
fix: fix ci failed
Browse files Browse the repository at this point in the history
Signed-off-by: charlie <[email protected]>
  • Loading branch information
Charlie17Li committed Jul 30, 2023
1 parent fd8dcc1 commit 6c2e4b3
Show file tree
Hide file tree
Showing 14 changed files with 350 additions and 28 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ jobs:

- name: Run Coverage Tests
run: make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
files: ./coverage.xml
verbose: true
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v3
# with:
# fail_ci_if_error: true
# files: ./coverage.xml
# verbose: true

build:
# The type of runner that the job will run on
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o ma
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=builder /workspace/manager .
COPY config/ config/
USER 65532:65532

ENTRYPOINT ["/manager"]
20 changes: 12 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# Image URL to use all building/pushing image targets
IMG ?= controller:latest
HUB ?= docker.io/higress-operator
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.26.1

Expand All @@ -17,6 +17,8 @@ ifeq ($(TAG),)
$(error "TAG cannot be empty")
endif

IMG ?= "${HUB}:${TAG}"

# Setting SHELL to bash allows bash commands to be executed by recipes.
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
SHELL = /usr/bin/env bash -o pipefail
Expand Down Expand Up @@ -62,7 +64,7 @@ vet: ## Run go vet against code.

.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
# KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out

##@ Build

Expand All @@ -78,7 +80,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
docker-build: test ## Build docker image with the manager.
docker-build: ## Build docker image with the manager.
docker build -t ${IMG} .

.PHONY: docker-push
Expand Down Expand Up @@ -192,11 +194,11 @@ delete-cluster: check-tools
# docker pull registry.cn-hangzhou.aliyuncs.com/hinsteny/nacos-standlone-rc3:1.0.0-RC3
.PHONY: kube-load-image
kube-load-image: check-tools ## Install the Higress image to a kind cluster using the provided $IMAGE and $TAG.
hack/kind-load-image.sh higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/higress $(TAG)
hack/docker-pull-image.sh registry.cn-hangzhou.aliyuncs.com/hinsteny/dubbo-provider-demo 0.0.1
hack/docker-pull-image.sh registry.cn-hangzhou.aliyuncs.com/hinsteny/nacos-standlone-rc3 1.0.0-RC3
hack/kind-load-image.sh registry.cn-hangzhou.aliyuncs.com/hinsteny/dubbo-provider-demo 0.0.1
hack/kind-load-image.sh registry.cn-hangzhou.aliyuncs.com/hinsteny/nacos-standlone-rc3 1.0.0-RC3
hack/kind-load-image.sh ${HUB} $(TAG)
# hack/docker-pull-image.sh registry.cn-hangzhou.aliyuncs.com/hinsteny/dubbo-provider-demo 0.0.1
# hack/docker-pull-image.sh registry.cn-hangzhou.aliyuncs.com/hinsteny/nacos-standlone-rc3 1.0.0-RC3
# hack/kind-load-image.sh registry.cn-hangzhou.aliyuncs.com/hinsteny/dubbo-provider-demo 0.0.1
# hack/kind-load-image.sh registry.cn-hangzhou.aliyuncs.com/hinsteny/nacos-standlone-rc3 1.0.0-RC3

.PHONY: install-dev
install-dev: install deploy
Expand All @@ -206,6 +208,8 @@ install-dev: install deploy
.PHONY: run-higress-operator-test
run-higress-operator-test:
@echo -e "\n\033[36mRunning higress operator tests...\033[0m"
@echo -e "\n\033[36mWaiting higress-operator-controller-manager to be ready...\033[0m\n"
kubectl wait --timeout=10m -n higress-system deployment/higress-operator-controller-manager --for=condition=Available
@echo -e "\n\033[36mWaiting higress-controller to be ready...\033[0m\n"
kubectl wait --timeout=10m -n higress-system deployment/higress-controller --for=condition=Available
@echo -e "\n\033[36mWaiting higress-gateway to be ready...\033[0m\n"
Expand Down
4 changes: 2 additions & 2 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: charlie1380/higress-operator
newTag: latest
newName: docker.io/higress-operator
newTag: 96fdf07886b58710f05f284d9099ca2c229c77e0
244 changes: 244 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,33 @@ rules:
- patch
- update
- watch
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- apiGroups:
- admissionregistration.k8s.io
resources:
- mutatingwebhookconfigurations
verbs:
- get
- list
- patch
- update
- watch
- apiGroups:
- admissionregistration.k8s.io
resources:
- validatingwebhookconfigurations
verbs:
- get
- list
- update
- watch
- apiGroups:
- apiextensions.k8s.io
resources:
Expand All @@ -34,7 +61,9 @@ rules:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- apps
resources:
Expand All @@ -48,6 +77,185 @@ rules:
- patch
- update
- watch
- apiGroups:
- authentication.istio.io
resources:
- '*'
verbs:
- get
- list
- watch
- apiGroups:
- certificates.k8s.io
resources:
- certificatesigningrequests
verbs:
- create
- delete
- get
- update
- watch
- apiGroups:
- certificates.k8s.io
resources:
- certificatesigningrequests/approval
verbs:
- create
- delete
- get
- update
- watch
- apiGroups:
- certificates.k8s.io
resources:
- certificatesigningrequests/status
verbs:
- create
- delete
- get
- update
- watch
- apiGroups:
- certificates.k8s.io
resources:
- resourceNames=certificatesigningrequests/status
- signers
verbs:
- create
- delete
- get
- update
- watch
- apiGroups:
- certificates.k8s.io
resources:
- resourceNames=kubernetes.io/legacy-unknown
- signers
verbs:
- approve
- apiGroups:
- config.istio.io
resources:
- '*'
verbs:
- get
- list
- watch
- apiGroups:
- discovery.k8s.io
resources:
- endpointslices
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- ingressclasses
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- ingresses
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- ingresses/status
verbs:
- '*'
- apiGroups:
- extensions.higress.io
resources:
- '*'
verbs:
- get
- list
- watch
- apiGroups:
- extensions.higress.io
resources:
- wasmplugins
verbs:
- create
- get
- list
- patch
- update
- watch
- apiGroups:
- extensions.istio.io
resources:
- '*'
verbs:
- get
- list
- watch
- apiGroups:
- gateway.networking.k8s.io
resources:
- '*'
verbs:
- get
- list
- update
- watch
- apiGroups:
- multicluster.x-k8s.io
resources:
- serviceexports
verbs:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- multicluster.x-k8s.io
resources:
- serviceimports
verbs:
- get
- list
- watch
- apiGroups:
- networking.higress.io
resources:
- http2rpcs
verbs:
- create
- get
- list
- patch
- update
- watch
- apiGroups:
- networking.higress.io
resources:
- mcpbridges
verbs:
- create
- get
- list
- patch
- update
- watch
- apiGroups:
- networking.istio.io
resources:
- '*'
verbs:
- get
- list
- watch
- apiGroups:
- networking.k8s.io
resources:
Expand All @@ -56,6 +264,8 @@ rules:
- create
- delete
- get
- list
- watch
- apiGroups:
- networking.k8s.io
resources:
Expand All @@ -69,7 +279,17 @@ rules:
resources:
- ingresses/status
verbs:
- '*'
- update
- apiGroups:
- networking.x-k8s.io
resources:
- '*'
verbs:
- get
- list
- update
- watch
- apiGroups:
- operator.higress.io
resources:
Expand Down Expand Up @@ -137,3 +357,27 @@ rules:
- patch
- update
- watch
- apiGroups:
- rbac.istio.io
resources:
- '*'
verbs:
- get
- list
- watch
- apiGroups:
- security.istio.io
resources:
- '*'
verbs:
- get
- list
- watch
- apiGroups:
- telemetry.istio.io
resources:
- '*'
verbs:
- get
- list
- watch
Empty file modified hack/check_tools.sh
100644 → 100755
Empty file.
Loading

0 comments on commit 6c2e4b3

Please sign in to comment.