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

Requeue instead of throwing an error when onwer of kind can't be found #417

Merged

Conversation

vishesh92
Copy link
Member

Issue #, if available:
#299
Description of changes:
This pull request includes improvements to error handling in both the reconciliation process and the affinity group checking function. The most important changes are:

Error handling improvements:

  • controllers/utils/base_reconciler.go: Added a check for a specific error message when getting the owner of a kind and requeue the request with the error message if the owner is not found.
  • test/e2e/common.go: Added error handling when retrieving an affinity group by ID, ensuring that the test fails with a descriptive error message if the retrieval fails.

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 k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 11, 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 11, 2025
Copy link

netlify bot commented Mar 11, 2025

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

Name Link
🔨 Latest commit 5a66366
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-cloudstack/deploys/67d084e8c0bf0b00085c81ff
😎 Deploy Preview https://deploy-preview-417--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 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 25.43%. Comparing base (d597e80) to head (5a66366).
Report is 64 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #417      +/-   ##
==========================================
- Coverage   25.66%   25.43%   -0.24%     
==========================================
  Files          59       67       +8     
  Lines        5563     6498     +935     
==========================================
+ Hits         1428     1653     +225     
- Misses       3996     4697     +701     
- Partials      139      148       +9     

☔ 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.

@blueorangutan
Copy link

Test Results : (tid-534)
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.20
Template: ubuntu-2004-kube
E2E Test Run Logs: https://github.com/blueorangutan/capc-prs/releases/download/capc-pr-ci-cd/capc-e2e-artifacts-pr417-sl-534.zip



Summarizing 6 Failures:
 [FAIL] When testing app deployment to the workload cluster [TC1][PR-Blocking] [It] Should be able to download an HTML from the app deployed to the workload cluster
 /jenkins/workspace/capc-e2e-new/test/e2e/deploy_app.go:105
 [FAIL] When the specified resource does not exist [It] Should fail due to the specified disk offer is not customized but the disk size is specified
 /jenkins/workspace/capc-e2e-new/test/e2e/invalid_resource.go:253
 [FAIL] When the specified resource does not exist [It] Should fail due to the specified disk offer is customized but the disk size is not specified
 /jenkins/workspace/capc-e2e-new/test/e2e/invalid_resource.go:253
 [FAIL] When the specified resource does not exist When starting with a healthy cluster [BeforeEach] Should fail to upgrade worker machine due to insufficient compute resources
 /root/go/pkg/mod/sigs.k8s.io/cluster-api/[email protected]/framework/cluster_helpers.go:144
 [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/[email protected]/framework/cluster_helpers.go:144
 [FAIL] When testing resource cleanup [AfterEach] Should create a new network when the specified network does not exist
 /jenkins/workspace/capc-e2e-new/test/e2e/resource_cleanup.go:101

Ran 28 of 31 Specs in 10027.877 seconds
FAIL! -- 22 Passed | 6 Failed | 0 Pending | 3 Skipped
--- FAIL: TestE2E (10027.88s)
FAIL

Copy link
Contributor

@g-gaston g-gaston left a comment

Choose a reason for hiding this comment

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

Looks good! Maybe we can add a unit test?

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 11, 2025
@kubernetes-sigs kubernetes-sigs deleted a comment from blueorangutan Mar 11, 2025
@kubernetes-sigs kubernetes-sigs deleted a comment from blueorangutan Mar 11, 2025
@kubernetes-sigs kubernetes-sigs deleted a comment from blueorangutan Mar 11, 2025
@blueorangutan
Copy link

Test Results : (tid-540)
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.20
Template: ubuntu-2004-kube
E2E Test Run Logs: https://github.com/blueorangutan/capc-prs/releases/download/capc-pr-ci-cd/capc-e2e-artifacts-pr417-sl-540.zip



Summarizing 6 Failures:
 [FAIL] When testing resource cleanup [AfterEach] Should create a new network when the specified network does not exist
 /jenkins/workspace/capc-e2e-new/test/e2e/resource_cleanup.go:101
 [FAIL] When testing project [AfterEach] Should create a cluster in a project
 /jenkins/workspace/capc-e2e-new/test/e2e/project.go:103
 [FAIL] When testing subdomain [It] Should create a cluster in a subdomain
 /root/go/pkg/mod/sigs.k8s.io/cluster-api/[email protected]/framework/cluster_helpers.go:144
 [FAIL] When testing app deployment to the workload cluster [TC1][PR-Blocking] [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/[email protected]/framework/cluster_helpers.go:144
 [FAIL] When testing machine remediation [It] Should replace a machine when it is destroyed
 /root/go/pkg/mod/sigs.k8s.io/cluster-api/[email protected]/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/[email protected]/framework/cluster_helpers.go:144

Ran 28 of 31 Specs in 8274.431 seconds
FAIL! -- 22 Passed | 6 Failed | 0 Pending | 3 Skipped
--- FAIL: TestE2E (8274.43s)
FAIL

@blueorangutan
Copy link

Test Results : (tid-541)
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.20
Template: ubuntu-2004-kube
E2E Test Run Logs: https://github.com/blueorangutan/capc-prs/releases/download/capc-pr-ci-cd/capc-e2e-artifacts-pr417-sl-541.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 9142.379 seconds
FAIL! -- 27 Passed | 1 Failed | 0 Pending | 3 Skipped
--- FAIL: TestE2E (9142.38s)
FAIL

@weizhouapache
Copy link
Collaborator

/lgtm

good job @vishesh92 !

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 12, 2025
@k8s-ci-robot k8s-ci-robot merged commit d892f42 into kubernetes-sigs:main Mar 12, 2025
9 of 10 checks passed
@vishesh92 vishesh92 deleted the requeue-instead-of-logging-error branch March 12, 2025 08:30
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Requeue instead of logging reconciler errors when owners not set on CloudStackMachine yet
6 participants