deps: update K8s dependencies (#1599)

* deps: update K8s dependencies

* deps: bump controller runtime

* chore: tidy

* bump helm and migrate controller runtime

* fix helm deprecation

---------

Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
Co-authored-by: Leonard Cohnen <lc@edgeless.systems>
This commit is contained in:
renovate[bot] 2023-05-24 18:57:45 +02:00 committed by GitHub
parent 81c9c5205c
commit 2afddcb0f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 467 additions and 1773 deletions

View file

@ -22,7 +22,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/predicate"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"sigs.k8s.io/controller-runtime/pkg/source"
updatev1alpha1 "github.com/edgelesssys/constellation/v2/operators/constellation-node-operator/v2/api/v1alpha1"
)
@ -124,7 +123,7 @@ func (r *ScalingGroupReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
For(&updatev1alpha1.ScalingGroup{}).
Watches(
&source.Kind{Type: &updatev1alpha1.NodeVersion{}},
client.Object(&updatev1alpha1.NodeVersion{}),
handler.EnqueueRequestsFromMapFunc(r.findObjectsForNodeVersion),
builder.WithPredicates(predicate.ResourceVersionChangedPredicate{}),
).
@ -132,12 +131,12 @@ func (r *ScalingGroupReconciler) SetupWithManager(mgr ctrl.Manager) error {
}
// findObjectsForNodeVersion requests reconcile calls for every scaling group referencing the node image.
func (r *ScalingGroupReconciler) findObjectsForNodeVersion(nodeVersion client.Object) []reconcile.Request {
func (r *ScalingGroupReconciler) findObjectsForNodeVersion(ctx context.Context, nodeVersion client.Object) []reconcile.Request {
attachedScalingGroups := &updatev1alpha1.ScalingGroupList{}
listOps := &client.ListOptions{
FieldSelector: fields.OneTermEqualSelector(nodeVersionField, nodeVersion.GetName()),
}
if err := r.List(context.TODO(), attachedScalingGroups, listOps); err != nil {
if err := r.List(ctx, attachedScalingGroups, listOps); err != nil {
return []reconcile.Request{}
}