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

feat: support multiple request types and configurable expected status code #782

Conversation

yashvardhan-kukreja
Copy link
Contributor

@yashvardhan-kukreja yashvardhan-kukreja commented Jan 18, 2021

closes #779

Updated the docs and version of the http-check image as well.
The following are the new configurable environment variables for the http-check

      env:
          - name: CHECK_URL
            value: "https://reqres.in/api/users"
          - name: COUNT                #### default: "0"
            value: "1"
          - name: SECONDS              #### default: "0"
            value: "1"
          - name: PASSING_PERCENT      #### default: "100"
            value: "100"
          - name: REQUEST_TYPE         #### default: "GET"
            value: "POST"
          - name: REQUEST_BODY         #### default: "{}"
            value: '{"name": "morpheus", "job": "leader"}'
          - name: EXPECTED_STATUS_CODE #### default: "200"
            value: "201"

Sample output of a failing check

"kuberhealthy/http": {
      "OK": false,
      "Errors": [
        "unable to retrieve a valid response (expected status: 201) from POST https://reqres.in/api/users checks failed 1 out of 1 attempts"
      ],
      "RunDuration": "39.511730386s",
      "Namespace": "kuberhealthy",
      "LastRun": "2021-01-18T21:48:33.614078779Z",
      "AuthoritativePod": "kuberhealthy-7b5b54ddb7-sggnz",
      "uuid": "e426be13-4a17-4db1-896e-26521f8bb02c"
    }

@yashvardhan-kukreja yashvardhan-kukreja force-pushed the issue-779/add-support-for-multiple-request-types branch 2 times, most recently from 262a554 to 7fd61f5 Compare January 18, 2021 22:14
@yashvardhan-kukreja yashvardhan-kukreja changed the title feat: added multiple request types and configurable expected status code feat: support multiple request types and configurable expected status code Jan 18, 2021
@yashvardhan-kukreja yashvardhan-kukreja force-pushed the issue-779/add-support-for-multiple-request-types branch from 7fd61f5 to 9c34777 Compare January 18, 2021 22:18
@yashvardhan-kukreja
Copy link
Contributor Author

yashvardhan-kukreja commented Jan 20, 2021

@integrii Please take a look at this PR and let me know if it looks fine.
Thanks!

Copy link
Collaborator

@integrii integrii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Thank you very much. Always great to see code with comments and end user documentation on the first iteration.

@integrii integrii merged commit b04ef37 into kuberhealthy:master Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

enhance http-check: add support for other request types apart from GET and configurable expected status code
2 participants