-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: dongjiang1989 <[email protected]>
- Loading branch information
1 parent
7951134
commit cfd9647
Showing
881 changed files
with
90,766 additions
and
19,866 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
golang-version=1.19 | ||
kind-version=v0.20.0 | ||
kind-image=kindest/node:v1.27.3 |
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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Wide open access to the cluster (mostly for kubelet) | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: cluster-writer | ||
rules: | ||
- apiGroups: ["*"] | ||
resources: ["*"] | ||
verbs: ["*"] | ||
- nonResourceURLs: ["*"] | ||
verbs: ["*"] | ||
|
||
--- | ||
|
||
# Full read access to the api and resources | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: cluster-reader | ||
rules: | ||
- apiGroups: ["*"] | ||
resources: ["*"] | ||
verbs: ["get", "list", "watch"] | ||
- nonResourceURLs: ["*"] | ||
verbs: ["*"] | ||
--- | ||
# Give admin, kubelet, kube-system, kube-proxy god access | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: cluster-write | ||
subjects: | ||
- kind: User | ||
name: admin | ||
- kind: User | ||
name: kubelet | ||
- kind: ServiceAccount | ||
name: default | ||
namespace: kube-system | ||
- kind: User | ||
name: kube-proxy | ||
roleRef: | ||
kind: ClusterRole | ||
name: cluster-writer | ||
apiGroup: rbac.authorization.k8s.io | ||
|
||
--- | ||
|
||
# Setup sd-build as a reader. This has to be a | ||
# ClusterRoleBinding to get access to non-resource URLs | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: cluster-read | ||
subjects: | ||
- kind: ServiceAccount | ||
name: sd-build | ||
namespace: default | ||
roleRef: | ||
kind: ClusterRole | ||
name: cluster-reader | ||
apiGroup: rbac.authorization.k8s.io | ||
|
||
--- | ||
|
||
# Setup sd-build as a writer in its namespace | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: sd-build-write | ||
subjects: | ||
- kind: ServiceAccount | ||
name: sd-build | ||
namespace: default | ||
roleRef: | ||
kind: ClusterRole | ||
name: cluster-writer | ||
apiGroup: rbac.authorization.k8s.io |
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 |
---|---|---|
|
@@ -33,7 +33,7 @@ jobs: | |
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
- | ||
name: Set up Go | ||
uses: actions/[email protected] | ||
with: | ||
|
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 |
---|---|---|
|
@@ -20,7 +20,7 @@ jobs: | |
- name: Set up Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: 1.18 | ||
go-version: 1.19 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
|
@@ -29,7 +29,7 @@ jobs: | |
${{ runner.os }}-go- | ||
- name: Test and update codecov | ||
run: | | ||
go test -race -coverprofile=coverage.txt -covermode=atomic ./... | ||
go test $(go list ./... | grep -v /vendor/ | grep -v e2e) -race -coverprofile=coverage.txt -covermode=atomic | ||
- uses: codecov/codecov-action@v2 | ||
with: | ||
file: ./coverage.txt | ||
|
@@ -46,13 +46,6 @@ jobs: | |
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
|
@@ -61,10 +54,10 @@ jobs: | |
tags: | | ||
type=ref,event=tag | ||
- name: Build image | ||
uses: docker/build-push-action@v2.5.0 | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64 | ||
push: false | ||
tags: ${{ steps.meta.outputs.tags }} | ||
tags: ${{ steps.meta.outputs.tags }} |
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: e2e | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- 'release-*' | ||
- 'master' | ||
- 'main' | ||
tags: | ||
- 'v*' | ||
jobs: | ||
e2e-tests: | ||
name: E2E tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Import environment variables from file | ||
run: cat ".github/env" >> $GITHUB_ENV | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '${{ env.golang-version }}' | ||
check-latest: true | ||
- name: Build images | ||
run: | | ||
export SHELL=/bin/bash | ||
make build image | ||
- name: Start kind cluster | ||
uses: helm/[email protected] | ||
with: | ||
version: ${{ env.kind-version }} | ||
node_image: ${{ env.kind-image }} | ||
wait: 300s | ||
config: ./test/e2e/kind-conf.yaml | ||
cluster_name: e2e | ||
- name: Wait for cluster to finish bootstraping | ||
run: | | ||
kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout=300s | ||
kubectl cluster-info | ||
kubectl get pods -A | ||
- name: Load images | ||
run: | | ||
kind load docker-image -n e2e openlocal/open-local:$(cat VERSION) | ||
docker pull openlocal/csi-node-driver-registrar:v2.3.0 | ||
kind load docker-image -n e2e openlocal/csi-node-driver-registrar:v2.3.0 | ||
docker pull openlocal/csi-provisioner:v2.2.2 | ||
kind load docker-image -n e2e openlocal/csi-provisioner:v2.2.2 | ||
docker pull openlocal/csi-resizer:v1.3.0 | ||
kind load docker-image -n e2e openlocal/csi-resizer:v1.3.0 | ||
docker pull openlocal/csi-snapshotter:v4.2.1 | ||
kind load docker-image -n e2e openlocal/csi-snapshotter:v4.2.1 | ||
docker pull openlocal/snapshot-controller:v4.2.1 | ||
kind load docker-image -n e2e openlocal/snapshot-controller:v4.2.1 | ||
kubectl apply -f .github/kind-rbac.yaml | ||
- name: Run tests | ||
run: > | ||
make test-e2e | ||
e2e-tests-result: | ||
name: End-to-End Test Results | ||
if: always() | ||
needs: | ||
- e2e-tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Mark the job as a success | ||
if: needs.e2e-tests.result == 'success' | ||
run: exit 0 | ||
- name: Mark the job as a failure | ||
if: needs.e2e-tests.result != 'success' | ||
run: exit 1 |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
linters: | ||
disable-all: true | ||
enable: | ||
- gosimple | ||
- structcheck | ||
- typecheck | ||
- varcheck |
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,4 +1,4 @@ | ||
FROM golang:1.18 AS builder | ||
FROM golang:1.19 AS builder | ||
|
||
WORKDIR /go/src/github.com/alibaba/open-local | ||
COPY . . | ||
|
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
v0.8.0-alpha |
Oops, something went wrong.