Skip to content

Commit

Permalink
Make map and types directives analysable
Browse files Browse the repository at this point in the history
The `map` directive (from ngx_http_map_module and ngx_stream_map_module)
and `types` directive (from ngx_http_core_module) are distinct from
other directives, in that their child directives may be arbitrary
strings that aren't known to Nginx. This causes crossplane to report
unrecognised/misused directive errors when analysing them with `strict`
or `check_ctx` enabled; it also means that no meaningful analysis can be
be performed when `check_args` is enabled because the arity of child
directives is unknown.

Add support for `map`'s special directives (`default`, `hostnames`, and
`volatile`) to the analyser. Recognise that arbitrary directive names
inside a `map` or `types` block are valid and that they accept either
one argument (if used in `map`) or one or more arguments (if used in
`types`).

Fixes nginxinc#101 and nginxinc#103.
  • Loading branch information
chrisnovakovic committed Jul 19, 2022
1 parent ad3d230 commit b7cd1c2
Show file tree
Hide file tree
Showing 7 changed files with 3,344 additions and 799 deletions.
3 changes: 2 additions & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ Contributors
* Ivan Poluyanov <[email protected]> `@poluyanov <https://github.com/poluyanov>`_
* Raymond Lau <[email protected]> `@Raymond26 <https://github.com/Raymond26>`_
* Luca Comellini <[email protected]> `@lucacome <https://github.com/lucacome>`_
* Ron Vider <[email protected]> `@RonVider <https://github.com/RonVider>`_
* Ron Vider <[email protected]> `@RonVider <https://github.com/RonVider>`_
* Chris Novakovic <[email protected]> `@chrisnovakovic <https://github.com/chrisnovakovic>`_
Loading

0 comments on commit b7cd1c2

Please sign in to comment.