frontend: Add environment variables display for containers#4476
frontend: Add environment variables display for containers#4476k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
Conversation
65f730c to
ee11d3c
Compare
2b8c390 to
66a863d
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a comprehensive environment variables display feature for containers in pod details. It displays environment variables from multiple sources (manifest values, Secrets, ConfigMaps, field references, resource field references) with functionality to reveal/hide secret values, copy to clipboard, link to referenced resources, and warn about out-of-sync resources.
Changes:
- Added
ContainerEnvironmentVariablescomponent with proper React hooks patterns - Implemented resource fetching with separate fetcher components
- Added utility function
divideK8sResourcesfor resource field reference calculations - Updated Secret Details to handle base64 encoding correctly
- Added translations for new UI elements
Reviewed changes
Copilot reviewed 119 out of 119 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/components/common/Resource/Resource.tsx | Main implementation: ContainerEnvironmentVariables component, fetcher components, and environment variable processing logic |
| frontend/src/lib/units.ts | Added divideK8sResources function for resource calculations |
| frontend/src/lib/units.test.ts | Comprehensive tests for divideK8sResources |
| frontend/src/components/secret/Details.tsx | Updated to keep data in base64 format |
| frontend/src/i18n/locales/*/translation.json | Added translation for out-of-sync warning |
| frontend/src/plugin/snapshots/pluginLib.snapshot | Updated plugin exports |
| Multiple snapshot files | Updated to reflect UI changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
It looks like the snapshot tests need updating… |
66a863d to
21e3553
Compare
illume
left a comment
There was a problem hiding this comment.
Sorry I missed this before...
I think Resource should be added to the context part of the commit message subject to make it clearer where the change applies to.
frontend: Resource: Add environment variables display for containers
3b1cdf6 to
d9495a6
Compare
454200a to
0410af9
Compare
0410af9 to
6dd2c8e
Compare
6cb02b6 to
b912560
Compare
b912560 to
7d1cff7
Compare
6aae8e8 to
c3554df
Compare
illume
left a comment
There was a problem hiding this comment.
The frontend tests are failing again... could you please try rebasing against main, then updating the snapshot tests?
I think there might be some fixes in the main branch.
c3554df to
66c3bf5
Compare
illume
left a comment
There was a problem hiding this comment.
🎉 thanks!
(Can you please ask for someone else to review this in the headlamp channel on the kubernetes slack?)
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gambtho, illume, joaquimrocha The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |

Summary
Display environment variables per container in pod details with enhanced functionality:
valueFrom(secretKeyRef, configMapKeyRef, fieldRef, resourceFieldRef)envFrom(secretRef, configMapRef)The implementation uses a proper React hooks pattern with separate fetcher components to avoid rules-of-hooks violations.
Based on PR #2728 by @vlasov-y and PR #3167 by @joaquimrocha
Test plan