Skip to content

Commit

Permalink
Merge pull request #540 from timdengyun/remove_dup_sp_generation_from…
Browse files Browse the repository at this point in the history
…_np_conversion

Remove duplicated securitypolicies from networkpolicy conversion
  • Loading branch information
timdengyun committed Apr 7, 2024
2 parents f6cd90c + 08d45ed commit ec9a5e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/controllers/networkpolicy/networkpolicy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ func deleteFail(r *NetworkPolicyReconciler, c *context.Context, o *networkingv1.
}

func updateSuccess(r *NetworkPolicyReconciler, c *context.Context, o *networkingv1.NetworkPolicy) {
r.Recorder.Event(o, v1.EventTypeNormal, common.ReasonSuccessfulUpdate, "NetworkPolicy CR has been successfully updated")
r.Recorder.Event(o, v1.EventTypeNormal, common.ReasonSuccessfulUpdate, "NetworkPolicy has been successfully updated")
metrics.CounterInc(r.Service.NSXConfig, metrics.ControllerUpdateSuccessTotal, MetricResType)
}

func deleteSuccess(r *NetworkPolicyReconciler, _ *context.Context, o *networkingv1.NetworkPolicy) {
r.Recorder.Event(o, v1.EventTypeNormal, common.ReasonSuccessfulDelete, "NetworkPolicy CR has been successfully deleted")
r.Recorder.Event(o, v1.EventTypeNormal, common.ReasonSuccessfulDelete, "NetworkPolicy has been successfully deleted")
metrics.CounterInc(r.Service.NSXConfig, metrics.ControllerDeleteSuccessTotal, MetricResType)
}

Expand Down
1 change: 0 additions & 1 deletion pkg/nsx/services/securitypolicy/firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ func (service *SecurityPolicyService) convertNetworkPolicyToInternalSecurityPoli
spAllow.Spec.Rules = append(spAllow.Spec.Rules, *rule)
}
}
securityPolicies = append(securityPolicies, spAllow, spIsolation)

if len(networkPolicy.Spec.Egress) > 0 {
spIsolation.Spec.Rules = append(spIsolation.Spec.Rules, v1alpha1.SecurityPolicyRule{
Expand Down

0 comments on commit ec9a5e5

Please sign in to comment.