diff --git a/src/operator/controllers/pod_reconcilers/pods.go b/src/operator/controllers/pod_reconcilers/pods.go index 91183d984..523bce4ea 100644 --- a/src/operator/controllers/pod_reconcilers/pods.go +++ b/src/operator/controllers/pod_reconcilers/pods.go @@ -164,6 +164,11 @@ func (p *PodWatcher) updateServerSideCar(ctx context.Context, pod v1.Pod, servic } func (p *PodWatcher) addOtterizePodLabels(ctx context.Context, req ctrl.Request, serviceID serviceidentity.ServiceIdentity, pod v1.Pod) error { + if !viper.GetBool(operatorconfig.EnableNetworkPolicyKey) { + logrus.Debug("Not labeling new pod since network policy creation is disabled") + return nil + } + // Intents were deleted and the pod was updated by the operator, skip reconciliation _, ok := pod.Annotations[otterizev1alpha3.AllIntentsRemovedAnnotation] if ok {