Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
sawsa307 committed Mar 1, 2023
1 parent 8da6eb2 commit 31b8430
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pkg/neg/syncers/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func (s *transactionSyncer) ensureNetworkEndpointGroups() error {
// It returns false and the corresponding reason if one of the two checks fails:
//
// 1. The endpoint count from endpointData doesn't equal to the one from endpointPodMap:
// endpiontPodMap removes the duplicated endpoints, and dupCount stores the number of duplicated it removed
// endpiontPodMap removes the duplicate endpoints, and dupCount stores the number of duplicate it removed
// and we compare the endpoint counts with duplicates
// 2. The endpoint count from endpointData or the one from endpointPodMap is 0
func (s *transactionSyncer) isValidEndpointInfo(eds []negtypes.EndpointsData, endpointPodMap negtypes.EndpointPodMap, dupCount int) (bool, string) {
Expand Down
12 changes: 6 additions & 6 deletions pkg/neg/syncers/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,7 @@ func TestIsValidEndpointInfo(t *testing.T) {
expectedReason string
}{
{
desc: "counts equal, endpointData has no duplicated endpoints",
desc: "counts equal, endpointData has no duplicate endpoints",
endpointsData: []negtypes.EndpointsData{
{
Meta: &metav1.ObjectMeta{
Expand Down Expand Up @@ -1529,7 +1529,7 @@ func TestIsValidEndpointInfo(t *testing.T) {
expectedReason: "",
},
{
desc: "counts equal, endpointData has duplicated endpoints",
desc: "counts equal, endpointData has duplicate endpoints",
endpointsData: []negtypes.EndpointsData{
{
Meta: &metav1.ObjectMeta{
Expand Down Expand Up @@ -1583,7 +1583,7 @@ func TestIsValidEndpointInfo(t *testing.T) {
NodeName: &instance1,
Addresses: []string{testIP2},
Ready: true,
}, // this is a duplicated endpoint
}, // this is a duplicate endpoint
{
TargetRef: &corev1.ObjectReference{
Namespace: testServiceNamespace,
Expand Down Expand Up @@ -1611,7 +1611,7 @@ func TestIsValidEndpointInfo(t *testing.T) {
expectedReason: "",
},
{
desc: "counts not equal, endpointData has no duplicated endpoints",
desc: "counts not equal, endpointData has no duplicate endpoints",
endpointsData: []negtypes.EndpointsData{
{
Meta: &metav1.ObjectMeta{
Expand Down Expand Up @@ -1675,7 +1675,7 @@ func TestIsValidEndpointInfo(t *testing.T) {
expectedReason: negtypes.ResultEPCountsDiffer,
},
{
desc: "counts not equal, endpointData has duplicated endpoints",
desc: "counts not equal, endpointData has duplicate endpoints",
endpointsData: []negtypes.EndpointsData{
{
Meta: &metav1.ObjectMeta{
Expand Down Expand Up @@ -1720,7 +1720,7 @@ func TestIsValidEndpointInfo(t *testing.T) {
NodeName: &instance1,
Addresses: []string{testIP2},
Ready: true,
}, // this is a duplicated endpoint
}, // this is a duplicate endpoint
{
TargetRef: &corev1.ObjectReference{
Namespace: testServiceNamespace,
Expand Down
4 changes: 2 additions & 2 deletions pkg/neg/syncers/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func ensureNetworkEndpointGroup(svcNamespace, svcName, negName, zone, negService
return negRef, nil
}

// toZoneNetworkEndpointMap translates addresses in endpoints object into zone and endpoints map, and also return the count for duplicated endpoints
// toZoneNetworkEndpointMap translates addresses in endpoints object into zone and endpoints map, and also return the count for duplicate endpoints
func toZoneNetworkEndpointMap(eds []negtypes.EndpointsData, zoneGetter negtypes.ZoneGetter, servicePortName string, networkEndpointType negtypes.NetworkEndpointType) (map[string]negtypes.NetworkEndpointSet, negtypes.EndpointPodMap, int, error) {
zoneNetworkEndpointMap := map[string]negtypes.NetworkEndpointSet{}
networkEndpointPodMap := negtypes.EndpointPodMap{}
Expand Down Expand Up @@ -278,7 +278,7 @@ func toZoneNetworkEndpointMap(eds []negtypes.EndpointsData, zoneGetter negtypes.
}
zoneNetworkEndpointMap[zone].Insert(networkEndpoint)

// increment the count for duplicated endpoint
// increment the count for duplicate endpoint
if _, contains := networkEndpointPodMap[networkEndpoint]; contains {
dupCount += 1
}
Expand Down

0 comments on commit 31b8430

Please sign in to comment.