Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change VPC CR Conditions #791

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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: "IPAddressAllocationNotReady",
LastTransitionTime: transitionTime,
},
}
Expand All @@ -93,7 +93,7 @@ func (r *IPAddressAllocationReconciler) setReadyStatusTrue(ctx context.Context,
Type: v1alpha1.Ready,
Status: v1.ConditionTrue,
Message: "NSX IPAddressAllocation has been successfully created/updated",
Reason: "",
Reason: "IPAddressAllocationReady",
LastTransitionTime: transitionTime,
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TestIPAddressAllocationController_setReadyStatusTrue(t *testing.T) {
Type: v1alpha1.Ready,
Status: v1.ConditionTrue,
Message: "NSX IPAddressAllocation has been successfully created/updated",
Reason: "",
Reason: "IPAddressAllocationReady",
LastTransitionTime: transitionTime,
},
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/controllers/securitypolicy/securitypolicy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func (r *SecurityPolicyReconciler) setSecurityPolicyReadyStatusTrue(ctx context.
Type: v1alpha1.Ready,
Status: v1.ConditionTrue,
Message: "NSX Security Policy has been successfully created/updated",
Reason: "NSX API returned 200 response code for PATCH",
Reason: "SecurityPolicyReady",
LastTransitionTime: transitionTime,
},
}
Expand All @@ -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,
timdengyun marked this conversation as resolved.
Show resolved Hide resolved
Status: v1.ConditionFalse,
Message: fmt.Sprintf(
"error occurred while processing the SecurityPolicy CR. Error: %v",
*err,
),
Reason: "SecurityPolicyNotReady",
LastTransitionTime: transitionTime,
},
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/controllers/staticroute/staticroute_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ 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",
Reason: "StaticRouteReady",
LastTransitionTime: transitionTime,
},
}
Expand All @@ -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: "StaticRouteNotReady",
LastTransitionTime: transitionTime,
},
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/subnet/subnet_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (r *SubnetReconciler) setSubnetReadyStatusTrue(ctx context.Context, subnet
Type: v1alpha1.Ready,
Status: v1.ConditionTrue,
Message: "NSX Subnet has been successfully created/updated",
Reason: "SubnetCreated",
Reason: "SubnetReady",
LastTransitionTime: transitionTime,
},
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/controllers/subnetport/subnetport_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func (r *SubnetPortReconciler) setSubnetPortReadyStatusTrue(ctx context.Context,
Type: v1alpha1.Ready,
Status: v1.ConditionTrue,
Message: "NSX subnet port has been successfully created/updated",
Reason: "NSX API returned 200 response code for PATCH",
Reason: "SubnetPortReady",
LastTransitionTime: transitionTime,
},
}
Expand All @@ -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: "SubnetPortNotReady",
LastTransitionTime: transitionTime,
},
}
Expand Down
Loading