Skip to content
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

minorfix: carefully handle pod.namespace to avoid side effect #4172

Conversation

TrafalgarZZZ
Copy link
Member

Ⅰ. Describe what this PR does

Follow-up of #4171

#4171 overrides pod.Namespace with req.Namespace no matter what pod.Namespace is. The may have some side effect when mutating a Pod, for example, changing pod.metadata.namespace after mutation. This PR fixes this by checking if pod.Namespace is valid and try to revert it before the handler responds.

Ⅱ. Does this pull request fix one issue?

None

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
Copy link
Collaborator

@cheyang cheyang left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Copy link

fluid-e2e-bot bot commented Jun 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheyang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@fluid-e2e-bot fluid-e2e-bot bot merged commit b33c500 into fluid-cloudnative:master Jun 19, 2024
7 checks passed
cheyang pushed a commit to Ametsuji-akiya/fluid that referenced this pull request Jul 16, 2024
…cloudnative#4172)

* carefully handle pod.namespace

Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>

* carefully handle pod.namespace

Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>

* carefully handle pod.namespace

Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>

---------

Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
Signed-off-by: cheyang <cheyang@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants