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

ray-operator: disallow pod creation in namespaces outside of RayCluster namespace #1951

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

andrewsykim
Copy link
Contributor

@andrewsykim andrewsykim commented Feb 29, 2024

Why are these changes needed?

Currently it is possible to specify a namespace in the pod template that is different from the namespace of the RayCluster. I haven't found a use-case where this is needed. This PR disallows namespaces for Pods outside the namespace of the RayCluster.

Related issue number

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

@andrewsykim andrewsykim force-pushed the fix-pod-namespace branch 2 times, most recently from ca43795 to d06aafe Compare February 29, 2024 04:29
@andrewsykim andrewsykim changed the title [WIP] ray-operator: disallow pod creation in namespaces outside of RayCluster namespace ray-operator: disallow pod creation in namespaces outside of RayCluster namespace Feb 29, 2024
@vinayakankugoyal
Copy link
Contributor

Do any release notes need to be update?

podTemplate.ObjectMeta.Namespace = instance.Namespace
log.Info("Setting pod namespaces", "namespace", instance.Namespace)
}
podTemplate.ObjectMeta.Namespace = instance.Namespace
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe its better to return an error in this case overriding user values seems wrong?

podTemplate.ObjectMeta.Namespace = instance.Namespace
log.Info("Setting pod namespaces", "namespace", instance.Namespace)
}
podTemplate.ObjectMeta.Namespace = instance.Namespace
Copy link
Contributor

Choose a reason for hiding this comment

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

could you add a comment here explaining why we are overriding the namespace.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, added

@vinayakankugoyal
Copy link
Contributor

The testing section of the PR description needs to be updated. How was this tested?

@andrewsykim
Copy link
Contributor Author

The testing section of the PR description needs to be updated. How was this tested?

I was waiting for feedback from @kevin85421 before writing tests. I've added tests now. Thanks

…r namespace

Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
Copy link
Member

@kevin85421 kevin85421 left a comment

Choose a reason for hiding this comment

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

LGTM. @vinayakankugoyal Do you have any other comments? I will merge this PR after your approval.

@kevin85421 kevin85421 merged commit 281c96d into ray-project:master Feb 29, 2024
23 checks passed
ravishtiwari pushed a commit to ravishtiwari/kuberay that referenced this pull request Mar 3, 2024
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.

None yet

3 participants