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

solve struct literal uses unkeyed fields #755

Merged
merged 2 commits into from
Aug 30, 2024

Conversation

maoqide
Copy link
Contributor

@maoqide maoqide commented May 30, 2024

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

  • solve complaints of struct literal uses unkeyed fields when go vet.

Which issue(s) this PR fixes:

Fixes # NONE

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE


@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels May 30, 2024
Copy link

linux-foundation-easycla bot commented May 30, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label May 30, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @maoqide!

It looks like this is your first PR to kubernetes-sigs/scheduler-plugins 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/scheduler-plugins has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 30, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @maoqide. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

netlify bot commented May 30, 2024

Deploy Preview for kubernetes-sigs-scheduler-plugins canceled.

Name Link
🔨 Latest commit bbfd0ab
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-scheduler-plugins/deploys/66d02042b2c436000820731d

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 30, 2024
@ffromani
Copy link
Contributor

/ok-to-test

hi, thanks for this contribution! since the project CI passes cleanly so far, which run of go vet highlighted these issues?

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 30, 2024
@maoqide
Copy link
Contributor Author

maoqide commented May 30, 2024

/ok-to-test

hi, thanks for this contribution! since the project CI passes cleanly so far, which run of go vet highlighted these issues?

running go vet ./... under project root directory, output like:

# sigs.k8s.io/scheduler-plugins/pkg/networkaware/networkoverhead
# [sigs.k8s.io/scheduler-plugins/pkg/networkaware/networkoverhead]
pkg/networkaware/networkoverhead/networkoverhead_test.go:289:29: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields
pkg/networkaware/networkoverhead/networkoverhead_test.go:290:29: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields
pkg/networkaware/networkoverhead/networkoverhead_test.go:334:23: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields
pkg/networkaware/networkoverhead/networkoverhead_test.go:334:73: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields
# sigs.k8s.io/scheduler-plugins/pkg/networkaware/topologicalsort
# [sigs.k8s.io/scheduler-plugins/pkg/networkaware/topologicalsort]
pkg/networkaware/topologicalsort/topologicalsort_test.go:108:29: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields
pkg/networkaware/topologicalsort/topologicalsort_test.go:109:29: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields
pkg/networkaware/topologicalsort/topologicalsort_test.go:149:23: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields
pkg/networkaware/topologicalsort/topologicalsort_test.go:149:73: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields
# sigs.k8s.io/scheduler-plugins/test/integration
# [sigs.k8s.io/scheduler-plugins/test/integration]
test/integration/networkoverhead_test.go:185:22: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields
test/integration/networkoverhead_test.go:185:72: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields
test/integration/topologicalsort_test.go:148:22: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields
test/integration/topologicalsort_test.go:148:72: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields
test/integration/topologicalsort_test.go:225:22: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields
test/integration/topologicalsort_test.go:225:72: k8s.io/apimachinery/pkg/apis/meta/v1.Time struct literal uses unkeyed fields

@ffromani
Copy link
Contributor

we should perhaps tighten the CI rules after the necessary cleanups are merged (cc @Huang-Wei for awareness)

could you please sign the CLA @maoqide ? it's a prerequisite to be able to contribute. Thanks!

@maoqide
Copy link
Contributor Author

maoqide commented May 30, 2024

could you please sign the CLA @maoqide ? it's a prerequisite to be able to contribute. Thanks!

OK. Thanks!

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels May 30, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 28, 2024
@@ -286,8 +286,8 @@ func GetAppGroupCROnlineBoutique() *agv1alpha1.AppGroup {
},
},
Status: agv1alpha1.AppGroupStatus{
ScheduleStartTime: metav1.Time{time.Now()},
Copy link
Contributor

Choose a reason for hiding this comment

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

we can simplify this as metav1.Now()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, you're right. I have updated the code.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 29, 2024
@k8s-ci-robot k8s-ci-robot removed the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Aug 29, 2024
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 29, 2024
Copy link
Contributor

@Huang-Wei Huang-Wei left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 30, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Huang-Wei, maoqide

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 30, 2024
@Huang-Wei
Copy link
Contributor

/release-note-none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Aug 30, 2024
@k8s-ci-robot k8s-ci-robot merged commit 0744b26 into kubernetes-sigs:master Aug 30, 2024
9 of 10 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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. 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.

5 participants