From e1bbd229adccf8248a6d25cfc651d6b0c7191d1f Mon Sep 17 00:00:00 2001 From: Peter Colledge Date: Thu, 4 Jan 2024 08:25:32 +0000 Subject: [PATCH] cleanup: Tidy boilerplate ToDos --- config/manager/manager.yaml | 35 ++++++++++++-------------------- controllers/onload_controller.go | 6 +----- 2 files changed, 14 insertions(+), 27 deletions(-) diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 6c34b2e..1ca85f4 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -38,26 +38,19 @@ spec: labels: control-plane: controller-manager spec: - # TODO(user): Uncomment the following code to configure the nodeAffinity expression - # according to the platforms which are supported by your solution. - # It is considered best practice to support multiple architectures. You can - # build your manager image using the makefile target docker-buildx. - # affinity: - # nodeAffinity: - # requiredDuringSchedulingIgnoredDuringExecution: - # nodeSelectorTerms: - # - matchExpressions: - # - key: kubernetes.io/arch - # operator: In - # values: - # - amd64 - # - arm64 - # - ppc64le - # - s390x - # - key: kubernetes.io/os - # operator: In - # values: - # - linux + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/arch + operator: In + values: + - amd64 + - key: kubernetes.io/os + operator: In + values: + - linux securityContext: runAsNonRoot: true # TODO(user): For common cases that do not require escalating privileges @@ -94,8 +87,6 @@ spec: port: 8081 initialDelaySeconds: 5 periodSeconds: 10 - # TODO(user): Configure the resources accordingly based on the project requirements. - # More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ resources: limits: cpu: 500m diff --git a/controllers/onload_controller.go b/controllers/onload_controller.go index f475912..5365c3a 100644 --- a/controllers/onload_controller.go +++ b/controllers/onload_controller.go @@ -53,10 +53,6 @@ type OnloadReconciler struct { // Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the Onload object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. // // For more details, check Reconcile and its Result here: // - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile @@ -1190,7 +1186,7 @@ func (r *OnloadReconciler) nodeLabelWatchFunc(ctx context.Context, obj client.Ob return requests } - // TODO: Check labels here to only requeue relevant onloads. + // TODO(ON-15506): Check labels here to only requeue relevant onloads. for _, onload := range onloadList.Items { request := reconcile.Request{NamespacedName: types.NamespacedName{Name: onload.Name, Namespace: onload.Namespace}}