From 2d4ed4b4b2e66d9a1407a26cd5765ed8f2ee1403 Mon Sep 17 00:00:00 2001 From: Anton Foltz Date: Wed, 27 Nov 2024 10:34:51 -0600 Subject: [PATCH] I have read the CLA Document and I hereby sign the CLA --- cmd/list-function-apps.go | 22 ++++++++++++++-------- cmd/list-web-apps.go | 22 ++++++++++++++-------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/cmd/list-function-apps.go b/cmd/list-function-apps.go index a055412..ff2cd88 100644 --- a/cmd/list-function-apps.go +++ b/cmd/list-function-apps.go @@ -22,6 +22,7 @@ import ( "fmt" "os" "os/signal" + "strings" "sync" "time" @@ -102,14 +103,19 @@ func listFunctionApps(ctx context.Context, client client.AzureClient, subscripti ResourceGroupName: item.Ok.ResourceGroupName(), TenantId: client.TenantInfo().TenantId, } - if functionApp.Kind == "functionapp" { - log.V(2).Info("found function app", "functionApp", functionApp) - count++ - if ok := pipeline.SendAny(ctx.Done(), out, AzureWrapper{ - Kind: enums.KindAZFunctionApp, - Data: functionApp, - }); !ok { - return + kinds := strings.Split(functionApp.Kind, ",") + for _, kind := range kinds { + kind = strings.TrimSpace(kind) + if strings.EqualFold(kind, "functionapp") { + log.V(2).Info("found function app", "functionApp", functionApp) + count++ + if ok := pipeline.SendAny(ctx.Done(), out, AzureWrapper{ + Kind: enums.KindAZFunctionApp, + Data: functionApp, + }); !ok { + return + } + break } } } diff --git a/cmd/list-web-apps.go b/cmd/list-web-apps.go index dd8a845..372ed84 100644 --- a/cmd/list-web-apps.go +++ b/cmd/list-web-apps.go @@ -22,6 +22,7 @@ import ( "fmt" "os" "os/signal" + "strings" "sync" "time" @@ -107,14 +108,19 @@ func listWebApps(ctx context.Context, client client.AzureClient, subscriptions < ResourceGroupName: item.Ok.ResourceGroupName(), TenantId: client.TenantInfo().TenantId, } - if webApp.Kind == "app" { - log.V(2).Info("found web app", "webApp", webApp) - count++ - if ok := pipeline.SendAny(ctx.Done(), out, AzureWrapper{ - Kind: enums.KindAZWebApp, - Data: webApp, - }); !ok { - return + kinds := strings.Split(webApp.Kind, ",") + for _, kind := range kinds { + kind = strings.TrimSpace(kind) + if strings.EqualFold(kind, "app") { + log.V(2).Info("found web app", "webApp", webApp) + count++ + if ok := pipeline.SendAny(ctx.Done(), out, AzureWrapper{ + Kind: enums.KindAZWebApp, + Data: webApp, + }); !ok { + return + } + break } } }