Skip to content

Commit

Permalink
Fix makeBot labels (#38176)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcbattirola committed Feb 13, 2024
1 parent 4840842 commit 7d3d231
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions web/packages/teleport/src/services/bot/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export function makeBot(bot: ApiBot): FlatBot {
return;
}

const labels = bot?.metadata?.labels
? new Map(Object.entries(bot.metadata.labels))
: new Map<string, string>();

return {
kind: bot?.kind || '',
status: bot?.status || '',
Expand All @@ -83,9 +87,9 @@ export function makeBot(bot: ApiBot): FlatBot {
name: bot?.metadata?.name || '',
namespace: bot?.metadata?.namespace || '',
description: bot?.metadata?.description || '',
labels: bot?.metadata?.labels || new Map<string, string>(),
labels: labels,
revision: bot?.metadata?.revision || '',
type: getBotType(bot?.metadata?.labels),
type: getBotType(labels),

roles: bot?.spec?.roles || [],
traits: bot?.spec?.traits || [],
Expand Down

0 comments on commit 7d3d231

Please sign in to comment.