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

fix(typo): fix some typo #12673

Merged
merged 3 commits into from
Feb 17, 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
6 changes: 3 additions & 3 deletions server/auth/types/claims.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ func (c *Claims) UnmarshalJSON(data []byte) error {
func (c *Claims) GetCustomGroup(customKeyName string) ([]string, error) {
groups, ok := c.RawClaim[customKeyName]
if !ok {
return nil, fmt.Errorf("No claim found for key: %v", customKeyName)
return nil, fmt.Errorf("no claim found for key: %v", customKeyName)
}

sliceInterface, ok := groups.([]interface{})
if !ok {
return nil, fmt.Errorf("Expected an array, got %v", groups)
return nil, fmt.Errorf("expected an array, got %v", groups)
}

newSlice := []string{}
for _, a := range sliceInterface {
val, ok := a.(string)
if !ok {
return nil, fmt.Errorf("Group name %v was not a string", a)
return nil, fmt.Errorf("group name %v was not a string", a)
}
newSlice = append(newSlice, val)
}
Expand Down
4 changes: 2 additions & 2 deletions server/auth/types/claims_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func TestGetCustomGroup(t *testing.T) {
claims := &Claims{}
_, err := claims.GetCustomGroup(("ad_groups"))
if assert.Error(t, err) {
assert.EqualError(t, err, "No claim found for key: ad_groups")
assert.EqualError(t, err, "no claim found for key: ad_groups")
}
})
t.Run("CustomGroupSet", func(t *testing.T) {
Expand Down Expand Up @@ -209,7 +209,7 @@ func TestGetCustomGroup(t *testing.T) {
}}
_, err := claims.GetCustomGroup(("ad_groups"))
if assert.Error(t, err) {
assert.EqualError(t, err, "Group name 0 was not a string")
assert.EqualError(t, err, "group name 0 was not a string")
}
})
t.Run("CustomGroupNotSlice", func(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions server/workflow/workflow_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func (s *workflowServer) WatchEvents(req *workflowpkg.WatchEventsRequest, ws wor
log.Debug("Received event")
e, ok := event.Object.(*corev1.Event)
if !ok {
// object is probably probably metav1.Status, `FromObject` can deal with anything
// object is probably metav1.Status, `FromObject` can deal with anything
return sutils.ToStatusError(apierr.FromObject(event.Object), codes.Internal)
}
log.Debug("Sending event")
Expand Down Expand Up @@ -688,7 +688,7 @@ func getLatestWorkflow(ctx context.Context, wfClient versioned.Interface, namesp
return nil, sutils.ToStatusError(err, codes.Internal)
}
if len(wfList.Items) < 1 {
return nil, sutils.ToStatusError(fmt.Errorf("No workflows found."), codes.NotFound)
return nil, sutils.ToStatusError(fmt.Errorf("no workflows found"), codes.NotFound)
}
latest := wfList.Items[0]
for _, wf := range wfList.Items {
Expand Down
Loading