Skip to content

Commit

Permalink
Watch for changes to Pods
Browse files Browse the repository at this point in the history
Signed-off-by: MohammedAbdi <[email protected]>
  • Loading branch information
mamy-CS committed Jun 27, 2024
1 parent 65b847b commit d9efbab
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.20
0.0.21
10 changes: 5 additions & 5 deletions bundle/manifests/susql-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ metadata:
]
capabilities: Basic Install
categories: Monitoring
containerImage: quay.io/sustainable_computing_io/susql_operator:0.0.20
createdAt: "2024-06-24T04:37:59Z"
containerImage: quay.io/sustainable_computing_io/susql_operator:0.0.21
createdAt: "2024-06-27T17:23:07Z"
description: 'Aggregates energy data from pods tagged with SusQL labels '
operators.operatorframework.io/builder: operator-sdk-v1.34.1
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
repository: https://github.com/sustainable-computing-io/susql-operator
support: https://github.com/sustainable-computing-io/susql-operator/issues
name: susql-operator.v0.0.20
name: susql-operator.v0.0.21
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -224,7 +224,7 @@ spec:
value: :8081
- name: METRICS-BIND-ADDRESS
value: 127.0.0.1:9999
image: quay.io/sustainable_computing_io/susql_operator:0.0.20
image: quay.io/sustainable_computing_io/susql_operator:0.0.21
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
Expand Down Expand Up @@ -328,4 +328,4 @@ spec:
provider:
name: SusQL Operator Contributors
url: https://github.com/sustainable-computing-io/susql-operator
version: 0.0.20
version: 0.0.21
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: Kustomization
images:
- name: controller
newName: quay.io/sustainable_computing_io/susql_operator
newTag: 0.0.20
newTag: 0.0.21
3 changes: 3 additions & 0 deletions internal/controller/labelgroup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"time"

"github.com/go-logr/logr"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -264,6 +265,8 @@ func (r *LabelGroupReconciler) Reconcile(ctx context.Context, req ctrl.Request)
func (r *LabelGroupReconciler) SetupWithManager(mgr ctrl.Manager) error {
controllerManager := ctrl.NewControllerManagedBy(mgr).
For(&susqlv1.LabelGroup{}).
// Watch for changes to Pods and enqueue requests for LabelGroup owners
Owns(&corev1.Pod{}).
Complete(r)

r.Logger.V(5).Info("[SetupWithManager] Initializing Metrics Exporter.")
Expand Down

0 comments on commit d9efbab

Please sign in to comment.