Skip to content

Commit 5c0bcb7

Browse files
committed
Handle usage of gitops dashboard
1 parent 5182e6e commit 5c0bcb7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/watch/watcher.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"fmt"
88
"log/slog"
99
"slices"
10+
"strings"
1011
"time"
1112

1213
"google.golang.org/genproto/googleapis/cloud/audit"
@@ -154,6 +155,10 @@ func (w *Watcher) watch(ctx context.Context, types []k8s.ResourceType) error {
154155
resourceName := logEntry.GetResourceName()
155156
email := logEntry.GetAuthenticationInfo().GetPrincipalEmail()
156157

158+
if strings.Contains(email, "ww-gitops-weave-gitops") {
159+
email = fmt.Sprintf("%s@gitops", logEntry.GetAuthenticationInfo().GetAuthoritySelector())
160+
}
161+
157162
resourceRef, err := k8s.ResourceReferenceFromPath(resourceName)
158163
if err != nil {
159164
return err

0 commit comments

Comments
 (0)