-
Notifications
You must be signed in to change notification settings - Fork 241
Add documentation for new wildcard Hosts feature #965
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
Conversation
We don't need to escape the backslash; it renders fine with one.
This documents support for using a wildcard with the `hosts` option, which was recently added in v0.42.0. See grafana/k6#2747.
There's a version of the docs published here: https://mdr-ci.staging.k6.io/docs/refs/pull/965/merge It will be deleted automatically in 30 days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I requested some minor views for language, and to smooth out the explanation. My suggestions also make some assumptions about wildcards that I'm not sure about, so please be sure I haven't added anything incorrect!
src/data/markdown/translated-guides/en/02 Using k6/05 k6 Options/02 Reference.md
Outdated
Show resolved
Hide resolved
```javascript | ||
export const options = { | ||
hosts: { | ||
'test.k6.io': '1.2.3.4', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'test.k6.io': '1.2.3.4', |
Should we delete this line? Doesn't the wildcard below already do this redirect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does, but I think it's important to document all ways the feature can be used, and we should keep this most basic way of doing the mapping. The example itself doesn't have to represent a real-world usage scenario. We could always use a different domain instead, maybe *.grafana.com
, but I think this is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could always use a different domain instead, maybe *.grafana.com, but I think this is fine.
I'd rather do this. Or test-api.k6.io
or whatever. As it is right now, that line in the script doesn't really do anything. So I think it creates ambiguity. Readers will look at it and wonder, wait, doesn't the wildcard already include that domain? Or do I not understand how this works? That was my thought process, at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Done in 934582d.
src/data/markdown/translated-guides/en/02 Using k6/05 k6 Options/02 Reference.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 🦖
Co-authored-by: Matt Dodson <47385188+MattDodsonEnglish@users.noreply.github.com>
This documents support for using a wildcard with the
hosts
option, which was recently added in v0.42.0. See grafana/k6#2747.