Skip to content

Commit af264e6

Browse files
committed
update code
1 parent 19ff39e commit af264e6

File tree

9 files changed

+20
-13
lines changed

9 files changed

+20
-13
lines changed

internal/adc/client/client.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,13 @@ func (c *Client) Sync(ctx context.Context) (map[string]types.ADCExecutionErrors,
226226
}
227227
}
228228

229+
var err error
229230
if len(failedConfigs) > 0 {
230-
return failedMap, fmt.Errorf("failed to sync %d configs: %s",
231+
err = fmt.Errorf("failed to sync %d configs: %s",
231232
len(failedConfigs),
232233
strings.Join(failedConfigs, ", "))
233234
}
234-
return failedMap, nil
235+
return failedMap, err
235236
}
236237

237238
func (c *Client) sync(ctx context.Context, task Task) error {

internal/adc/translator/translator.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,4 @@ type TranslateResult struct {
4040
GlobalRules adctypes.GlobalRule
4141
PluginMetadata adctypes.PluginMetadata
4242
Consumers []*adctypes.Consumer
43-
ResourceTypes []string
4443
}

internal/provider/api7ee/provider.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import (
4242
pkgutils "github.com/apache/apisix-ingress-controller/pkg/utils"
4343
)
4444

45-
const ProviderType = "api7ee"
45+
const ProviderTypeAPI7EE = "api7ee"
4646

4747
type api7eeProvider struct {
4848
translator *translator.Translator
@@ -63,7 +63,7 @@ func New(updater status.Updater, readier readiness.ReadinessManager, opts ...pro
6363
o := provider.Options{}
6464
o.ApplyOptions(opts)
6565
if o.BackendMode == "" {
66-
o.BackendMode = ProviderType
66+
o.BackendMode = ProviderTypeAPI7EE
6767
}
6868

6969
cli, err := adcclient.New(o.BackendMode)

test/e2e/crds/v1alpha1/gatewayproxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ spec:
207207
keyword string
208208
)
209209

210-
if framework.ProviderType == framework.ProviderTypeAPI7EE {
210+
if framework.ProviderType == framework.ProviderTypeAPISIX {
211211
keyword = fmt.Sprintf(`{"config.ServerAddrs": ["%s"]}`, s.Deployer.GetAdminEndpoint())
212212
} else {
213213
keyword = fmt.Sprintf(`{"config.ServerAddrs": ["http://%s:9180"]}`, s.GetPodIP(s.Namespace(), "app.kubernetes.io/name=apisix"))

test/e2e/crds/v2/status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ spec:
157157

158158
It("dataplane unavailable", func() {
159159
if os.Getenv("PROVIDER_TYPE") != framework.ProviderTypeAPISIXStandalone {
160-
Skip("skip for api7ee mode because it use dashboard admin api")
160+
Skip("only for apisix standalone mode")
161161
}
162162
By("apply ApisixRoute")
163163
applier.MustApplyAPIv2(types.NamespacedName{Namespace: s.Namespace(), Name: "default"}, &apiv2.ApisixRoute{}, ar)

test/e2e/framework/api7_consts.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
package framework
1919

2020
import (
21+
"cmp"
2122
_ "embed"
23+
"os"
2224
)
2325

2426
const (
@@ -39,3 +41,7 @@ const (
3941
const (
4042
ProviderTypeAPI7EE = "api7ee"
4143
)
44+
45+
var (
46+
IngressVersion = cmp.Or(os.Getenv("INGRESS_VERSION"), "v1")
47+
)

test/e2e/framework/apisix_consts.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ import (
2727
)
2828

2929
var (
30-
ProviderTypeAPISIX = "aapisix"
31-
ProviderTypeAPISIXStandalone = "apisix-standalone"
30+
ProviderType = cmp.Or(os.Getenv("PROVIDER_TYPE"), ProviderTypeAPISIXStandalone)
31+
)
3232

33-
ProviderType = cmp.Or(os.Getenv("PROVIDER_TYPE"), ProviderTypeAPISIXStandalone)
34-
IngressVersion = cmp.Or(os.Getenv("INGRESS_VERSION"), "v1")
33+
const (
34+
ProviderTypeAPISIX = "apisix"
35+
ProviderTypeAPISIXStandalone = "apisix-standalone"
3536
)
3637

3738
var (

test/e2e/gatewayapi/status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ spec:
109109

110110
It("dataplane unavailable", func() {
111111
if os.Getenv("PROVIDER_TYPE") != framework.ProviderTypeAPISIXStandalone {
112-
Skip("skip for api7ee mode because it use dashboard admin api")
112+
Skip("only for apisix standalone mode")
113113
}
114114
By("Create HTTPRoute")
115115
err := s.CreateResourceFromString(httproute)

test/e2e/scaffold/apisix_deployer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ func (s *APISIXDeployer) deployDataplane(opts *APISIXDeployOptions) *corev1.Serv
211211

212212
kubectlOpts := k8s.NewKubectlOptions("", "", opts.Namespace)
213213

214-
if framework.ProviderType == "apisix" {
214+
if framework.ProviderType == framework.ProviderTypeAPISIX {
215215
opts.ConfigProvider = "etcd"
216216
// deploy etcd
217217
k8s.KubectlApplyFromString(s.GinkgoT, kubectlOpts, framework.EtcdSpec)

0 commit comments

Comments
 (0)