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

operator cleanup #3581

Merged
merged 1 commit into from May 29, 2023
Merged

operator cleanup #3581

merged 1 commit into from May 29, 2023

Conversation

yanggangtony
Copy link
Member

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?:

None

@karmada-bot karmada-bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label May 25, 2023
@karmada-bot karmada-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 25, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #3581 (3a28669) into master (218a0b2) will not change coverage.
The diff coverage is n/a.

❗ 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           
Flag Coverage Δ
unittests 55.86% <ø> (ø)

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) {
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

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

type InitOpt func(opt *InitOptions)
.

And the

type DeInitOpt func(opt *DeInitOptions)

Copy link
Member Author

Choose a reason for hiding this comment

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

Rebased..

Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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.

@karmada-bot karmada-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 25, 2023
@@ -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 {
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, its ok

@karmada-bot karmada-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 26, 2023
@calvin0327
Copy link
Contributor

/lgtm

/cc @Poor12 @lonelyCZ

@karmada-bot karmada-bot requested a review from Poor12 May 27, 2023 02:18
@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label May 27, 2023
@yanggangtony
Copy link
Member Author

😂😂
According @Poor12 's opinion.
And these similar question have discussed in #3398.

Using o is more clearer.

So may i changes the options *DeInitOptions to opt *DeInitOptions?

@calvin0327
Copy link
Contributor

😂😂 According @Poor12 's opinion. And these similar question have discussed in #3398.

Using o is more clearer.

So may i changes the options *DeInitOptions to opt *DeInitOptions?

To be consistent with other components, we can use o as the arg name.
options *DeInitOptions -> o *DeInitOptions, I think it's ok.

Signed-off-by: yanggang <gang.yang@daocloud.io>
@karmada-bot karmada-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 28, 2023
@yanggangtony
Copy link
Member Author

rebased.

@Poor12
Copy link
Member

Poor12 commented May 29, 2023

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label May 29, 2023
@karmada-bot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 29, 2023
@karmada-bot karmada-bot merged commit c08d6dc into karmada-io:master May 29, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants