diff --git a/pkg/controllers/ipaddressallocation/ipaddressallocation_controller.go b/pkg/controllers/ipaddressallocation/ipaddressallocation_controller.go index a9c0a5a73..257e9cbfe 100644 --- a/pkg/controllers/ipaddressallocation/ipaddressallocation_controller.go +++ b/pkg/controllers/ipaddressallocation/ipaddressallocation_controller.go @@ -70,13 +70,13 @@ func updateFail(r *IPAddressAllocationReconciler, c context.Context, o *v1alpha1 func (r *IPAddressAllocationReconciler) setReadyStatusFalse(ctx context.Context, ipaddressallocation *v1alpha1.IPAddressAllocation, transitionTime metav1.Time, err *error) { conditions := []v1alpha1.Condition{ { - Type: v1alpha1.Ready, - Status: v1.ConditionFalse, - Message: "NSX IPAddressAllocation could not be created or updated", - Reason: fmt.Sprintf( + Type: v1alpha1.Ready, + Status: v1.ConditionFalse, + Message: fmt.Sprintf( "error occurred while processing the IPAddressAllocation CR. Error: %v", *err, ), + Reason: "NSX IPAddressAllocation could not be created or updated", LastTransitionTime: transitionTime, }, } diff --git a/pkg/controllers/securitypolicy/securitypolicy_controller.go b/pkg/controllers/securitypolicy/securitypolicy_controller.go index 830dec59d..eaf0af518 100644 --- a/pkg/controllers/securitypolicy/securitypolicy_controller.go +++ b/pkg/controllers/securitypolicy/securitypolicy_controller.go @@ -253,13 +253,13 @@ func (r *SecurityPolicyReconciler) setSecurityPolicyReadyStatusTrue(ctx context. func (r *SecurityPolicyReconciler) setSecurityPolicyReadyStatusFalse(ctx context.Context, secPolicy *v1alpha1.SecurityPolicy, transitionTime metav1.Time, err *error) { newConditions := []v1alpha1.Condition{ { - Type: v1alpha1.Ready, - Status: v1.ConditionFalse, - Message: "NSX Security Policy could not be created/updated", - Reason: fmt.Sprintf( + Type: v1alpha1.Ready, + Status: v1.ConditionFalse, + Message: fmt.Sprintf( "error occurred while processing the SecurityPolicy CR. Error: %v", *err, ), + Reason: "NSX Security Policy could not be created/updated", LastTransitionTime: transitionTime, }, } diff --git a/pkg/controllers/staticroute/staticroute_controller.go b/pkg/controllers/staticroute/staticroute_controller.go index 9e8e1769b..9e09fefa8 100644 --- a/pkg/controllers/staticroute/staticroute_controller.go +++ b/pkg/controllers/staticroute/staticroute_controller.go @@ -134,8 +134,8 @@ func (r *StaticRouteReconciler) setStaticRouteReadyStatusTrue(ctx context.Contex { Type: v1alpha1.Ready, Status: v1.ConditionTrue, - Message: "NSX Static Route has been successfully created/updated", - Reason: "NSX API returned 200 response code for PATCH", + Message: "NSX API returned 200 response code for PATCH", + Reason: "NSX Static Route has been successfully created/updated", LastTransitionTime: transitionTime, }, } @@ -147,8 +147,8 @@ func (r *StaticRouteReconciler) setStaticRouteReadyStatusFalse(ctx context.Conte { Type: v1alpha1.Ready, Status: v1.ConditionFalse, - Message: "NSX Static Route could not be created/updated/deleted", - Reason: fmt.Sprintf("Error occurred while processing the Static Route CR. Please check the config and try again. Error: %v", *err), + Message: fmt.Sprintf("Error occurred while processing the Static Route CR. Please check the config and try again. Error: %v", *err), + Reason: "NSX Static Route could not be created/updated/deleted", LastTransitionTime: transitionTime, }, } diff --git a/pkg/controllers/subnetport/subnetport_controller.go b/pkg/controllers/subnetport/subnetport_controller.go index 1cf28af32..119e2e8ca 100644 --- a/pkg/controllers/subnetport/subnetport_controller.go +++ b/pkg/controllers/subnetport/subnetport_controller.go @@ -112,7 +112,7 @@ func (r *SubnetPortReconciler) Reconcile(ctx context.Context, req ctrl.Request) nsxSubnet, err := r.SubnetService.GetSubnetByPath(nsxSubnetPath) if err != nil { - updateFail(r, ctx, subnetPort, &err) + c(r, ctx, subnetPort, &err) return common.ResultRequeue, err } nsxSubnetPortState, err := r.SubnetPortService.CreateOrUpdateSubnetPort(subnetPort, nsxSubnet, "", labels) @@ -332,13 +332,13 @@ func (r *SubnetPortReconciler) setSubnetPortReadyStatusTrue(ctx context.Context, func (r *SubnetPortReconciler) setSubnetPortReadyStatusFalse(ctx context.Context, subnetPort *v1alpha1.SubnetPort, transitionTime metav1.Time, err *error) { newConditions := []v1alpha1.Condition{ { - Type: v1alpha1.Ready, - Status: v1.ConditionFalse, - Message: "NSX subnet port could not be created/updated", - Reason: fmt.Sprintf( + Type: v1alpha1.Ready, + Status: v1.ConditionFalse, + Message: fmt.Sprintf( "error occurred while processing the SubnetPort CR. Error: %v", *err, ), + Reason: "NSX subnet port could not be created/updated", LastTransitionTime: transitionTime, }, }