From f507224789485a154cdb5044969d8799212da03a Mon Sep 17 00:00:00 2001 From: rongxin Date: Thu, 30 Apr 2026 13:20:31 +0800 Subject: [PATCH 1/3] fix: align standalone health check verify field with ADC Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- api/adc/types.go | 20 ++++----- internal/adc/translator/apisixupstream.go | 2 +- .../adc/translator/apisixupstream_test.go | 41 +++++++++++++++++++ 3 files changed, 52 insertions(+), 11 deletions(-) create mode 100644 internal/adc/translator/apisixupstream_test.go diff --git a/api/adc/types.go b/api/adc/types.go index 4a9720fc..1c6d46e4 100644 --- a/api/adc/types.go +++ b/api/adc/types.go @@ -198,16 +198,16 @@ type ClientTLS struct { // UpstreamActiveHealthCheck defines the active upstream health check configuration. // +k8s:deepcopy-gen=true type UpstreamActiveHealthCheck struct { - Type string `json:"type,omitempty" yaml:"type,omitempty"` - Timeout int `json:"timeout,omitempty" yaml:"timeout,omitempty"` - Concurrency int `json:"concurrency,omitempty" yaml:"concurrency,omitempty"` - Host string `json:"host,omitempty" yaml:"host,omitempty"` - Port int32 `json:"port,omitempty" yaml:"port,omitempty"` - HTTPPath string `json:"http_path,omitempty" yaml:"http_path,omitempty"` - HTTPSVerifyCert bool `json:"https_verify_cert,omitempty" yaml:"https_verify_cert,omitempty"` - HTTPRequestHeaders []string `json:"req_headers,omitempty" yaml:"req_headers,omitempty"` - Healthy UpstreamActiveHealthCheckHealthy `json:"healthy,omitempty" yaml:"healthy,omitempty"` - Unhealthy UpstreamActiveHealthCheckUnhealthy `json:"unhealthy,omitempty" yaml:"unhealthy,omitempty"` + Type string `json:"type,omitempty" yaml:"type,omitempty"` + Timeout int `json:"timeout,omitempty" yaml:"timeout,omitempty"` + Concurrency int `json:"concurrency,omitempty" yaml:"concurrency,omitempty"` + Host string `json:"host,omitempty" yaml:"host,omitempty"` + Port int32 `json:"port,omitempty" yaml:"port,omitempty"` + HTTPPath string `json:"http_path,omitempty" yaml:"http_path,omitempty"` + HTTPSVerifyCertificate bool `json:"https_verify_certificate,omitempty" yaml:"https_verify_certificate,omitempty"` + HTTPRequestHeaders []string `json:"req_headers,omitempty" yaml:"req_headers,omitempty"` + Healthy UpstreamActiveHealthCheckHealthy `json:"healthy,omitempty" yaml:"healthy,omitempty"` + Unhealthy UpstreamActiveHealthCheckUnhealthy `json:"unhealthy,omitempty" yaml:"unhealthy,omitempty"` } // UpstreamPassiveHealthCheck defines the passive health check configuration for an upstream. diff --git a/internal/adc/translator/apisixupstream.go b/internal/adc/translator/apisixupstream.go index 33e626fe..db65d855 100644 --- a/internal/adc/translator/apisixupstream.go +++ b/internal/adc/translator/apisixupstream.go @@ -323,7 +323,7 @@ func translateUpstreamActiveHealthCheck(config *apiv2.ActiveHealthCheck) (*adc.U active.HTTPRequestHeaders = config.RequestHeaders if config.StrictTLS == nil || *config.StrictTLS { - active.HTTPSVerifyCert = true + active.HTTPSVerifyCertificate = true } if config.Healthy != nil { diff --git a/internal/adc/translator/apisixupstream_test.go b/internal/adc/translator/apisixupstream_test.go new file mode 100644 index 00000000..ed92dd11 --- /dev/null +++ b/internal/adc/translator/apisixupstream_test.go @@ -0,0 +1,41 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +package translator + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + apiv2 "github.com/apache/apisix-ingress-controller/api/v2" +) + +func TestTranslateUpstreamActiveHealthCheck_HTTPSVerifyCertificate(t *testing.T) { + t.Run("defaults strict tls to enabled", func(t *testing.T) { + active, err := translateUpstreamActiveHealthCheck(&apiv2.ActiveHealthCheck{}) + assert.NoError(t, err) + assert.True(t, active.HTTPSVerifyCertificate) + }) + + t.Run("disables certificate verification when strict tls is false", func(t *testing.T) { + strictTLS := false + active, err := translateUpstreamActiveHealthCheck(&apiv2.ActiveHealthCheck{StrictTLS: &strictTLS}) + assert.NoError(t, err) + assert.False(t, active.HTTPSVerifyCertificate) + }) +} From 4fa090642fb02ca5c71693612b98831618fc13bf Mon Sep 17 00:00:00 2001 From: rongxin Date: Thu, 30 Apr 2026 13:24:22 +0800 Subject: [PATCH 2/3] chore: drop standalone health check translator test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../adc/translator/apisixupstream_test.go | 41 ------------------- 1 file changed, 41 deletions(-) delete mode 100644 internal/adc/translator/apisixupstream_test.go diff --git a/internal/adc/translator/apisixupstream_test.go b/internal/adc/translator/apisixupstream_test.go deleted file mode 100644 index ed92dd11..00000000 --- a/internal/adc/translator/apisixupstream_test.go +++ /dev/null @@ -1,41 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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. - -package translator - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - apiv2 "github.com/apache/apisix-ingress-controller/api/v2" -) - -func TestTranslateUpstreamActiveHealthCheck_HTTPSVerifyCertificate(t *testing.T) { - t.Run("defaults strict tls to enabled", func(t *testing.T) { - active, err := translateUpstreamActiveHealthCheck(&apiv2.ActiveHealthCheck{}) - assert.NoError(t, err) - assert.True(t, active.HTTPSVerifyCertificate) - }) - - t.Run("disables certificate verification when strict tls is false", func(t *testing.T) { - strictTLS := false - active, err := translateUpstreamActiveHealthCheck(&apiv2.ActiveHealthCheck{StrictTLS: &strictTLS}) - assert.NoError(t, err) - assert.False(t, active.HTTPSVerifyCertificate) - }) -} From 7250f049acb891836cf2645cf57bf1c9cea4fe44 Mon Sep 17 00:00:00 2001 From: rongxin Date: Thu, 30 Apr 2026 14:40:28 +0800 Subject: [PATCH 3/3] ci: enable dev ADC in API7EE e2e workflows Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/e2e-test-k8s.yml | 3 +++ .github/workflows/e2e-test.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/e2e-test-k8s.yml b/.github/workflows/e2e-test-k8s.yml index 134d60c6..f1b2cd7f 100644 --- a/.github/workflows/e2e-test-k8s.yml +++ b/.github/workflows/e2e-test-k8s.yml @@ -28,6 +28,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +env: + ADC_VERSION: dev + jobs: e2e-test: strategy: diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 94a7b383..e512d4b6 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -28,6 +28,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +env: + ADC_VERSION: dev + jobs: e2e-test: strategy: