Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
ba91ae8
feat: validate APISIX resources in webhooks
AlinsRan Apr 27, 2026
0b74a9c
fix: use validate API in webhook checks
AlinsRan Apr 27, 2026
10d76b4
fix(e2e): add skip guards and redesign ADC validation tests
AlinsRan Apr 27, 2026
d9ba66c
fix: export kind kubeconfig in v2 e2e
AlinsRan Apr 27, 2026
07b7c4d
fix: recreate kind cluster for v2 e2e
AlinsRan Apr 27, 2026
73f3836
fix: wait for kind apiserver readiness
AlinsRan Apr 27, 2026
23fb4e7
fix: use internal kind kubeconfig in CI
AlinsRan Apr 27, 2026
7663b68
fix: support old kind kubeconfig setup
AlinsRan Apr 27, 2026
8859187
fix: harden e2e environment setup
AlinsRan Apr 27, 2026
742f11b
fix: use mirrored images in self-hosted e2e
AlinsRan Apr 27, 2026
9b1533e
fix: proxy docker hub pulls in self-hosted e2e
AlinsRan Apr 27, 2026
24f141d
fix: build local echo server image for e2e
AlinsRan Apr 27, 2026
ec74a51
fix: proxy remaining docker hub images
AlinsRan Apr 27, 2026
e90710e
fix: defer dashboard readiness checks in e2e
AlinsRan Apr 27, 2026
d401305
fix: wait for postgres readiness in v2 e2e
AlinsRan Apr 27, 2026
6618932
fix: stabilize postgres startup in v2 e2e
AlinsRan Apr 27, 2026
4141447
fix: avoid flaky docker login action downloads
AlinsRan Apr 27, 2026
d1a32ed
fix: scope postgres mirror to v2 CI
AlinsRan Apr 27, 2026
a58fd8c
fix: stabilize webhook CI coverage
AlinsRan Apr 27, 2026
f032228
fix: retry v2 postgres image preload
AlinsRan Apr 27, 2026
4dee995
fix: use legacy postgres image in v2 CI
AlinsRan Apr 27, 2026
eef1a88
test: stabilize standalone apisixconsumer webhook e2e
AlinsRan Apr 27, 2026
9a29eb2
fix: stabilize adc e2e retries
AlinsRan Apr 27, 2026
9efafc9
test: stabilize corrected consumer webhook e2e
AlinsRan Apr 27, 2026
badcb29
ci: fix misspell workflow install
AlinsRan Apr 27, 2026
f9905c1
Merge branch 'master' into feat/webhook-adc-validation
AlinsRan May 6, 2026
65b8f1d
revert: remove unnecessary CI/CD changes unrelated to webhook validation
May 6, 2026
5f3e401
test(e2e): fix TLS test retry with RequestAssert
May 6, 2026
0db12c2
fix: restore warn behavior for ApisixTls with missing secrets
May 6, 2026
4789243
fix: address PR review comments
AlinsRan May 6, 2026
b35e0f9
fix: populate global_rules and plugin_metadata in ADC validate payload
AlinsRan May 6, 2026
58ce2fb
fix: use consumerGatewayRef field index in validateDuplicateKeyAuthCr…
AlinsRan May 6, 2026
70b6a7c
fix: skip duplicate key-auth check for malformed credential JSON
AlinsRan May 6, 2026
a0b54cd
Merge remote-tracking branch 'origin/master' into feat/webhook-adc-va…
AlinsRan May 6, 2026
4ffeb5e
test(e2e): fix and expand ADC validation webhook tests
AlinsRan May 6, 2026
4c1ec6b
fix: resolve lint issues in webhook e2e tests and consumer webhook
AlinsRan May 6, 2026
f4047f6
fix(e2e): fix UPDATE path webhook tests
AlinsRan May 6, 2026
3d240f1
chore: remove unrelated framework changes from webhook validation PR
AlinsRan May 6, 2026
bf5fed5
test: remove apisix-standalone-only skip in ADC validation e2e tests
AlinsRan May 7, 2026
70137d0
fix: remove unused framework import in webhook e2e tests
AlinsRan May 7, 2026
d95462e
refactor: use ADC server /validate endpoint for all backends
AlinsRan May 7, 2026
134e77e
fix: use PUT method for ADC server /validate endpoint
AlinsRan May 7, 2026
a003a3e
test: use spec.plugins for Consumer ADC validation e2e tests
AlinsRan May 7, 2026
ce3ecb4
chore: migrate image registry from hkccr to ghcr.io
AlinsRan May 7, 2026
9d8ecb6
chore: remove legacy registry login and add packages:read permission
AlinsRan May 7, 2026
138d2d4
chore: retrigger CI
AlinsRan May 7, 2026
cfce22b
Update conformance-test.yml
AlinsRan May 7, 2026
65c6747
chore: add pull-requests write permission for add-pr-comment action
AlinsRan May 7, 2026
c3e4ec4
Merge branch 'feat/migrate-registry-to-ghcr' into feat/webhook-adc-va…
AlinsRan May 7, 2026
3bf9e3f
fix: remove duplicate failurePolicy in webhook markers; fix ApisixCon…
AlinsRan May 7, 2026
f5363b0
fix: restore len(warnings) > 0 guard in ApisixConsumer webhook
AlinsRan May 8, 2026
6b88e29
refactor: add explicit log when skipping ADC due to initErr in Apisix…
AlinsRan May 8, 2026
878ee57
Merge remote-tracking branch 'origin/master' into feat/webhook-adc-va…
AlinsRan May 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions .github/workflows/e2e-test-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,22 @@ jobs:
env:
KIND_NODE_IMAGE: kindest/node:v1.18.15
run: |
make kind-down
make kind-up
KIND_NODE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' apisix-ingress-cluster-control-plane)
echo $KIND_NODE_IP

