feature: e2e framework supports testing wasm plugins (#369)

This commit is contained in:
Hinsteny Hisoka
2023-06-08 11:00:30 +08:00
committed by GitHub
parent 2dbe41324a
commit f9ffda288b
10 changed files with 266 additions and 47 deletions

View File

@@ -12,21 +12,12 @@
# 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
#!/usr/bin/env bash
set -euo pipefail
cd ./plugins/wasm-go/
# developer need to declear new wasmplugins here for test
PLUGIN_NAME=http-call make build
PLUGIN_NAME=request-block make build

View File

@@ -20,6 +20,48 @@ set -euo pipefail
CLUSTER_NAME=${CLUSTER_NAME:-"higress"}
METALLB_VERSION=${METALLB_VERSION:-"v0.13.7"}
KIND_NODE_TAG=${KIND_NODE_TAG:-"v1.25.3"}
PROJECT_DIR=$(pwd)
echo ${KIND_NODE_TAG}
echo ${CLUSTER_NAME}
cat <<EOF > "tools/hack/cluster.conf"
# 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
extraMounts:
- hostPath: ${PROJECT_DIR}/plugins
containerPath: /opt/plugins
EOF
## Create kind cluster.
if [[ -z "${KIND_NODE_TAG}" ]]; then