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

Fix linting issues reported by golanci-lint #415

Merged
merged 1 commit into from
Mar 10, 2025

Conversation

vishesh92
Copy link
Member

Issue #, if available:

Description of changes:
This PR fixes the following lint issues discovered using golangci-lint:

  1. dot-imports: should not use dot imports
  2. unused-parameter: Remove unused arguments in methods
  3. indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
  4. redefines-builtin-id: redefinition of the built-in function new

Testing performed:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 5, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vishesh92

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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 5, 2025
Copy link

netlify bot commented Mar 5, 2025

Deploy Preview for kubernetes-sigs-cluster-api-cloudstack ready!

Name Link
🔨 Latest commit a5a6e99
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-cloudstack/deploys/67c93abc31c0b40008db9b51
😎 Deploy Preview https://deploy-preview-415--kubernetes-sigs-cluster-api-cloudstack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@codecov-commenter
Copy link

codecov-commenter commented Mar 5, 2025

Codecov Report

Attention: Patch coverage is 60.97561% with 16 lines in your changes missing coverage. Please review.

Project coverage is 26.96%. Comparing base (d597e80) to head (a5a6e99).
Report is 62 commits behind head on main.

Files with missing lines Patch % Lines
pkg/cloud/affinity_groups.go 69.23% 2 Missing and 2 partials ⚠️
api/v1beta1/cloudstackaffinitygroup_conversion.go 0.00% 2 Missing ⚠️
...pi/v1beta1/cloudstackisolatednetwork_conversion.go 0.00% 2 Missing ⚠️
api/v1beta1/cloudstackmachine_conversion.go 0.00% 2 Missing ⚠️
...pi/v1beta1/cloudstackmachinetemplate_conversion.go 0.00% 2 Missing ⚠️
api/v1beta1/conversion.go 0.00% 1 Missing ⚠️
pkg/cloud/cks_cluster.go 0.00% 1 Missing ⚠️
pkg/cloud/isolated_network.go 83.33% 0 Missing and 1 partial ⚠️
pkg/cloud/zone.go 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #415      +/-   ##
==========================================
+ Coverage   25.66%   26.96%   +1.30%     
==========================================
  Files          59       62       +3     
  Lines        5563     5940     +377     
==========================================
+ Hits         1428     1602     +174     
- Misses       3996     4193     +197     
- Partials      139      145       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vishesh92 vishesh92 force-pushed the fixup-linting-issues branch from d4519df to 7af4db6 Compare March 5, 2025 10:04
@vishesh92 vishesh92 marked this pull request as ready for review March 6, 2025 05:00
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 6, 2025
@vishesh92
Copy link
Member Author

/test all

@vishesh92 vishesh92 force-pushed the fixup-linting-issues branch 5 times, most recently from dec80da to 60d1e81 Compare March 6, 2025 05:50
@vishesh92 vishesh92 force-pushed the fixup-linting-issues branch from 60d1e81 to a5a6e99 Compare March 6, 2025 06:03
@vishesh92
Copy link
Member Author

/run-e2e -c 4.19

@blueorangutan
Copy link

@vishesh92 a jenkins job has been kicked to run test with following paramaters:

  • kubernetes version: 1.27.2
  • CloudStack version: 4.19
  • hypervisor: kvm
  • template: ubuntu-2004-kube
  • Kubernetes upgrade from: 1.26.5 to 1.27.2

@blueorangutan
Copy link

Test Results : (tid-522)
Environment: kvm Rocky8(x3), Advanced Networking with Management Server Rocky8
Kubernetes Version: v1.27.2
Kubernetes Version upgrade from: v1.26.5
Kubernetes Version upgrade to: v1.27.2
CloudStack Version: 4.19
Template: ubuntu-2004-kube
E2E Test Run Logs: https://github.com/blueorangutan/capc-prs/releases/download/capc-pr-ci-cd/capc-e2e-artifacts-pr415-sl-522.zip



