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

Add namespace to external etcd ref #9252

Merged
merged 2 commits into from
Feb 17, 2025

Conversation

rahulbabu95
Copy link
Member

Description of changes:
In the etcdadm reconcile loop we make a namespaced lookup for the etcdadm cluster object referenced in the capi cluster. For Cloudstack provider, when we create the capi cluster object we missed referencing the namespace as we do for other providers. This fix adds in the namespace for the external etcd reference.

This was the panic on the etcd controller before the fix:

2025-02-17T19:07:35Z    ERROR   controllers.EtcdadmCluster      Failed to get etcdadm cluster   {"etcdadmcluster": {"name":"rahul-mgmt-cs-etcd"}, "error": "an empty namespace may not be set when a resource name is provided"}
github.com/aws/etcdadm-controller/controllers.(*EtcdadmClusterReconciler).Reconcile
        github.com/aws/etcdadm-controller/controllers/controller.go:127
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile
        sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:119
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
        sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:316
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
        sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:266
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
        sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227

Testing (if applicable):
Built a new etcd controller and verified that the panic went away during the reconciliation.

Documentation added/planned (if applicable):

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

Signed-off-by: EKS Distro PR Bot <[email protected]>
@eks-distro-bot eks-distro-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Feb 17, 2025
Signed-off-by: EKS Distro PR Bot <[email protected]>
@eks-distro-bot eks-distro-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 17, 2025
Copy link

codecov bot commented Feb 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.35%. Comparing base (b90922c) to head (fa49138).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9252   +/-   ##
=======================================
  Coverage   72.35%   72.35%           
=======================================
  Files         587      587           
  Lines       46140    46140           
=======================================
  Hits        33385    33385           
  Misses      11006    11006           
  Partials     1749     1749           

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

@2ez4szliu
Copy link
Member

/lgtm
/approve

@eks-distro-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 2ez4szliu

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

@eks-distro-bot eks-distro-bot merged commit 3c309ea into aws:main Feb 17, 2025
12 checks passed
@rahulbabu95 rahulbabu95 deleted the rel-22/cs-etcd-namespace branch February 18, 2025 07:48
@rahulbabu95
Copy link
Member Author

/cherrypick release-0.21

@eks-distro-pr-bot
Copy link
Contributor

@rahulbabu95: new pull request created: #9261

In response to this:

/cherrypick release-0.21

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/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants