From 3e0c51ac84f2b3f6663e0a04403f5871b2074f61 Mon Sep 17 00:00:00 2001 From: Amanuel Engeda <74629455+engedaam@users.noreply.github.com> Date: Tue, 12 Nov 2024 15:32:46 -0800 Subject: [PATCH] feat: Add status conition controller for node objects (#1808) --- go.mod | 2 +- go.sum | 4 ++-- pkg/controllers/controllers.go | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 093cc0660f..3891928175 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.23.2 require ( github.com/Pallinder/go-randomdata v1.2.0 github.com/avast/retry-go v3.0.0+incompatible - github.com/awslabs/operatorpkg v0.0.0-20241108183842-a2ebef231d52 + github.com/awslabs/operatorpkg v0.0.0-20241112190830-be645b3ea0ad github.com/docker/docker v27.3.1+incompatible github.com/go-logr/logr v1.4.2 github.com/imdario/mergo v0.3.16 diff --git a/go.sum b/go.sum index 65e60c54b7..b7ea063b91 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/Pallinder/go-randomdata v1.2.0 h1:DZ41wBchNRb/0GfsePLiSwb0PHZmT67XY00 github.com/Pallinder/go-randomdata v1.2.0/go.mod h1:yHmJgulpD2Nfrm0cR9tI/+oAgRqCQQixsA8HyRZfV9Y= github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0= github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= -github.com/awslabs/operatorpkg v0.0.0-20241108183842-a2ebef231d52 h1:k8f1ukVs49+nC6JbN8r8bxs8g1TPE3Iki/dK/LGwf3A= -github.com/awslabs/operatorpkg v0.0.0-20241108183842-a2ebef231d52/go.mod h1:nq1PLBLCojzjfqSK8SG3ymxqwW6e/cHLJvddKOSFkfw= +github.com/awslabs/operatorpkg v0.0.0-20241112190830-be645b3ea0ad h1:40ZsADFFLtStcyh6MQxTi5sFezU7ghdFR0uaGBsVpB4= +github.com/awslabs/operatorpkg v0.0.0-20241112190830-be645b3ea0ad/go.mod h1:qO5OXavA/cGkE7eTT7ruVD54P5vVpL7HoCEl2bnB/r0= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= diff --git a/pkg/controllers/controllers.go b/pkg/controllers/controllers.go index b68daf82aa..217d92dc1e 100644 --- a/pkg/controllers/controllers.go +++ b/pkg/controllers/controllers.go @@ -23,6 +23,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" + corev1 "k8s.io/api/core/v1" + v1 "sigs.k8s.io/karpenter/pkg/apis/v1" "sigs.k8s.io/karpenter/pkg/cloudprovider" "sigs.k8s.io/karpenter/pkg/controllers/disruption" @@ -87,5 +89,6 @@ func NewControllers( nodeclaimdisruption.NewController(clock, kubeClient, cloudProvider), status.NewController[*v1.NodeClaim](kubeClient, mgr.GetEventRecorderFor("karpenter")), status.NewController[*v1.NodePool](kubeClient, mgr.GetEventRecorderFor("karpenter")), + status.NewGenericObjectController[*corev1.Node](kubeClient, mgr.GetEventRecorderFor("karpenter")), } }