forked from alibaba/higress
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add lint/e2e tests support (alibaba#126)
Signed-off-by: bitliu <[email protected]>
- Loading branch information
Showing
38 changed files
with
2,897 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ header: | |
- 'plugins/**' | ||
- 'CODEOWNERS' | ||
- 'VERSION' | ||
- 'tools/' | ||
|
||
comment: on-failure | ||
dependency: | ||
|
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 |
---|---|---|
@@ -0,0 +1,80 @@ | ||
kind: Pod | ||
apiVersion: v1 | ||
metadata: | ||
name: foo-app | ||
labels: | ||
app: foo | ||
spec: | ||
containers: | ||
- name: foo-app | ||
image: higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/http-echo:0.2.3 | ||
args: | ||
- "-text=foo" | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: foo-service | ||
spec: | ||
selector: | ||
app: foo | ||
ports: | ||
# Default port used by the image | ||
- port: 5678 | ||
--- | ||
kind: Pod | ||
apiVersion: v1 | ||
metadata: | ||
name: bar-app | ||
labels: | ||
app: bar | ||
spec: | ||
containers: | ||
- name: bar-app | ||
image: higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/http-echo:0.2.3 | ||
args: | ||
- "-text=bar" | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: bar-service | ||
spec: | ||
selector: | ||
app: bar | ||
ports: | ||
# Default port used by the image | ||
- port: 5678 | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: foo | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- pathType: Prefix | ||
path: "/foo" | ||
backend: | ||
service: | ||
name: foo-service | ||
port: | ||
number: 5678 | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: bar | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- pathType: Prefix | ||
path: "/bar" | ||
backend: | ||
service: | ||
name: bar-service | ||
port: | ||
number: 5678 | ||
--- |
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,32 @@ | ||
# Copyright (c) 2022 Alibaba Group Holding Ltd. | ||
|
||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
|
||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# cluster.conf | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
kubeadmConfigPatches: | ||
- | | ||
kind: InitConfiguration | ||
nodeRegistration: | ||
kubeletExtraArgs: | ||
node-labels: "ingress-ready=true" | ||
extraPortMappings: | ||
- containerPort: 80 | ||
hostPort: 80 | ||
protocol: TCP | ||
- containerPort: 443 | ||
hostPort: 443 | ||
protocol: TCP |
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,29 @@ | ||
# Copyright (c) 2022 Alibaba Group Holding Ltd. | ||
|
||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
|
||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
# Setup default values | ||
CLUSTER_NAME=${CLUSTER_NAME:-"higress"} | ||
METALLB_VERSION=${METALLB_VERSION:-"v0.13.7"} | ||
KIND_NODE_TAG=${KIND_NODE_TAG:-"v1.25.3"} | ||
|
||
## Create kind cluster. | ||
if [[ -z "${KIND_NODE_TAG}" ]]; then | ||
tools/bin/kind create cluster --name "${CLUSTER_NAME}" --config=tools/hack/cluster.conf | ||
else | ||
tools/bin/kind create cluster --image "kindest/node:${KIND_NODE_TAG}" --name "${CLUSTER_NAME}" --config=tools/hack/cluster.conf | ||
fi |
File renamed without changes.
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,56 @@ | ||
# Copyright (c) 2022 Alibaba Group Holding Ltd. | ||
|
||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
|
||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
readonly KIND=${KIND:-tools/bin/kind} | ||
readonly CLUSTER_NAME=${CLUSTER_NAME:-"higress"} | ||
|
||
# Docker variables | ||
readonly IMAGE="$1" | ||
readonly TAG="$2" | ||
|
||
# Wrap sed to deal with GNU and BSD sed flags. | ||
run::sed() { | ||
if sed --version </dev/null 2>&1 | grep -q GNU; then | ||
# GNU sed | ||
sed -i "$@" | ||
else | ||
# assume BSD sed | ||
sed -i '' "$@" | ||
fi | ||
} | ||
|
||
kind::cluster::exists() { | ||
${KIND} get clusters | grep -q "$1" | ||
} | ||
|
||
kind::cluster::load() { | ||
${KIND} load docker-image \ | ||
--name "${CLUSTER_NAME}" \ | ||
"$@" | ||
} | ||
|
||
if ! kind::cluster::exists "$CLUSTER_NAME" ; then | ||
echo "cluster $CLUSTER_NAME does not exist" | ||
exit 2 | ||
fi | ||
|
||
# Push the Higress image to the kind cluster. | ||
echo "Loading image ${IMAGE}:${TAG} to kind cluster ${CLUSTER_NAME}..." | ||
kind::cluster::load "${IMAGE}:${TAG}" |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.