cloud/cloudhub: fix "Node founded" typo in checknode response

checknode.go returned "Node founded" on the success path instead of
"Node found". This user-visible string was grammatically wrong.

The existing test expected "Node found" but passed silently because
assert.Contains does a substring match — "Node found" is a substring
of "Node founded" — hiding the bug from CI.

Fix:
- Correct the response string to "Node found"
- Strengthen the test assertion to assert.Equal so any future
  mismatch will be caught immediately

Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
This commit is contained in:
Priyanshubhartistm 2026-06-23 00:59:15 +05:30
parent 1a3f39fdd2
commit 0ad2059aaf
No known key found for this signature in database
GPG key ID: 4912C0173D8395E6
2 changed files with 2 additions and 2 deletions

View file

@ -59,7 +59,7 @@ func CheckNode(request *restful.Request, response *restful.Response) {
}
// node exists return success
err = response.WriteErrorString(http.StatusOK, "Node founded")
err = response.WriteErrorString(http.StatusOK, "Node found")
if err != nil {
klog.Errorf("failed to send the task resp to edge , err: %v", err)
}

View file

@ -93,7 +93,7 @@ func TestCheckNode(t *testing.T) {
container.ServeHTTP(httpWriter, httpReq)
assert.Equal(t, tt.expectedStatus, httpWriter.Code)
assert.Contains(t, httpWriter.Body.String(), tt.expectedBody)
assert.Equal(t, tt.expectedBody, httpWriter.Body.String())
})
}
}