File tree Expand file tree Collapse file tree 2 files changed +64
-0
lines changed
Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,45 @@ function setup_kmesh() {
139139 done
140140}
141141
142+ function setup_waypoint() {
143+ cat << EOF | kubectl apply -f -
144+ apiVersion: gateway.networking.k8s.io/v1
145+ kind: Gateway
146+ metadata:
147+ annotations:
148+ sidecar.istio.io/proxyImage: ${KMESH_WAYPOINT_IMAGE}
149+ name: waypoint
150+ namespace: default
151+ spec:
152+ gatewayClassName: istio-waypoint
153+ listeners:
154+ - name: mesh
155+ port: 15008
156+ protocol: HBONE
157+ EOF
158+ POD=$( kubectl get pods -n $NAMESPACE \
159+ --no-headers \
160+ -o custom-columns=NAME:.metadata.name \
161+ | grep ' ^waypoint' \
162+ | head -n1)
163+ if [[ -z $POD ]]; then
164+ echo " No pod found with prefix 'waypoint' in namespace $NAMESPACE " >&2
165+ exit 1
166+ fi
167+ echo " Watching pod $POD until it enters Ready..."
168+ while true ; do
169+ ready=$( kubectl get pod $POD -n $NAMESPACE \
170+ -o jsonpath=' {.status.conditions[?(@.type=="Ready")].status}' )
171+ if [[ " $ready " == " True" ]]; then
172+ echo " ✅ Pod $POD is Ready!"
173+ break
174+ fi
175+ echo " ⏳ Pod $POD is not ready (status: $ready ); sleeping 15s..."
176+ sleep 15
177+ done
178+
179+ }
180+
142181export KIND_REGISTRY_NAME=" kind-registry"
143182export KIND_REGISTRY_PORT=" 5000"
144183export KIND_REGISTRY=" localhost:${KIND_REGISTRY_PORT} "
274313if [[ -z " ${SKIP_BUILD:- } " ]]; then
275314 setup_kind_registry
276315 build_and_push_images
316+ setup_waypoint
277317fi
278318
279319kubectl config use-context " kind-$NAME "
Original file line number Diff line number Diff line change 1+ //go:build integ
2+ // +build integ
3+
4+ /*
5+ * Copyright The Kmesh Authors.
6+ *
7+ * Licensed under the Apache License, Version 2.0 (the "License");
8+ * you may not use this file except in compliance with the License.
9+ * You may obtain a copy of the License at:
10+ *
11+ * http://www.apache.org/licenses/LICENSE-2.0
12+ *
13+ * Unless required by applicable law or agreed to in writing, software
14+ * distributed under the License is distributed on an "AS IS" BASIS,
15+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+ * See the License for the specific language governing permissions and
17+ * limitations under the License.
18+ */
19+
20+ // NOTE: THE CODE IN THIS FILE IS MAINLY REFERENCED FROM ISTIO INTEGRATION
21+ // FRAMEWORK(https://github.com/istio/istio/tree/master/tests/integration)
22+ // AND ADAPTED FOR KMESH.
23+
24+ package kmesh
You can’t perform that action at this time.
0 commit comments