Skip to content

Commit 1efdc39

Browse files
committed
fix: e2e
1 parent ccf6b65 commit 1efdc39

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

.github/workflows/e2e-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,6 @@ jobs:
8080
shell: bash
8181
env:
8282
API7_EE_LICENSE: ${{ secrets.API7_EE_LICENSE }}
83+
TSET_ENV: CI
8384
run: |
8485
make e2e-test

internal/provider/adc/translator/gateway.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,14 @@ func (t *Translator) fillPluginMetadataFromGatewayProxy(pluginMetadata adctypes.
3939
if gatewayProxy == nil {
4040
return
4141
}
42-
for k, v := range gatewayProxy.Spec.PluginMetadata {
43-
pluginMetadata[k] = v
42+
for pluginName, plugin := range gatewayProxy.Spec.PluginMetadata {
43+
var pluginConfig map[string]any
44+
if err := json.Unmarshal(plugin.Raw, &pluginConfig); err != nil {
45+
log.Errorw("gateway proxy plugin_metadata unmarshal failed", zap.Error(err), zap.Any("plugin", pluginName), zap.String("config", string(plugin.Raw)))
46+
continue
47+
}
48+
log.Debugw("fill plugin_metadata for gateway proxy", zap.String("plugin", pluginName), zap.Any("config", pluginConfig))
49+
pluginMetadata[pluginName] = plugin
4450
}
4551
}
4652

test/e2e/gatewayapi/gatewayproxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ spec:
243243
err error
244244
)
245245

246-
It("Should work OK with error_page", func() {
246+
FIt("Should work OK with error_page", func() {
247247
By("Update GatewayProxy with PluginMetadata")
248248
err = s.CreateResourceFromString(gatewayProxyWithPluginMetadata)
249249
Ω(err).ShouldNot(HaveOccurred())

test/e2e/scaffold/scaffold.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -454,14 +454,9 @@ func (s *Scaffold) afterEach() {
454454
if CurrentSpecReport().Failed() {
455455
if os.Getenv("TSET_ENV") == "CI" {
456456
_, _ = fmt.Fprintln(GinkgoWriter, "Dumping namespace contents")
457-
output, _ := k8s.RunKubectlAndGetOutputE(GinkgoT(), s.kubectlOptions, "get", "deploy,sts,svc,pods")
458-
if output != "" {
459-
_, _ = fmt.Fprintln(GinkgoWriter, output)
460-
}
461-
output, _ = k8s.RunKubectlAndGetOutputE(GinkgoT(), s.kubectlOptions, "describe", "pods")
462-
if output != "" {
463-
_, _ = fmt.Fprintln(GinkgoWriter, output)
464-
}
457+
_, _ = k8s.RunKubectlAndGetOutputE(GinkgoT(), s.kubectlOptions, "get", "deploy,sts,svc,pods")
458+
_, _ = k8s.RunKubectlAndGetOutputE(GinkgoT(), s.kubectlOptions, "describe", "pods")
459+
_, _ = k8s.RunKubectlAndGetOutputE(GinkgoT(), s.kubectlOptions, "logs", "-l", "control-plane=controller-manager")
465460
}
466461
}
467462

0 commit comments

Comments
 (0)