Skip to content

Commit

Permalink
🚑 hotfix annotations
Browse files Browse the repository at this point in the history
modified:   controllers/pod_controller.go; modified:   controllers/pod_controller_functions.go
  • Loading branch information
amitai-devops committed Dec 19, 2022
1 parent 74c6bf4 commit 74f3ebd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion controllers/pod_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (r *PodReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.R
return ctrl.Result{}, err
}

if (!r.EnableAnnotation && !ignoreAnnotation) || (r.EnableAnnotation && annotation && !ignoreAnnotation) {
if ((!r.EnableAnnotation) || (r.EnableAnnotation && annotation)) && !ignoreAnnotation {

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

Expand Down
2 changes: 1 addition & 1 deletion controllers/pod_controller_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (r *PodReconciler) NamespaceOrPodHaveIgnoreAnnotation(pod corev1.Pod, ctx c
return false, err
}
namespaceHasIgnoreAnnotation := namespace.Annotations[operatorAnnotation] == "false"
return (namespaceHasIgnoreAnnotation) && (podHasIgnoreAnnotation), nil
return (namespaceHasIgnoreAnnotation) || (podHasIgnoreAnnotation), nil
}

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

0 comments on commit 74f3ebd

Please sign in to comment.