Skip to content

Commit de499ee

Browse files
committed
resolve comments
1 parent 9ed3758 commit de499ee

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

test/conformance/apisix/suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func TestMain(m *testing.M) {
161161
Namespace: namespace,
162162
StatusAddress: address,
163163
InitSyncDelay: 1 * time.Minute,
164-
ProviderType: cmp.Or(os.Getenv(framework.EnvKeyProviderType), "apisix-standalone"),
164+
ProviderType: cmp.Or(framework.ProviderType, "apisix-standalone"),
165165
ProviderSyncPeriod: 10 * time.Millisecond,
166166
})
167167

test/e2e/framework/apisix_consts.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ package framework
1414

1515
import (
1616
_ "embed"
17+
"os"
1718
"text/template"
1819

1920
"github.com/Masterminds/sprig/v3"
2021
)
2122

22-
const (
23-
EnvKeyProviderType = "PROVIDER_TYPE"
23+
var (
24+
ProviderType = os.Getenv("PROVIDER_TYPE")
2425
)
2526

2627
var (

test/e2e/framework/manifests/etcd.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ spec:
3838
- port: 2379
3939
targetPort: 2379
4040
selector:
41-
app: etcd
41+
app: etcd

test/e2e/scaffold/adc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ func (a *adcDataplaneResource) dumpResources(ctx context.Context) (*translator.T
132132
"ADC_SERVER=" + a.serverAddr,
133133
"ADC_TOKEN=" + a.token,
134134
}
135-
if providerType := os.Getenv(framework.EnvKeyProviderType); providerType != "" {
136-
adcEnv = append(adcEnv, "ADC_BACKEND="+providerType)
135+
if framework.ProviderType != "" {
136+
adcEnv = append(adcEnv, "ADC_BACKEND="+framework.ProviderType)
137137
}
138138

139139
var stdout, stderr bytes.Buffer

test/e2e/scaffold/apisix_deployer.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func (s *APISIXDeployer) deployDataplane(opts *APISIXDeployOptions) *corev1.Serv
194194

195195
kubectlOpts := k8s.NewKubectlOptions("", "", opts.Namespace)
196196

197-
if os.Getenv(framework.EnvKeyProviderType) == adc.BackendModeAPISIX {
197+
if framework.ProviderType == adc.BackendModeAPISIX {
198198
opts.ServiceName = "apisix"
199199
opts.ConfigProvider = "etcd"
200200
// deploy etcd
@@ -236,7 +236,7 @@ func (s *APISIXDeployer) deployDataplane(opts *APISIXDeployOptions) *corev1.Serv
236236
func (s *APISIXDeployer) DeployIngress() {
237237
s.Framework.DeployIngress(framework.IngressDeployOpts{
238238
ControllerName: s.opts.ControllerName,
239-
ProviderType: cmp.Or(os.Getenv(framework.EnvKeyProviderType), "apisix-standalone"),
239+
ProviderType: cmp.Or(framework.ProviderType, "apisix-standalone"),
240240
ProviderSyncPeriod: 200 * time.Millisecond,
241241
Namespace: s.namespace,
242242
Replicas: 1,
@@ -246,7 +246,7 @@ func (s *APISIXDeployer) DeployIngress() {
246246
func (s *APISIXDeployer) ScaleIngress(replicas int) {
247247
s.Framework.DeployIngress(framework.IngressDeployOpts{
248248
ControllerName: s.opts.ControllerName,
249-
ProviderType: cmp.Or(os.Getenv(framework.EnvKeyProviderType), "apisix-standalone"),
249+
ProviderType: cmp.Or(framework.ProviderType, "apisix-standalone"),
250250
ProviderSyncPeriod: 200 * time.Millisecond,
251251
Namespace: s.namespace,
252252
Replicas: replicas,

0 commit comments

Comments
 (0)