From 33443f8846f105adaa57699fdd90202b5670c3ce Mon Sep 17 00:00:00 2001 From: sh2 Date: Fri, 10 May 2024 04:25:55 +0800 Subject: [PATCH] feat: add envoy extension policy support for egctl x status (#3363) add envoy extension policy support for egctl x status Signed-off-by: shawnh2 --- internal/cmd/egctl/status.go | 10 +++++++++- internal/gatewayapi/translator.go | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/cmd/egctl/status.go b/internal/cmd/egctl/status.go index 80df4237207..ac7886e3f5d 100644 --- a/internal/cmd/egctl/status.go +++ b/internal/cmd/egctl/status.go @@ -34,7 +34,7 @@ var ( supportedXPolicyTypes = []string{ gatewayapi.KindBackendTLSPolicy, gatewayapi.KindBackendTrafficPolicy, gatewayapi.KindClientTrafficPolicy, - gatewayapi.KindSecurityPolicy, gatewayapi.KindEnvoyPatchPolicy, + gatewayapi.KindSecurityPolicy, gatewayapi.KindEnvoyPatchPolicy, gatewayapi.KindEnvoyExtensionPolicy, } supportedAllTypes = []string{ @@ -238,6 +238,14 @@ func runStatus(ctx context.Context, cli client.Client, inputResourceType, namesp resourcesList = &epp resourceKind = gatewayapi.KindEnvoyPatchPolicy + case "eep", "envoyextensionpolicy": + eep := egv1a1.EnvoyExtensionPolicyList{} + if err := cli.List(ctx, &eep, client.InNamespace(namespace)); err != nil { + return err + } + resourcesList = &eep + resourceKind = gatewayapi.KindEnvoyExtensionPolicy + case "sp", "securitypolicy": sp := egv1a1.SecurityPolicyList{} if err := cli.List(ctx, &sp, client.InNamespace(namespace)); err != nil { diff --git a/internal/gatewayapi/translator.go b/internal/gatewayapi/translator.go index d6c5283930f..7b70748e953 100644 --- a/internal/gatewayapi/translator.go +++ b/internal/gatewayapi/translator.go @@ -23,6 +23,7 @@ const ( KindBackendTrafficPolicy = "BackendTrafficPolicy" KindBackendTLSPolicy = "BackendTLSPolicy" KindEnvoyPatchPolicy = "EnvoyPatchPolicy" + KindEnvoyExtensionPolicy = "EnvoyExtensionPolicy" KindSecurityPolicy = "SecurityPolicy" KindEnvoyProxy = "EnvoyProxy" KindGateway = "Gateway"