feat(harbor): inject mobile-responsive CSS via nginx sub_filter #351
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/pal-e-platform!351
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "345-harbor-mobile-css"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Changes
terraform/modules/harbor/main.tf-- Addedkubernetes_config_map_v1.harbor_mobile_css(holds the CSS file),null_resource.harbor_portal_mobile_patch(patches portal ConfigMap with sub_filter directives and deployment with volume mount), andlocalsblock defining the patched nginx.conf and JSON patch payloadterraform/modules/harbor/files/mobile.css-- Mobile-first responsive CSS targeting Harbor's Clarity/Ant Design class names: collapsible nav sidebar, scrollable tables, stacked forms, flexible modals, wrapped action barsTest Plan
tofu validatepasses (confirmed)tofu apply -target=module.harboron archboxkubectl describe pod -n harbor -l component=portal)/custom/mobile.cssis served:curl -s https://harbor.<domain>/custom/mobile.csscurl -s https://harbor.<domain>/ | grep mobile.cssReview Checklist
tofu fmtappliedtofu validatepassesRelated Notes
ldraney/pal-e-platform #345-- Harbor mobile-responsive CSS via nginx sub_filter injectionCloses #345
QA Review -- PR #351
Findings
Two issues identified and fixed in commit
58c1f41:Invalid
proxy_set_headerin non-proxy context -- The portal nginx serves static files directly, not viaproxy_pass. Theproxy_set_header Accept-Encoding ""directive is only meaningful in proxy contexts. For locally-served static files, nginx'ssub_filtermodule runs before gzip in the output filter chain, so no decompression workaround is needed. Removed the directive and added a clarifying comment.Non-idempotent deployment patch -- The JSON patch used
"op": "add"with path/-(append), which would create duplicate volume and volumeMount entries if thenull_resourcetriggered again (e.g., CSS content change). Replaced with an idempotent script that checks for existingmobile-cssvolume and mount before appending.Verified
tofu fmt-- no changes neededtofu validate-- passesterraform/modules/harbor/main.tfandterraform/modules/harbor/files/mobile.css)$$escaping correct for HCL heredocs (produces$urifor nginx,$TMPDIR/$NGINX_CONF_JSONfor shell)@media (min-width: 600px)desktop restoreVERDICT: APPROVE
Pull request closed