Skip to content

Commit

Permalink
Fix more lint warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Cosmin Cojocar <[email protected]>
  • Loading branch information
ccojocar authored and k8s-ci-robot committed Nov 16, 2023
1 parent c38b1c0 commit 465c3ba
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions internal/pkg/webhooks/recording/recording.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,8 @@ func (p *podSeccompRecorder) setActiveWorkloads(
newActiveWorkloads := profileRecording.Status.ActiveWorkloads
if op == admissionv1.Delete {
newActiveWorkloads = utils.RemoveIfExists(newActiveWorkloads, podName)
} else {
if selector.Matches(podLabels) {
newActiveWorkloads = utils.AppendIfNotExists(newActiveWorkloads, podName)
}
} else if selector.Matches(podLabels) {
newActiveWorkloads = utils.AppendIfNotExists(newActiveWorkloads, podName)
}

profileRecording.Status.ActiveWorkloads = newActiveWorkloads
Expand All @@ -357,11 +355,9 @@ func (p *podSeccompRecorder) setFinalizers(
if controllerutil.ContainsFinalizer(profileRecording, finalizer) {
controllerutil.RemoveFinalizer(profileRecording, finalizer)
}
} else {
if selector.Matches(podLabels) {
if !controllerutil.ContainsFinalizer(profileRecording, finalizer) {
controllerutil.AddFinalizer(profileRecording, finalizer)
}
} else if selector.Matches(podLabels) {
if !controllerutil.ContainsFinalizer(profileRecording, finalizer) {
controllerutil.AddFinalizer(profileRecording, finalizer)
}
}

Expand Down

0 comments on commit 465c3ba

Please sign in to comment.