Skip to content

Commit

Permalink
Avoid labeling pods if network policy creation is disabled (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
orishoshan authored Jan 20, 2024
1 parent 06c814a commit 98ef39a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/operator/controllers/pod_reconcilers/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 98ef39a

Please sign in to comment.