Skip to content

Commit 74f3ebd

Browse files
committed
🚑 hotfix annotations
modified: controllers/pod_controller.go; modified: controllers/pod_controller_functions.go
1 parent 74c6bf4 commit 74f3ebd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

controllers/pod_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (r *PodReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.R
7676
return ctrl.Result{}, err
7777
}
7878

79-
if (!r.EnableAnnotation && !ignoreAnnotation) || (r.EnableAnnotation && annotation && !ignoreAnnotation) {
79+
if ((!r.EnableAnnotation) || (r.EnableAnnotation && annotation)) && !ignoreAnnotation {
8080

8181
data, err := r.ClientSet.RESTClient().Get().AbsPath(fmt.Sprintf("apis/metrics.k8s.io/v1beta1/namespaces/%v/pods/%v", pod.Namespace, pod.Name)).DoRaw(ctx)
8282

controllers/pod_controller_functions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (r *PodReconciler) NamespaceOrPodHaveIgnoreAnnotation(pod corev1.Pod, ctx c
3737
return false, err
3838
}
3939
namespaceHasIgnoreAnnotation := namespace.Annotations[operatorAnnotation] == "false"
40-
return (namespaceHasIgnoreAnnotation) && (podHasIgnoreAnnotation), nil
40+
return (namespaceHasIgnoreAnnotation) || (podHasIgnoreAnnotation), nil
4141
}
4242

4343
func (r *PodReconciler) GetPodMode(pod corev1.Pod, ctx context.Context) string {

0 commit comments

Comments
 (0)