Skip to content

Commit

Permalink
feat: add envoy extension policy support for egctl x status (envoypro…
Browse files Browse the repository at this point in the history
…xy#3363)

add envoy extension policy support for egctl x status

Signed-off-by: shawnh2 <shawnhxh@outlook.com>
  • Loading branch information
shawnh2 authored May 9, 2024
1 parent 7863f81 commit 33443f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/cmd/egctl/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions internal/gatewayapi/translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const (
KindBackendTrafficPolicy = "BackendTrafficPolicy"
KindBackendTLSPolicy = "BackendTLSPolicy"
KindEnvoyPatchPolicy = "EnvoyPatchPolicy"
KindEnvoyExtensionPolicy = "EnvoyExtensionPolicy"
KindSecurityPolicy = "SecurityPolicy"
KindEnvoyProxy = "EnvoyProxy"
KindGateway = "Gateway"
Expand Down

0 comments on commit 33443f8

Please sign in to comment.