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
operator cleanup #3581
operator cleanup #3581
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #3581 +/- ##
=======================================
Coverage 55.86% 55.86%
=======================================
Files 216 216
Lines 20121 20121
=======================================
Hits 11240 11240
Misses 8276 8276
Partials 605 605
Flags with carried forward coverage won't be shown. Click here to find out more. |
@@ -103,12 +103,12 @@ func defaultJobDeInitOptions() *DeInitOptions { | |||
|
|||
// NewDeInitOptWithKarmada returns a DeInitOpt function to initialize DeInitOptions with karmada resource | |||
func NewDeInitOptWithKarmada(karmada *operatorv1alpha1.Karmada) DeInitOpt { | |||
return func(opt *DeInitOptions) { |
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.
thanks for this.
opt
-> options
, Why do you think options
is more suitable, just a bit doubt.
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.
😂😂
Both is good.
But now the same function method , the args is not the same .
one is opt and the other is options.
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'm with you on arg nameoptions
, please update other functions with opt
args. like:
https://github.com/karmada-io/karmada/blob/master/operator/pkg/deinit.go#L39
https://github.com/karmada-io/karmada/blob/master/operator/pkg/init.go#L66
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.
How about also update the
Line 40 in 218a0b2
type InitOpt func(opt *InitOptions) |
And the
karmada/operator/pkg/deinit.go
Line 25 in 218a0b2
type DeInitOpt func(opt *DeInitOptions) |
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.
Rebased..
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.
About options, we have discussed in #3398. Using o
is more clearer.
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.
@Poor12
Thanks for review.
o
is more simple and brevity.
But how to represents the Singular or Plural
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.
Options will always be plural, I think.
operator/pkg/deinit.go
Outdated
@@ -84,13 +84,13 @@ func (data *deInitData) RemoteClient() clientset.Interface { | |||
|
|||
// NewJobDeInitOptions calls all of DeInitOpt func to initialize a DeInitOptions. | |||
// if there is not DeInitOpt functions, it will return a default DeInitOptions. | |||
func NewJobDeInitOptions(opts ...DeInitOpt) *DeInitOptions { | |||
options := defaultJobDeInitOptions() | |||
func NewJobDeInitOptions(options ...DeInitOpt) *DeInitOptions { |
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.
DeInitOpt is different with DeInitOptions, I think opts
is more appropriate here.
What do you think?
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, its ok
To be consistent with other components, we can use |
Signed-off-by: yanggang <gang.yang@daocloud.io>
rebased. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Poor12 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Do some operator cleanup.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: