Skip to content

chore: fix wasm file cache directory permission #6173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jun 6, 2025

Conversation

zhaohuabing
Copy link
Member

@zhaohuabing zhaohuabing commented May 23, 2025

This PR makes /var/lib/eg writable for any user. This allows the EG process to write Wasm cache into this directory when the UID has been changed by the Pod/Container SecurityContext.

Fixes: #5819 (comment)

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
@zhaohuabing zhaohuabing requested a review from a team as a code owner May 23, 2025 03:00
@zhaohuabing zhaohuabing marked this pull request as draft May 23, 2025 03:00
Copy link

codecov bot commented May 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.48%. Comparing base (82ae1de) to head (8df558d).
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6173   +/-   ##
=======================================
  Coverage   70.47%   70.48%           
=======================================
  Files         220      220           
  Lines       36625    36625           
=======================================
+ Hits        25811    25814    +3     
+ Misses       9284     9283    -1     
+ Partials     1530     1528    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zhaohuabing zhaohuabing marked this pull request as ready for review May 23, 2025 05:40
arkodg
arkodg previously approved these changes May 27, 2025
Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks !

@arkodg arkodg requested review from a team May 27, 2025 23:00
Co-authored-by: Arko Dasgupta <arkodg@users.noreply.github.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
@zhaohuabing
Copy link
Member Author

zhaohuabing commented May 28, 2025

0660/0770 won't work because

  • execution permission is required to create files.
  • other users(65532 or anyone specified in the SeucrityContex) require permissions to create files.
ControllerName:gateway.envoyproxy.io/gatewayclass-controller Conditions:[{Type:Accepted Status:False 
ObservedGeneration:1 LastTransitionTime:2025-05-28 10:30:32 +0000 UTC Reason:Invalid Message:Wasm: mkdir 
/var/lib/eg/wasm/65194423a990667b2db1fab45eb98890f1c47f802752b8a740dde075f966700a: permission denied.}]}]}}

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
@zhaohuabing zhaohuabing requested a review from arkodg May 28, 2025 11:56
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
@zhaohuabing zhaohuabing requested a review from arkodg May 29, 2025 01:51
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
@zhaohuabing zhaohuabing requested a review from arkodg May 29, 2025 04:33
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
@zhaohuabing zhaohuabing force-pushed the fix-cache-permission branch from 9294b4c to a227953 Compare May 30, 2025 02:34

// we don't set the envoy-gateway deployment security context user id back to default because this will
// cause the envoy proxies failed to be deleted after the Gateway resources in the base are deleted.
// This is acceptable because this won't affect the later tests in the same suite.
Copy link
Member Author

@zhaohuabing zhaohuabing Jun 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This happens because the Envoy Gateway may lose the deletion message of Gateways while rollout restart, and the left Envoy proxies cause failure of the upgrade test.

This is an edge case found in this test - should EG proactively delete the Envoy proxies that are orphaned after Gateways are removed?

Manually delete the Envoy proxies after the test.

Related issue: #3051

https://github.com/envoyproxy/gateway/actions/runs/15431221218/job/43429760632?pr=6173

➜  gateway git:(fix-cache-permission) ✗ k -n envoy-gateway-system get pod -w
NAME                                                              READY   STATUS    RESTARTS   AGE
envoy-gateway-79df56475-946vz                                     1/1     Running   0          29s
envoy-gateway-conformance-infra-all-namespaces-302def45-5dj9bxt   1/2     Running   0          42s
envoy-gateway-conformance-infra-same-namespace-9baff503-69cchq4   1/2     Running   0          42s

@zhaohuabing zhaohuabing requested a review from a team June 4, 2025 04:28
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
@zhaohuabing zhaohuabing marked this pull request as draft June 4, 2025 15:36
@zhaohuabing zhaohuabing force-pushed the fix-cache-permission branch from 0d6b97f to 30b36fc Compare June 4, 2025 15:42
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
@zhaohuabing zhaohuabing force-pushed the fix-cache-permission branch from 30b36fc to 73cd33c Compare June 4, 2025 15:49
arkodg
arkodg previously approved these changes Jun 4, 2025
Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for adding the e2e

@zhaohuabing zhaohuabing requested a review from arkodg June 5, 2025 01:43
@zhaohuabing zhaohuabing marked this pull request as ready for review June 5, 2025 01:43
@zhaohuabing zhaohuabing requested a review from a team June 5, 2025 03:00
@zhaohuabing zhaohuabing merged commit fc8f84b into envoyproxy:main Jun 6, 2025
44 of 45 checks passed
@zhaohuabing zhaohuabing deleted the fix-cache-permission branch June 6, 2025 01:26
davem-git pushed a commit to davem-git/gateway that referenced this pull request Jul 8, 2025
* fix wasm file cache directory permission

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants