-
Notifications
You must be signed in to change notification settings - Fork 66
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
Move unexport to new subctl implementation #1983
Conversation
🤖 Created branch: z_pr1983/Jaanki/unexport |
pkg/service/unexport.go
Outdated
if k8serrors.IsNotFound(err) { | ||
status.Success("Service %s not found", svcName) | ||
return nil | ||
} |
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 don't think this should be reported as success.
if k8serrors.IsNotFound(err) { | |
status.Success("Service %s not found", svcName) | |
return nil | |
} | |
if k8serrors.IsNotFound(err) { | |
status.Failure("Service %s/%s was not previously exported", namespace, svcName) | |
return err | |
} |
cmd/subctl/root.go
Outdated
@@ -84,3 +84,7 @@ func compareFiles(file1, file2 string) (bool, error) { | |||
|
|||
return bytes.Equal(first, second), nil | |||
} | |||
|
|||
func addNamespaceFlag(cmd *cobra.Command, namespace string) { |
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.
The caller needs to pass the address of namespace
. However I don't it makes sense to generalize the option name and description, ie we lose specific useful information, eg "namespace of the service to be exported" is better than "namespace to use". We could pass the name/description but I don't think it's worth it since this function just wraps one lint of code. Therefore, just inline cmd.Flags().StringVarP(...)
.
Signed-off-by: Janki Chhatbar <[email protected]>
Really weird MD link check error, happed again after re-run:
|
🤖 Closed branches: [z_pr1983/Jaanki/unexport] |
Signed-off-by: Janki Chhatbar [email protected]