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

[Feat][kubectl-plugin] Add dynamic shell completion for kubectl ray session #2390

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MortalHappiness
Copy link
Contributor

Why are these changes needed?

Implement dynamic shell completion for kubectl ray session command.

Note: I haven't found a proper way to mock the cmd Factory to get custom resources for testing.

Screencast:

2024-09-18.17-35-09.mp4

Related issue number

N/A

Checks

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

@MortalHappiness
Copy link
Contributor Author

@kevin85421 @andrewsykim @chiayi PTAL

@kevin85421
Copy link
Member

The demo video looks good! Is it only for session, or do other commands like get also support it?

@kevin85421 kevin85421 self-assigned this Sep 18, 2024
@MortalHappiness
Copy link
Contributor Author

@kevin85421 Currently only session command.

@andrewsykim
Copy link
Collaborator

@MortalHappiness the autocomplete looks awesome, can't wait to try it!

Currently only session command.

@chiayi can we look into implementing similar autocompletion for kubectl ray logs?

}

// RayJobCompletionFunc Returns a completion function that completes RayJob resource names.
func RayJobCompletionFunc(f cmdutil.Factory) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is RayJobCompletionFunc and RayServiceCompletionFunc still needed? It looks like RayClusterResourceNameCompletionFunc handles resource type already

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.

3 participants