-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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(kubens): added force flag to switch namespaces even if it doesn'… #416
Conversation
635dc0e
to
fdfa71d
Compare
@ahmetb Hi! |
Sorry, I mostly haven't gotten around reviewing it |
@ahmetb hi! kindly remind you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for late review.
README.md
Outdated
Context "test" set. | ||
Active namespace is "not-found-namespace". | ||
--- | ||
$ kubens not-found-namespace --f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double dash is weird to see for single letter flags. Mistake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it's mistake, pushed fix
cmd/kubens/flags.go
Outdated
force := false | ||
|
||
if n == 2 { | ||
force = argv[1] == "--force" || argv[1] == "-f" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think slices.Contains is better here? IMO people should be able to do both:
- kubens foo -f
- kubens -f foo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pushed changes to support both versions
cmd/kubens/flags.go
Outdated
|
||
if n == 2 { | ||
force = argv[1] == "--force" || argv[1] == "-f" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some tests of this file, do you mind editing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@ahmetb hi! is there anything else to do within the PR? |
Merged it but it seems it failed on master due to Go version and slices pkg being new. |
sorry about that, I fixed it here #425. |
Hello!
Added
--force
&&-f
flags tokubens
command to switch namespace even if it doesn't exist.issue: #333
usage example