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.
Needs approval from an approver in each of these files:
- ~~[OWNERS](https://github.com/fluid-cloudnative/fluid/blob/master/OWNERS)~~ [cheyang]
Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
Ⅰ. Describe what this PR does
Follow-up of #4171
4171 overrides
pod.Namespace
withreq.Namespace
no matter whatpod.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 ifpod.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