Skip to content

Commit

Permalink
fix an already existing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
MatousJobanek committed Sep 17, 2024
1 parent d5a3713 commit 723bc4c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/kubeclient/signup.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ func (c *userSignupClient) listActiveSignupsByLabelForHashedValue(labelKey, valu
// label matching the specified label
func (c *userSignupClient) listActiveSignupsByLabel(labelKey, labelValue string) ([]*crtapi.UserSignup, error) {

// TODO add unit tests checking that the label selection works as expected. Right now, it's not possible to do that thanks to the great abstraction and multiple level of layers, mocks, and services.
selector := labels.NewSelector()
stateRequirement, err := labels.NewRequirement(crtapi.UserSignupStateLabelKey, selection.NotEquals, []string{crtapi.UserSignupStateLabelValueDeactivated})
stateRequirement, err := labels.NewRequirement(crtapi.UserSignupStateLabelKey, selection.NotIn, []string{crtapi.UserSignupStateLabelValueDeactivated, crtapi.UserSignupStateLabelValueNotReady})

Check warning on line 104 in pkg/kubeclient/signup.go

View check run for this annotation

Codecov / codecov/patch

pkg/kubeclient/signup.go#L103-L104

Added lines #L103 - L104 were not covered by tests
if err != nil {
return nil, err
}
Expand All @@ -120,9 +121,7 @@ func (c *userSignupClient) listActiveSignupsByLabel(labelKey, labelValue string)
result := make([]*crtapi.UserSignup, len(userSignups.Items))

Check warning on line 121 in pkg/kubeclient/signup.go

View check run for this annotation

Codecov / codecov/patch

pkg/kubeclient/signup.go#L121

Added line #L121 was not covered by tests

for i := range userSignups.Items {
userSignup := &crtapi.UserSignup{}
err = c.crtClient.scheme.Convert(userSignups.Items[i], userSignup, nil)
result[i] = userSignup
result[i] = &userSignups.Items[i]

Check warning on line 124 in pkg/kubeclient/signup.go

View check run for this annotation

Codecov / codecov/patch

pkg/kubeclient/signup.go#L123-L124

Added lines #L123 - L124 were not covered by tests
}

return result, err
Expand Down

0 comments on commit 723bc4c

Please sign in to comment.