Skip to content

Commit a41e36f

Browse files
Merge branch 'main' of github.com:wso2/api-platform into piyumal-main
2 parents 1ffeb40 + d74febf commit a41e36f

11 files changed

Lines changed: 45 additions & 46 deletions

File tree

.github/workflows/operator-integration-test.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,6 @@ jobs:
841841
name: test-gateway
842842
namespace: default
843843
spec:
844-
gatewayClassName: "test"
845844
apiSelector:
846845
scope: Cluster
847846
configRef:
@@ -1296,7 +1295,6 @@ jobs:
12961295
name: scoped-gateway
12971296
namespace: scoped-test
12981297
spec:
1299-
gatewayClassName: "test"
13001298
apiSelector:
13011299
scope: Cluster
13021300
configRef:
@@ -1330,18 +1328,41 @@ jobs:
13301328
kubectl wait --for=condition=Programmed restapi/scoped-api -n scoped-test --timeout=120s
13311329
13321330
echo "Invoking scoped API..."
1331+
1332+
# Wait for the router deployment to be fully ready
1333+
echo "Waiting for scoped gateway router deployment rollout..."
1334+
kubectl rollout status deployment/scoped-gateway-gateway-router -n scoped-test --timeout=120s
1335+
1336+
# Additional wait for Envoy to initialize and start listening
1337+
echo "Waiting for router to be ready to accept connections..."
1338+
sleep 10
1339+
13331340
# Port forward the scoped gateway router
13341341
kubectl port-forward svc/scoped-gateway-gateway-router -n scoped-test 9090:8080 &
13351342
PF_PID=$!
13361343
sleep 5
13371344
1338-
CODE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:9090/scoped/get)
1339-
echo "Scoped API returned: $CODE"
1345+
# Retry logic for API invocation
1346+
MAX_RETRIES=5
1347+
RETRY_DELAY=5
1348+
CODE=""
1349+
for i in $(seq 1 $MAX_RETRIES); do
1350+
echo "Attempt $i of $MAX_RETRIES..."
1351+
CODE=$(curl -s -o /dev/null -w "%{http_code}" --connect-timeout 5 --max-time 10 http://localhost:9090/scoped/get 2>/dev/null || echo "000")
1352+
echo "Scoped API returned: $CODE"
1353+
if [ "$CODE" = "200" ]; then
1354+
break
1355+
fi
1356+
if [ "$i" -lt "$MAX_RETRIES" ]; then
1357+
echo "Retrying in ${RETRY_DELAY}s..."
1358+
sleep $RETRY_DELAY
1359+
fi
1360+
done
13401361
13411362
kill $PF_PID || true
13421363
13431364
if [ "$CODE" != "200" ]; then
1344-
echo "FAILED: Scoped API invocation failed"
1365+
echo "FAILED: Scoped API invocation failed after $MAX_RETRIES attempts"
13451366
exit 1
13461367
fi
13471368

docs/gateway/kubernetes/gateway-operator.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ helm upgrade --install \
3737
### 2. Install Gateway Operator
3838

3939
```sh
40-
helm install my-gateway-operator oci://ghcr.io/wso2/api-platform/helm-charts/gateway-operator --version 0.2.0
40+
helm install my-gateway-operator oci://ghcr.io/wso2/api-platform/helm-charts/gateway-operator --version 0.3.0
4141
```
4242

4343
## Deploying an API Gateway
@@ -154,7 +154,7 @@ curl -X GET "https://raw.githubusercontent.com/wso2/api-platform/refs/heads/main
154154

155155
```sh
156156
cert_path="/tmp/test-backend.crt"
157-
curl -X POST http://localhost:9090/certificates \
157+
curl -X POST http://localhost:9090/certificates -u "admin:admin" \
158158
-H "Content-Type: application/json" \
159159
-d "{\"certificate\":$(jq -Rs . < $cert_path),\"filename\":\"my-cert.pem\", \"name\":\"test\"}"
160160
```
@@ -170,6 +170,7 @@ metadata:
170170
name: gateway-custom-config
171171
data:
172172
values.yaml: |
173+
### IMPORTANT you need to provide entire values yaml of the gateway helm.
173174
gateway:
174175
controller:
175176
logging:

kubernetes/gateway-operator/api/v1alpha1/apigateway_types.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,6 @@ type GatewayInfrastructure struct {
9999

100100
// GatewaySpec defines the desired state of APIGateway
101101
type GatewaySpec struct {
102-
// GatewayClassName is an optional identifier for grouping gateways
103-
// This can be used to categorize gateways (e.g., "production", "development")
104-
// +optional
105-
GatewayClassName string `json:"gatewayClassName,omitempty"`
106-
107102
// APISelector defines how this gateway selects which APIs to route
108103
// +kubebuilder:validation:Required
109104
APISelector APISelector `json:"apiSelector"`

kubernetes/gateway-operator/config/crd/bases/gateway.api-platform.wso2.com_apigateways.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,6 @@ spec:
185185
type: object
186186
x-kubernetes-map-type: atomic
187187
type: object
188-
gatewayClassName:
189-
description: |-
190-
GatewayClassName is an optional identifier for grouping gateways
191-
This can be used to categorize gateways (e.g., "production", "development")
192-
type: string
193188
infrastructure:
194189
description: Infrastructure defines the deployment configuration for
195190
the gateway

kubernetes/gateway-operator/config/samples/api_v1_apigateway.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ kind: APIGateway
66
metadata:
77
name: cluster-gateway
88
spec:
9-
gatewayClassName: "production"
10-
119
apiSelector:
1210
scope: Cluster
1311

@@ -336,7 +334,7 @@ data:
336334
controller:
337335
image:
338336
repository: ghcr.io/wso2/api-platform/gateway-controller
339-
tag: "0.2.0"
337+
tag: "0.3.0"
340338
pullPolicy: Always
341339
imagePullSecrets: []
342340
service:
@@ -467,7 +465,7 @@ data:
467465
router:
468466
image:
469467
repository: ghcr.io/wso2/api-platform/gateway-router
470-
tag: "0.2.0"
468+
tag: "0.3.0"
471469
pullPolicy: Always
472470
imagePullSecrets: []
473471
service:
@@ -524,7 +522,7 @@ data:
524522
policyEngine:
525523
image:
526524
repository: ghcr.io/wso2/api-platform/policy-engine
527-
tag: "0.2.0"
525+
tag: "0.3.0"
528526
pullPolicy: Always
529527
imagePullSecrets: []
530528
service:

kubernetes/gateway-operator/config/samples/gateway-custom-config.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,6 @@ data:
586586
# name: custom-gateway
587587
# namespace: default
588588
# spec:
589-
# gatewayClassName: production
590-
591589
# apiSelector:
592590
# scope: LabelSelector
593591
# matchLabels:
@@ -615,8 +613,6 @@ metadata:
615613
name: default-gateway
616614
namespace: default
617615
spec:
618-
gatewayClassName: development-1
619-
620616
apiSelector:
621617
scope: Cluster
622618

kubernetes/gateway-operator/internal/controller/apigateway_controller.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -885,12 +885,11 @@ func (r *GatewayReconciler) registerGateway(ctx context.Context, gatewayConfig *
885885

886886
// Create gateway info for registry
887887
gatewayInfo := &registry.GatewayInfo{
888-
Name: gatewayConfig.Name,
889-
Namespace: namespace,
890-
GatewayClassName: gatewayConfig.Spec.GatewayClassName,
891-
APISelector: &gatewayConfig.Spec.APISelector,
892-
ServiceName: service.Name,
893-
ServicePort: restPort,
888+
Name: gatewayConfig.Name,
889+
Namespace: namespace,
890+
APISelector: &gatewayConfig.Spec.APISelector,
891+
ServiceName: service.Name,
892+
ServicePort: restPort,
894893
}
895894

896895
if gatewayConfig.Spec.ControlPlane != nil {

kubernetes/gateway-operator/internal/registry/gateway_registry.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
type GatewayInfo struct {
2929
Name string
3030
Namespace string
31-
GatewayClassName string
3231
APISelector *apiv1.APISelector
3332
ServiceName string // Name of the gateway controller service
3433
ServicePort int32 // Port of the gateway controller API

kubernetes/helm/gateway-helm-chart/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ gateway:
312312
controller:
313313
image:
314314
repository: ghcr.io/wso2/api-platform/gateway-controller
315-
tag: "0.2.0"
315+
tag: "0.3.0"
316316
pullPolicy: Always
317317
imagePullSecrets: []
318318
service:
@@ -447,7 +447,7 @@ gateway:
447447
router:
448448
image:
449449
repository: ghcr.io/wso2/api-platform/gateway-router
450-
tag: "0.2.0"
450+
tag: "0.3.0"
451451
pullPolicy: Always
452452
imagePullSecrets: []
453453
service:
@@ -504,7 +504,7 @@ gateway:
504504
policyEngine:
505505
image:
506506
repository: ghcr.io/wso2/api-platform/policy-engine
507-
tag: "0.2.0"
507+
tag: "0.3.0"
508508
pullPolicy: Always
509509
imagePullSecrets: []
510510
service:

kubernetes/helm/operator-helm-chart/crds/gateway.api-platform.wso2.com_apigateways.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,6 @@ spec:
185185
type: object
186186
x-kubernetes-map-type: atomic
187187
type: object
188-
gatewayClassName:
189-
description: |-
190-
GatewayClassName is an optional identifier for grouping gateways
191-
This can be used to categorize gateways (e.g., "production", "development")
192-
type: string
193188
infrastructure:
194189
description: Infrastructure defines the deployment configuration for
195190
the gateway

0 commit comments

Comments
 (0)