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

🐛 enqueue secrets created by vcluster in addition to owned secrets #309

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

pdettori
Copy link
Collaborator

@pdettori pdettori commented Jan 20, 2025

Summary

enqueue secrets created by vcluster in addition to owned secrets

Fixes #2717

Signed-off-by: Paolo Dettori <dettori@us.ibm.com>
@MikeSpreitzer
Copy link
Contributor

This seems a bit broader than necessary. Can there be filtering that narrows down the set of Secrets that the KubeFlex controller will react to?

…by the cp

Signed-off-by: Paolo Dettori <dettori@us.ibm.com>
@pdettori pdettori changed the title 🐛 add builder.MatchEveryOwner to Owns for secrets in controller startup 🐛 enqueue secrets created by vcluster in addition to owned secrets Jan 23, 2025
@@ -163,16 +166,38 @@ func (r *ControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl.Request
func (r *ControlPlaneReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
For(&tenancyv1alpha1.ControlPlane{}).
Owns(&corev1.Service{}).
Owns(&networkingv1.Ingress{}).
Owns(&appsv1.Deployment{}).
Owns(&appsv1.StatefulSet{}).
Copy link
Contributor

Choose a reason for hiding this comment

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

Same problem here too, if I understand https://github.com/kubestellar/kubeflex/blob/v0.7.2/pkg/reconcilers/vcluster/reconciler.go#L100 correctly. If the StatefulSet is missing, this controller will note that in the ControlPlane's status and happily be done, without getting notified when the StatefulSet is created later.

Owns(&corev1.ConfigMap{}).
Owns(&corev1.ServiceAccount{}).
Owns(&corev1.Secret{}).
Watches(&corev1.Secret{}, enqueueSecretsOfInterest()).
Complete(r)
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I see that https://github.com/kubestellar/kubeflex/blob/v0.7.2/pkg/reconcilers/vcluster/reconciler.go#L121 is sensitive to the existence of a PostCreateHook. The usual Kubernetes style is to wait for a referenced object to exist when told to use it.

Copy link
Contributor

@MikeSpreitzer MikeSpreitzer left a comment

Choose a reason for hiding this comment

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

LGTM

This is progress. Further issues noted in independent comments here.

@pdettori pdettori merged commit 40017f7 into kubestellar:main Jan 24, 2025
8 checks passed
@pdettori pdettori deleted the issue-2717 branch January 24, 2025 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants