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

Update webhook troubleshooting documentation to including necessary curl command. #1611

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions content/docs/troubleshooting/webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -693,13 +693,24 @@ In another shell session, check that you can reach the webhook:

```sh
curl -vsS --resolve cert-manager-webhook.cert-manager.svc:10250:127.0.0.1 \
-H "Content-Type: application/json" \
--service-name cert-manager-webhook-ca \
--cacert <(kubectl -n cert-manager get secret cert-manager-webhook-ca -ojsonpath='{.data.ca\.crt}' | base64 -d) \
https://cert-manager-webhook.cert-manager.svc:10250/validate 2>&1 -d@- <<'EOF' | sed '/^* /d; /bytes data]$/d; s/> //; s/< //'
{"kind":"AdmissionReview","apiVersion":"admission.k8s.io/v1","request":{"requestKind":{"group":"cert-manager.io","version":"v1","kind":"Certificate"},"requestResource":{"group":"cert-manager.io","version":"v1","resource":"certificates"},"name":"foo","namespace":"default","operation":"CREATE","object":{"apiVersion":"cert-manager.io/v1","kind":"Certificate","spec":{"dnsNames":["foo"],"issuerRef":{"group":"cert-manager.io","kind":"Issuer","name":"letsencrypt"},"secretName":"foo","usages":["digital signature"]}}}}
EOF
```

> ℹ️ if the `-H "Content-Type: application/json"` is omitted from the command above, you are likely
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: can you start the sentence with a capital letter

Suggested change
> ℹ️ if the `-H "Content-Type: application/json"` is omitted from the command above, you are likely
> ℹ️ If the `-H "Content-Type: application/json"` is omitted from the command above, you are likely

> to see a response like:
>
> ```json
> {"response":{"uid":"","allowed":false,"status":{"metadata":{},"message":"contentType=application/x-www-form-urlencoded, expected application/json","code":400}}}
> ```
>
> This is because the the default content type for curl is `application/x-www-form-urlencoded` but
> it is irrelevant to the troubleshooting effort.

The happy output looks like this:

```http
Expand Down