Skip to content

Commit 3ace6b7

Browse files
authored
Fix oversized init-container icons in Pod containers table (#17788)
* Initial plan * Fix oversized init container icon in pod containers table * Refine pod init icon regression test assertions --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent f147e0a commit 3ace6b7

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

shell/detail/__tests__/pod.test.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import podDetail from '@shell/detail/pod.vue';
2+
3+
const { containers } = podDetail.computed;
4+
5+
describe('view: pod', () => {
6+
it('should not use 2x icon sizing in init container column', () => {
7+
const initContainer = { name: 'init', image: 'init:latest' };
8+
const appContainer = { name: 'app', image: 'app:latest' };
9+
10+
const rows = containers.call({
11+
allContainers: [appContainer, initContainer],
12+
allStatuses: [{
13+
name: 'app',
14+
ready: true,
15+
state: {},
16+
lastState: {}
17+
}, {
18+
name: 'init',
19+
ready: false,
20+
state: {},
21+
lastState: {}
22+
}],
23+
dateTimeFormat: () => '',
24+
t: () => '',
25+
value: {
26+
containerActions: [],
27+
containerIsInit: (container: { name: string }) => container.name === 'init',
28+
containerStateColor: () => 'text-success',
29+
containerStateDisplay: () => 'running',
30+
openLogs: jest.fn(),
31+
openShell: jest.fn(),
32+
},
33+
});
34+
35+
const initRow = rows.find((row: { name: string }) => row.name === 'init');
36+
const appRow = rows.find((row: { name: string }) => row.name === 'app');
37+
38+
expect(initRow.initIcon).toBe('icon-checkmark text-success ml-5');
39+
expect(appRow.initIcon).toBe('icon-minus text-muted ml-5');
40+
});
41+
});

shell/detail/pod.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export default {
106106
availableActions: this.value.containerActions,
107107
stateObj: status, // Required if there's a description
108108
stateDescription: descriptions.join(' | '), // Required to display the description
109-
initIcon: this.value.containerIsInit(container) ? 'icon-checkmark icon-2x text-success ml-5' : 'icon-minus icon-2x text-muted ml-5',
109+
initIcon: this.value.containerIsInit(container) ? 'icon-checkmark text-success ml-5' : 'icon-minus text-muted ml-5',
110110
111111
// Call openShell here so that opening the shell
112112
// at the container level still has 'this' in scope.

0 commit comments

Comments
 (0)