Skip to content

Commit

Permalink
chore: update the function name
Browse files Browse the repository at this point in the history
  • Loading branch information
sanposhiho committed Jul 4, 2024
1 parent deb57ac commit 6aa8352
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions internal/gatewayapi/status/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func UpdateGatewayStatusProgrammedCondition(gw *gwapiv1.Gateway, svc *corev1.Ser
}

// Update the programmed condition.
computeGatewayProgrammedCondition(gw, deployment)
updateGatewayProgrammedCondition(gw, deployment)
}

func SetGatewayListenerStatusCondition(gateway *gwapiv1.Gateway, listenerStatusIdx int,
Expand Down Expand Up @@ -136,9 +136,9 @@ const (
messageFmtProgrammed = "Address assigned to the Gateway, %d/%d envoy Deployment replicas available"
)

// computeGatewayProgrammedCondition computes the Gateway Programmed status condition.
// updateGatewayProgrammedCondition computes the Gateway Programmed status condition.
// Programmed condition surfaces true when the Envoy Deployment status is ready.
func computeGatewayProgrammedCondition(gw *gwapiv1.Gateway, deployment *appsv1.Deployment) {
func updateGatewayProgrammedCondition(gw *gwapiv1.Gateway, deployment *appsv1.Deployment) {
if len(gw.Status.Addresses) == 0 {
gw.Status.Conditions = MergeConditions(gw.Status.Conditions,
newCondition(string(gwapiv1.GatewayConditionProgrammed), metav1.ConditionFalse, string(gwapiv1.GatewayReasonAddressNotAssigned),
Expand Down
4 changes: 2 additions & 2 deletions internal/gatewayapi/status/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func TestUpdateGatewayStatusProgrammedCondition(t *testing.T) {
}
}

func TestGatewayReadyCondition(t *testing.T) {
func TestUpdateGatewayProgrammedCondition(t *testing.T) {
testCases := []struct {
name string
// serviceAddressNum indicates how many addresses are set in the Gateway status.
Expand Down Expand Up @@ -263,7 +263,7 @@ func TestGatewayReadyCondition(t *testing.T) {
}

deployment := &appsv1.Deployment{Status: tc.deploymentStatus}
computeGatewayProgrammedCondition(gtw, deployment)
updateGatewayProgrammedCondition(gtw, deployment)

if d := cmp.Diff(tc.expectCondition, gtw.Status.Conditions, cmpopts.IgnoreFields(metav1.Condition{}, "LastTransitionTime")); d != "" {
t.Errorf("unexpected condition diff: %s", d)
Expand Down

0 comments on commit 6aa8352

Please sign in to comment.