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

fix: capture commands should respect --namespace #568

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

Conversation

rbtr
Copy link
Collaborator

@rbtr rbtr commented Jul 26, 2024

Description

Fix capture subcommands to respect the cli-runtime --namespace CLI flag.

Related Issue

Closes #477

Checklist

  • I have read the contributing documentation.
  • I signed and signed-off the commits (git commit -S -s ...). See this documentation on signing commits.
  • I have correctly attributed the author(s) of the code.
  • I have tested the changes locally.
  • I have followed the project's style guidelines.
  • I have updated the documentation, if necessary.
  • I have added tests, if applicable.

Please refer to the CONTRIBUTING.md file for more information on how to contribute to this project.

@rbtr rbtr added lang/go The Go Programming Language type/fix Fixes something area/captures scope/S Change is Small labels Jul 26, 2024
@rbtr rbtr added this to the 1.0 milestone Jul 26, 2024
@rbtr rbtr self-assigned this Jul 26, 2024
@@ -9,7 +9,10 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
)

var name string
var opts = struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can borrow what kubectl cli has been achieved here? Like https://github.com/kubernetes/kubectl/blob/master/pkg/cmd/create/create_cronjob.go

Copy link
Contributor

Choose a reason for hiding this comment

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

^^ it's for this change, we can improve later.
Thanks for fixing missing namespace flag.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's the direction I am moving with this change, but it is just the first small step

@rbtr rbtr marked this pull request as ready for review August 5, 2024 16:51
@rbtr rbtr requested a review from a team as a code owner August 5, 2024 16:51
@rbtr rbtr requested review from mainred and jimassa August 5, 2024 16:51
Comment on lines +25 to +26
opts.AddFlags(capture.PersistentFlags())
capture.PersistentFlags().StringVar(opts.Name, "name", "", "The name of the Retina Capture")
Copy link
Member

Choose a reason for hiding this comment

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

I know it's a small thing here, but this might be better as a method of opts. You can inject whatever the value of capture.PersistentFlags() is and let opts add Flags to it. It'd make it a little more modular by letting the opts say "I know what my flags should be".

Not a blocker, but just an idea.

Copy link

github-actions bot commented Sep 7, 2024

This PR will be closed in 7 days due to inactivity.

@github-actions github-actions bot added the meta/waiting-for-author Blocked and waiting on the author label Sep 7, 2024
@nddq nddq removed the meta/waiting-for-author Blocked and waiting on the author label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/captures lang/go The Go Programming Language scope/S Change is Small type/fix Fixes something
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

Flag not working: --namespace Flag doesn't work with Retina Capture Create
4 participants