Summarizing 9 Failures:
 [FAIL] When the specified resource does not exist When starting with a healthy cluster [BeforeEach] Should fail to upgrade control plane machine due to insufficient compute resources
 /root/go/pkg/mod/sigs.k8s.io/cluster-api/test@v1.4.8/framework/cluster_helpers.go:144
 [FAIL] When testing with disk offering [It] Should successfully create a cluster with disk offering
 /root/go/pkg/mod/sigs.k8s.io/cluster-api/test@v1.4.8/framework/cluster_helpers.go:144
 [FAIL] When testing horizontal scale out/in [TC17][TC18][TC20][TC21] [It] Should successfully scale machine replicas up and down horizontally
 /root/go/pkg/mod/sigs.k8s.io/cluster-api/test@v1.4.8/framework/cluster_helpers.go:144
 [FAIL] When testing resource cleanup [It] Should create a new network when the specified network does not exist
 /root/go/pkg/mod/sigs.k8s.io/cluster-api/test@v1.4.8/framework/cluster_helpers.go:144
 [FAIL] When testing project [It] Should create a cluster in a project
 /root/go/pkg/mod/sigs.k8s.io/cluster-api/test@v1.4.8/framework/cluster_helpers.go:144
 [FAIL] When testing app deployment to the workload cluster with slow network [ToxiProxy] [It] Should be able to download an HTML from the app deployed to the workload cluster
 /root/go/pkg/mod/sigs.k8s.io/cluster-api/test@v1.4.8/framework/cluster_helpers.go:144
 [FAIL] When testing affinity group [It] Should have host affinity group when affinity is pro
 /root/go/pkg/mod/sigs.k8s.io/cluster-api/test@v1.4.8/framework/cluster_helpers.go:144
 [FAIL] When testing affinity group [It] Should have host affinity group when affinity is anti
 /root/go/pkg/mod/sigs.k8s.io/cluster-api/test@v1.4.8/framework/cluster_helpers.go:144
 [FAIL] When testing multiple CPs in a shared network with kubevip [It] Should successfully create a cluster with multiple CPs in a shared network
 /root/go/pkg/mod/sigs.k8s.io/cluster-api/test@v1.4.8/framework/cluster_helpers.go:144

Ran 30 of 31 Specs in 9847.444 seconds
FAIL! -- 21 Passed | 9 Failed | 0 Pending | 1 Skipped
--- FAIL: TestE2E (9847.44s)
FAIL

@vishesh92 vishesh92 mentioned this pull request Mar 10, 2025
@kubernetes-sigs kubernetes-sigs deleted a comment from blueorangutan Mar 10, 2025
@kubernetes-sigs kubernetes-sigs deleted a comment from blueorangutan Mar 10, 2025
@vishesh92
Copy link
Member Author

/run-e2e -c 4.19

@blueorangutan
Copy link

@vishesh92 a jenkins job has been kicked to run test with following paramaters:

  • kubernetes version: 1.27.2
  • CloudStack version: 4.19
  • hypervisor: kvm
  • template: ubuntu-2004-kube
  • Kubernetes upgrade from: 1.26.5 to 1.27.2

@weizhouapache
Copy link
Collaborator

thanks @vishesh92

let's run some smoke tests. If test results look good overall, I think we can merge

@kubernetes-sigs kubernetes-sigs deleted a comment from blueorangutan Mar 10, 2025
@blueorangutan
Copy link

Test Results : (tid-530)
Environment: kvm Rocky8(x3), Advanced Networking with Management Server Rocky8
Kubernetes Version: v1.27.2
Kubernetes Version upgrade from: v1.26.5
Kubernetes Version upgrade to: v1.27.2
CloudStack Version: 4.19
Template: ubuntu-2004-kube
E2E Test Run Logs: https://github.com/blueorangutan/capc-prs/releases/download/capc-pr-ci-cd/capc-e2e-artifacts-pr415-sl-530.zip



Summarizing 1 Failure:
 [FAIL] When testing project [AfterEach] Should create a cluster in a project
 /jenkins/workspace/capc-e2e-new/test/e2e/project.go:103

Ran 28 of 31 Specs in 9975.475 seconds
FAIL! -- 27 Passed | 1 Failed | 0 Pending | 3 Skipped
--- FAIL: TestE2E (9975.48s)
FAIL

@vishesh92 vishesh92 added this to the v0.6 milestone Mar 10, 2025
@weizhouapache
Copy link
Collaborator

Test Results : (tid-530) Environment: kvm Rocky8(x3), Advanced Networking with Management Server Rocky8 Kubernetes Version: v1.27.2 Kubernetes Version upgrade from: v1.26.5 Kubernetes Version upgrade to: v1.27.2 CloudStack Version: 4.19 Template: ubuntu-2004-kube E2E Test Run Logs: https://github.com/blueorangutan/capc-prs/releases/download/capc-pr-ci-cd/capc-e2e-artifacts-pr415-sl-530.zip



Summarizing 1 Failure:
 [FAIL] When testing project [AfterEach] Should create a cluster in a project
 /jenkins/workspace/capc-e2e-new/test/e2e/project.go:103

Ran 28 of 31 Specs in 9975.475 seconds
FAIL! -- 27 Passed | 1 Failed | 0 Pending | 3 Skipped
--- FAIL: TestE2E (9975.48s)
FAIL

this did not fail in the previous test , looks like a intermittent failure

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 10, 2025
@k8s-ci-robot k8s-ci-robot merged commit aa3252d into kubernetes-sigs:main Mar 10, 2025
10 checks passed
@vishesh92 vishesh92 deleted the fixup-linting-issues branch March 10, 2025 15:33
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants