Skip to content

Commit

Permalink
Merge pull request #44 from snprajwal/fix-lints
Browse files Browse the repository at this point in the history
chore: remove redundant nil checks
  • Loading branch information
rst0git authored Oct 28, 2024
2 parents 0fe2d3f + 556e184 commit 711be9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/controller/checkpointrestoreoperator_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,21 +135,21 @@ func (r *CheckpointRestoreOperatorReconciler) handleSpecificPolicies(log logr.Lo
podPolicies = nil
namespacePolicies = nil

if spec.ContainerPolicies != nil && len(spec.ContainerPolicies) > 0 {
if len(spec.ContainerPolicies) > 0 {
containerPolicies = spec.ContainerPolicies
log.Info("Found and applied container-specific policies", "count", len(containerPolicies))
} else {
log.Info("No container-specific policies found")
}

if spec.PodPolicies != nil && len(spec.PodPolicies) > 0 {
if len(spec.PodPolicies) > 0 {
podPolicies = spec.PodPolicies
log.Info("Found and applied pod-specific policies", "count", len(podPolicies))
} else {
log.Info("No pod-specific policies found")
}

if spec.NamespacePolicies != nil && len(spec.NamespacePolicies) > 0 {
if len(spec.NamespacePolicies) > 0 {
namespacePolicies = spec.NamespacePolicies
log.Info("Found and applied namespace-specific policies", "count", len(namespacePolicies))
} else {
Expand Down

0 comments on commit 711be9c

Please sign in to comment.