kubectl config get-clusters
kubectl config set-cluster kind-apisix-ingress-cluster --server=https://$KIND_NODE_IP:6443
kubectl wait --for=condition=Ready nodes --all
mkdir -p "${HOME}/.kube"
kind get kubeconfig --name apisix-ingress-cluster --internal > "${HOME}/.kube/config"
kubectl config use-context kind-apisix-ingress-cluster
for attempt in {1..30}; do
if kubectl cluster-info >/dev/null 2>&1; then
break
fi
if [ "${attempt}" -eq 30 ]; then
echo "kind apiserver did not become reachable in time" >&2
exit 1
fi
sleep 2
done
kubectl wait --for=condition=Ready nodes --all --timeout=120s

- name: Build images
env:
Expand Down
37 changes: 37 additions & 0 deletions internal/adc/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,43 @@ func (c *Client) DeleteConfig(ctx context.Context, args Task) error {
return err
}

func (c *Client) Validate(ctx context.Context, task Task) error {
if len(task.Configs) == 0 || task.Resources == nil {
return nil
}

fileIOStart := time.Now()
syncFilePath, cleanup, err := prepareSyncFile(task.Resources)
if err != nil {
pkgmetrics.RecordFileIODuration("prepare_sync_file", "failure", time.Since(fileIOStart).Seconds())
return err
}
pkgmetrics.RecordFileIODuration("prepare_sync_file", adctypes.StatusSuccess, time.Since(fileIOStart).Seconds())
defer cleanup()

args := BuildADCExecuteArgs(syncFilePath, task.Labels, task.ResourceTypes)

var errs types.ADCValidationErrors
for _, config := range task.Configs {
if config.BackendType == "" {
config.BackendType = c.defaultMode
}
if err := c.executor.Validate(ctx, config, args); err != nil {
var validationErr types.ADCValidationError
if errors.As(err, &validationErr) {
errs.Errors = append(errs.Errors, validationErr)
Comment thread
AlinsRan marked this conversation as resolved.
continue
}
return err
}
Comment thread
AlinsRan marked this conversation as resolved.
}

if len(errs.Errors) > 0 {
return errs
}
return nil
}

func (c *Client) Sync(ctx context.Context) (map[string]types.ADCExecutionErrors, error) {
c.syncMu.Lock()
defer c.syncMu.Unlock()
Expand Down
Loading
Loading