Skip to content

Commit b7ed64b

Browse files
committed
fix manually
1 parent 0b87b1a commit b7ed64b

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

internal/provider/adc/adc.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,18 @@ func (d *adcClient) sync(ctx context.Context, task Task) error {
396396
if err != nil {
397397
return err
398398
}
399-
task.Resources.GlobalRules = *globalRules
399+
var globalrule adctypes.GlobalRule
400+
if len(globalRules) > 0 {
401+
merged := make(adctypes.Plugins)
402+
for _, item := range globalRules {
403+
for k, v := range item.Plugins {
404+
merged[k] = v
405+
}
406+
}
407+
globalrule = adctypes.GlobalRule(merged)
408+
}
409+
410+
task.Resources.GlobalRules = globalrule
400411
log.Debugw("syncing resources global rules", zap.Any("globalRules", task.Resources.GlobalRules))
401412

402413
syncFilePath, cleanup, err := prepareSyncFile(task.Resources)

test/e2e/framework/api7_gateway.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ type API7DeployOptions struct {
5959
ServiceType string
6060
ServiceHTTPPort int
6161
ServiceHTTPSPort int
62+
Replicas *int
6263
}
6364

6465
func (f *Framework) DeployGateway(opts API7DeployOptions) *corev1.Service {

test/e2e/framework/manifests/dp.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ metadata:
158158
app.kubernetes.io/name: apisix
159159
name: api7ee3-apisix{{- if .TLSEnabled }}-mtls{{- end }}
160160
spec:
161-
replicas: 1
161+
replicas: {{ default 1 .Replicas }}
162162
selector:
163163
matchLabels:
164164
app.kubernetes.io/instance: api7ee3

test/e2e/scaffold/api7_deployer.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
. "github.com/onsi/gomega" //nolint:staticcheck
2828
corev1 "k8s.io/api/core/v1"
2929
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
30+
"k8s.io/utils/ptr"
3031

3132
"github.com/apache/apisix-ingress-controller/pkg/utils"
3233
"github.com/apache/apisix-ingress-controller/test/e2e/framework"
@@ -160,6 +161,9 @@ func (s *API7Deployer) DeployDataplane(deployOpts DeployDataplaneOptions) {
160161
if deployOpts.ServiceHTTPSPort != 0 {
161162
opts.ServiceHTTPSPort = deployOpts.ServiceHTTPSPort
162163
}
164+
if deployOpts.Replicas != nil {
165+
opts.Replicas = deployOpts.Replicas
166+
}
163167

164168
svc := s.DeployGateway(opts)
165169

@@ -171,6 +175,12 @@ func (s *API7Deployer) DeployDataplane(deployOpts DeployDataplaneOptions) {
171175
}
172176
}
173177

178+
func (s *API7Deployer) ScaleDataplane(replicas int) {
179+
s.DeployDataplane(DeployDataplaneOptions{
180+
Replicas: ptr.To(replicas),
181+
})
182+
}
183+
174184
func (s *API7Deployer) newAPISIXTunnels() error {
175185
serviceName := "api7ee3-apisix-gateway-mtls"
176186
httpTunnel, httpsTunnel, err := s.createDataplaneTunnels(s.dataplaneService, s.kubectlOptions, serviceName)

0 commit comments

Comments
 (0)