Skip to content

Commit

Permalink
chore: remove secret
Browse files Browse the repository at this point in the history
Signed-off-by: Amit Amrutiya <[email protected]>
  • Loading branch information
amitamrutiya committed Jan 8, 2025
1 parent 192f004 commit 693950c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/custom/ResourceDetailFormatters/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ export interface Resource {
annotations?: Array<{ key?: string; value?: string }>;
};
kind?: string;
component?: {
kind?: string;
};
apiVersion?: string;
configuration?: {
spec?: { strategy?: { type?: string } };
Expand Down
10 changes: 5 additions & 5 deletions src/custom/ResourceDetailFormatters/useResourceCleanData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export const useResourceCleanData = () => {
return numberStates;
};

const getAge = (creationTimestamp: string): string => {
const getAge = (creationTimestamp?: string): string | undefined => {
if (!creationTimestamp) return undefined;
const creationTime = moment(creationTimestamp);
const currentTime = moment();
const ageInHours = currentTime.diff(creationTime, 'hours');
Expand Down Expand Up @@ -71,10 +72,9 @@ export const useResourceCleanData = () => {
const parsedStatus = resource?.status?.attribute && JSON.parse(resource?.status?.attribute);
const parsedSpec = resource?.spec?.attribute && JSON.parse(resource?.spec.attribute);
const numberStates = structureNumberStates(parsedStatus, parsedSpec);

const kind = resource?.kind;
const kind = resource?.kind ?? resource?.component?.kind;
const cleanData = {
age: getAge(resource?.metadata?.creationTimestamp || ''),
age: getAge(resource?.metadata?.creationTimestamp),
kind: kind,
status: showStatus && getStatus(parsedStatus),
kubeletVersion: parsedStatus?.nodeInfo?.kubeletVersion,
Expand Down Expand Up @@ -157,7 +157,7 @@ export const useResourceCleanData = () => {
const value = annotation?.value !== undefined ? annotation?.value : '';
return `${annotation?.key}=${value}`;
}),
secret: resource?.data,
// secret: resource?.data, //TODO: show it when we have the role based access control for secrets
initContainers: parsedSpec?.initContainers &&
parsedStatus?.initContainerStatuses && {
spec: parsedSpec?.initContainers,
Expand Down

0 comments on commit 693950c

Please sign in to comment.