Skip to content

Commit

Permalink
[bridge] Log nested status shape (and properly scrubbing it)
Browse files Browse the repository at this point in the history
  • Loading branch information
geropl committed Nov 15, 2024
1 parent 42a0e3a commit e4a1756
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions components/ws-manager-bridge/src/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
DescribeClusterRequest,
WorkspaceType,
} from "@gitpod/ws-manager/lib";
import { TrustedValue } from "@gitpod/gitpod-protocol/lib/util/scrubbing";
import { scrubber, TrustedValue } from "@gitpod/gitpod-protocol/lib/util/scrubbing";
import { WorkspaceDB } from "@gitpod/gitpod-db/lib/workspace-db";
import { log, LogContext } from "@gitpod/gitpod-protocol/lib/util/logging";
import { TraceContext } from "@gitpod/gitpod-protocol/lib/util/tracing";
Expand Down Expand Up @@ -193,7 +193,7 @@ export class WorkspaceManagerBridge implements Disposable {
) {
const start = performance.now();
const status = rawStatus.toObject();
log.info("Handling WorkspaceStatus update", filterStatus(status));
log.info("Handling WorkspaceStatus update", { status: new TrustedValue(filterStatus(status)) });

if (!status.spec || !status.metadata || !status.conditions) {
log.warn("Received invalid status update", status);
Expand Down Expand Up @@ -462,11 +462,11 @@ const mapPortProtocol = (protocol: WsManPortProtocol): PortProtocol => {
export const filterStatus = (status: WorkspaceStatus.AsObject): Partial<WorkspaceStatus.AsObject> => {
return {
id: status.id,
metadata: status.metadata,
metadata: scrubber.scrub(status.metadata),
phase: status.phase,
message: status.message,
conditions: new TrustedValue(status.conditions).value,
runtime: new TrustedValue(status.runtime).value,
conditions: status.conditions,
runtime: status.runtime,
};
};

Expand Down

0 comments on commit e4a1756

Please sign in to comment.