From f7c10e49cbe747a9ddd7da50681a19b907bac446 Mon Sep 17 00:00:00 2001 From: oliveromahony Date: Fri, 12 Jul 2024 15:30:27 +0100 Subject: [PATCH] Upgrade crossplane version to prevent Agent from rolling back in the case of valid NGINX configurations (#746) * upgrade crossplane version for patch release --- go.mod | 2 +- go.sum | 4 +- go.work.sum | 5 +++ sdk/go.mod | 2 +- sdk/go.sum | 4 +- .../nginxinc/nginx-go-crossplane/README.md | 43 +++++++++++++++++++ .../analyze_nplus_latest_directives.go | 6 +-- sdk/vendor/modules.txt | 2 +- test/integration/go.mod | 2 +- test/integration/go.sum | 4 +- .../nginxinc/nginx-go-crossplane/README.md | 43 +++++++++++++++++++ .../analyze_nplus_latest_directives.go | 6 +-- test/integration/vendor/modules.txt | 2 +- test/performance/go.mod | 2 +- test/performance/go.sum | 4 +- .../nginxinc/nginx-go-crossplane/README.md | 43 +++++++++++++++++++ .../analyze_nplus_latest_directives.go | 6 +-- test/performance/vendor/modules.txt | 2 +- .../nginxinc/nginx-go-crossplane/README.md | 43 +++++++++++++++++++ .../analyze_nplus_latest_directives.go | 6 +-- vendor/modules.txt | 2 +- 21 files changed, 205 insertions(+), 28 deletions(-) diff --git a/go.mod b/go.mod index 9ceb78e4d6..fc8f74ee09 100644 --- a/go.mod +++ b/go.mod @@ -57,7 +57,7 @@ require ( github.com/jstemmer/go-junit-report v1.0.0 // indirect github.com/lufia/plan9stats v0.0.0-20231016141302-07b5767bb0ed // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/nginxinc/nginx-go-crossplane v0.4.46 // indirect + github.com/nginxinc/nginx-go-crossplane v0.4.48 // indirect github.com/pelletier/go-toml/v2 v2.1.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect diff --git a/go.sum b/go.sum index 27294cdb85..9a0baf6e23 100644 --- a/go.sum +++ b/go.sum @@ -79,8 +79,8 @@ github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1 h1:NicmruxkeqHjDv03SfSxqmaLuisdd github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1/go.mod h1:eyp4DdUJAKkr9tvxR3jWhw2mDK7CWABMG5r9uyaKC7I= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/nginxinc/nginx-go-crossplane v0.4.46 h1:QsmhZRHkl2IcPjqjbLB8s55ViH0u5hopSv6DpwgtmOo= -github.com/nginxinc/nginx-go-crossplane v0.4.46/go.mod h1:UzbZnyFv0vPlt1Urbnp/mrFCzBL4tYCReFuNBpFQEfI= +github.com/nginxinc/nginx-go-crossplane v0.4.48 h1:Cf8sn8dTLJevtvNjGsla/wwa+rPTjm8eTfwSMqWisoI= +github.com/nginxinc/nginx-go-crossplane v0.4.48/go.mod h1:fgSibLM12jGRsh7QHpgL8wTKMEbfc594vSLK9ovwM6U= github.com/nginxinc/nginx-plus-go-client v1.1.0 h1:J860nVSuF5w+uwDLFEWTGRD7NPJnF67kKqaH/oNAkx4= github.com/nginxinc/nginx-plus-go-client v1.1.0/go.mod h1:n8OFLzrJulJ2fur28Cwa1Qp5DZNS2VicLV+Adt30LQ4= github.com/nginxinc/nginx-prometheus-exporter v0.11.0 h1:21xjnqNgxtni2jDgAQ90bl15uDnrTreO9sIlu1YsX/U= diff --git a/go.work.sum b/go.work.sum index 770c9758a5..85844a865a 100644 --- a/go.work.sum +++ b/go.work.sum @@ -3157,6 +3157,7 @@ golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -3215,6 +3216,7 @@ golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -3346,6 +3348,7 @@ golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457 h1:zf5N6UOrA487eEFacMePxjXAJctxKmyjKUsjA11Uzuk= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -3360,6 +3363,7 @@ golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -3420,6 +3424,7 @@ golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8= golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= diff --git a/sdk/go.mod b/sdk/go.mod index 594a3856d9..b17343e72b 100644 --- a/sdk/go.mod +++ b/sdk/go.mod @@ -10,7 +10,7 @@ require ( github.com/google/uuid v1.5.0 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/mitchellh/mapstructure v1.5.0 - github.com/nginxinc/nginx-go-crossplane v0.4.46 + github.com/nginxinc/nginx-go-crossplane v0.4.48 github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.8.4 google.golang.org/grpc v1.60.1 diff --git a/sdk/go.sum b/sdk/go.sum index 431f790ed8..6f4834e333 100644 --- a/sdk/go.sum +++ b/sdk/go.sum @@ -52,8 +52,8 @@ github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1 h1:NicmruxkeqHjDv03SfSxqmaLuisdd github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1/go.mod h1:eyp4DdUJAKkr9tvxR3jWhw2mDK7CWABMG5r9uyaKC7I= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/nginxinc/nginx-go-crossplane v0.4.46 h1:QsmhZRHkl2IcPjqjbLB8s55ViH0u5hopSv6DpwgtmOo= -github.com/nginxinc/nginx-go-crossplane v0.4.46/go.mod h1:UzbZnyFv0vPlt1Urbnp/mrFCzBL4tYCReFuNBpFQEfI= +github.com/nginxinc/nginx-go-crossplane v0.4.48 h1:Cf8sn8dTLJevtvNjGsla/wwa+rPTjm8eTfwSMqWisoI= +github.com/nginxinc/nginx-go-crossplane v0.4.48/go.mod h1:fgSibLM12jGRsh7QHpgL8wTKMEbfc594vSLK9ovwM6U= github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= diff --git a/sdk/vendor/github.com/nginxinc/nginx-go-crossplane/README.md b/sdk/vendor/github.com/nginxinc/nginx-go-crossplane/README.md index 5dc6d482bb..3f84bce266 100644 --- a/sdk/vendor/github.com/nginxinc/nginx-go-crossplane/README.md +++ b/sdk/vendor/github.com/nginxinc/nginx-go-crossplane/README.md @@ -73,6 +73,49 @@ func main() { } ``` +# Generate support for third-party modules +This is an example that takes the path of a third-party module source code to generate support for it. Assume the source code path of that module is `./src`. You can call `go run cmd/generate/main.go ./src`. The stdout will be like + +```go +/** + * Copyright (c) F5, Inc. + * + * This source code is licensed under the Apache License, Version 2.0 license found in the + * LICENSE file in the root directory of this source tree. + */ + +// Code generated by generator; DO NOT EDIT. +// All the definitions are extracted from the source code +// Each bit mask describes these behaviors: +// - how many arguments the directive can take +// - whether or not it is a block directive +// - whether this is a flag (takes one argument that's either "on" or "off") +// - which contexts it's allowed to be in + +package crossplane + +var directives = map[string][]uint{ + "my_directive_1": { + bitmask01|bitmask02|..., + bitmask11|bitmask12|..., + ... + }, + "my_directive_2": { + bitmask01|bitmask02|..., + bitmask11|bitmask12|..., + ... + }, +} + +// Match is a matchFunc for parsing an NGINX config that contains the +// preceding directives. +func Match(directive string) ([]uint, bool) { + m, ok := directives[directive] + return m, ok +} +``` +You can redirect the stdout into a `.go` file, and pass the generated `matchFunc` to `ParseOptions.DirectiveSources` when invoking `Parse`. + ## Contributing If you'd like to contribute to the project, please read our [Contributing guide](CONTRIBUTING.md). diff --git a/sdk/vendor/github.com/nginxinc/nginx-go-crossplane/analyze_nplus_latest_directives.go b/sdk/vendor/github.com/nginxinc/nginx-go-crossplane/analyze_nplus_latest_directives.go index 2b0e6f7395..66cec3bc0b 100644 --- a/sdk/vendor/github.com/nginxinc/nginx-go-crossplane/analyze_nplus_latest_directives.go +++ b/sdk/vendor/github.com/nginxinc/nginx-go-crossplane/analyze_nplus_latest_directives.go @@ -695,8 +695,8 @@ var ngxPlusLatestDirectives = map[string][]uint{ ngxHTTPMainConf | ngxHTTPSrvConf | ngxHTTPLocConf | ngxConfTake12, }, "keyval": { - ngxHTTPMainConf | ngxConfTake3 | ngxConfTake2, - ngxStreamMainConf | ngxConfTake3 | ngxConfTake2, + ngxHTTPMainConf | ngxConfTake3 | ngxConfTake4, + ngxStreamMainConf | ngxConfTake3 | ngxConfTake4, }, "keyval_zone": { ngxHTTPMainConf | ngxConf1More, @@ -754,7 +754,7 @@ var ngxPlusLatestDirectives = map[string][]uint{ ngxHTTPMainConf | ngxHTTPSrvConf | ngxHTTPLocConf | ngxConfTake1, }, "limit_req_zone": { - ngxHTTPMainConf | ngxConfTake3 | ngxConfTake2, + ngxHTTPMainConf | ngxConfTake3 | ngxConfTake4, }, "lingering_close": { ngxHTTPMainConf | ngxHTTPSrvConf | ngxHTTPLocConf | ngxConfTake1, diff --git a/sdk/vendor/modules.txt b/sdk/vendor/modules.txt index 142d60d538..a16293ce51 100644 --- a/sdk/vendor/modules.txt +++ b/sdk/vendor/modules.txt @@ -44,7 +44,7 @@ github.com/maxbrunsfeld/counterfeiter/v6/generator # github.com/mitchellh/mapstructure v1.5.0 ## explicit; go 1.14 github.com/mitchellh/mapstructure -# github.com/nginxinc/nginx-go-crossplane v0.4.46 +# github.com/nginxinc/nginx-go-crossplane v0.4.48 ## explicit; go 1.19 github.com/nginxinc/nginx-go-crossplane # github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 diff --git a/test/integration/go.mod b/test/integration/go.mod index a63535a9b8..3da68ca70a 100644 --- a/test/integration/go.mod +++ b/test/integration/go.mod @@ -124,7 +124,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/nginxinc/nginx-go-crossplane v0.4.46 // indirect + github.com/nginxinc/nginx-go-crossplane v0.4.48 // indirect github.com/onsi/ginkgo/v2 v2.13.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc5 // indirect diff --git a/test/integration/go.sum b/test/integration/go.sum index e44dc09726..86a14a647e 100644 --- a/test/integration/go.sum +++ b/test/integration/go.sum @@ -399,8 +399,8 @@ github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7P github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nginxinc/nginx-go-crossplane v0.4.46 h1:QsmhZRHkl2IcPjqjbLB8s55ViH0u5hopSv6DpwgtmOo= -github.com/nginxinc/nginx-go-crossplane v0.4.46/go.mod h1:UzbZnyFv0vPlt1Urbnp/mrFCzBL4tYCReFuNBpFQEfI= +github.com/nginxinc/nginx-go-crossplane v0.4.48 h1:Cf8sn8dTLJevtvNjGsla/wwa+rPTjm8eTfwSMqWisoI= +github.com/nginxinc/nginx-go-crossplane v0.4.48/go.mod h1:fgSibLM12jGRsh7QHpgL8wTKMEbfc594vSLK9ovwM6U= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= diff --git a/test/integration/vendor/github.com/nginxinc/nginx-go-crossplane/README.md b/test/integration/vendor/github.com/nginxinc/nginx-go-crossplane/README.md index 5dc6d482bb..3f84bce266 100644 --- a/test/integration/vendor/github.com/nginxinc/nginx-go-crossplane/README.md +++ b/test/integration/vendor/github.com/nginxinc/nginx-go-crossplane/README.md @@ -73,6 +73,49 @@ func main() { } ``` +# Generate support for third-party modules +This is an example that takes the path of a third-party module source code to generate support for it. Assume the source code path of that module is `./src`. You can call `go run cmd/generate/main.go ./src`. The stdout will be like + +```go +/** + * Copyright (c) F5, Inc. + * + * This source code is licensed under the Apache License, Version 2.0 license found in the + * LICENSE file in the root directory of this source tree. + */ + +// Code generated by generator; DO NOT EDIT. +// All the definitions are extracted from the source code +// Each bit mask describes these behaviors: +// - how many arguments the directive can take +// - whether or not it is a block directive +// - whether this is a flag (takes one argument that's either "on" or "off") +// - which contexts it's allowed to be in + +package crossplane + +var directives = map[string][]uint{ + "my_directive_1": { + bitmask01|bitmask02|..., + bitmask11|bitmask12|..., + ... + }, + "my_directive_2": { + bitmask01|bitmask02|..., + bitmask11|bitmask12|..., + ... + }, +} + +// Match is a matchFunc for parsing an NGINX config that contains the +// preceding directives. +func Match(directive string) ([]uint, bool) { + m, ok := directives[directive] + return m, ok +} +``` +You can redirect the stdout into a `.go` file, and pass the generated `matchFunc` to `ParseOptions.DirectiveSources` when invoking `Parse`. + ## Contributing If you'd like to contribute to the project, please read our [Contributing guide](CONTRIBUTING.md). diff --git a/test/integration/vendor/github.com/nginxinc/nginx-go-crossplane/analyze_nplus_latest_directives.go b/test/integration/vendor/github.com/nginxinc/nginx-go-crossplane/analyze_nplus_latest_directives.go index 2b0e6f7395..66cec3bc0b 100644 --- a/test/integration/vendor/github.com/nginxinc/nginx-go-crossplane/analyze_nplus_latest_directives.go +++ b/test/integration/vendor/github.com/nginxinc/nginx-go-crossplane/analyze_nplus_latest_directives.go @@ -695,8 +695,8 @@ var ngxPlusLatestDirectives = map[string][]uint{ ngxHTTPMainConf | ngxHTTPSrvConf | ngxHTTPLocConf | ngxConfTake12, }, "keyval": { - ngxHTTPMainConf | ngxConfTake3 | ngxConfTake2, - ngxStreamMainConf | ngxConfTake3 | ngxConfTake2, + ngxHTTPMainConf | ngxConfTake3 | ngxConfTake4, + ngxStreamMainConf | ngxConfTake3 | ngxConfTake4, }, "keyval_zone": { ngxHTTPMainConf | ngxConf1More, @@ -754,7 +754,7 @@ var ngxPlusLatestDirectives = map[string][]uint{ ngxHTTPMainConf | ngxHTTPSrvConf | ngxHTTPLocConf | ngxConfTake1, }, "limit_req_zone": { - ngxHTTPMainConf | ngxConfTake3 | ngxConfTake2, + ngxHTTPMainConf | ngxConfTake3 | ngxConfTake4, }, "lingering_close": { ngxHTTPMainConf | ngxHTTPSrvConf | ngxHTTPLocConf | ngxConfTake1, diff --git a/test/integration/vendor/modules.txt b/test/integration/vendor/modules.txt index 6b0e9f25eb..b078e54ed9 100644 --- a/test/integration/vendor/modules.txt +++ b/test/integration/vendor/modules.txt @@ -689,7 +689,7 @@ github.com/nginx/agent/v2/src/extensions/advanced-metrics/tables/sample github.com/nginx/agent/v2/src/extensions/advanced-metrics/tables/schema github.com/nginx/agent/v2/test/utils github.com/nginx/agent/v2/test/utils/system -# github.com/nginxinc/nginx-go-crossplane v0.4.46 +# github.com/nginxinc/nginx-go-crossplane v0.4.48 ## explicit; go 1.19 github.com/nginxinc/nginx-go-crossplane # github.com/onsi/ginkgo/v2 v2.13.0 diff --git a/test/performance/go.mod b/test/performance/go.mod index cd629c885c..d1738e347f 100644 --- a/test/performance/go.mod +++ b/test/performance/go.mod @@ -44,7 +44,7 @@ require ( github.com/nats-io/jwt/v2 v2.5.2 // indirect github.com/nats-io/nkeys v0.4.6 // indirect github.com/nats-io/nuid v1.0.1 // indirect - github.com/nginxinc/nginx-go-crossplane v0.4.46 // indirect + github.com/nginxinc/nginx-go-crossplane v0.4.48 // indirect github.com/nginxinc/nginx-plus-go-client v1.1.0 // indirect github.com/nginxinc/nginx-prometheus-exporter v0.11.0 // indirect github.com/nxadm/tail v1.4.11 // indirect diff --git a/test/performance/go.sum b/test/performance/go.sum index dd094522a7..4f2bed75bd 100644 --- a/test/performance/go.sum +++ b/test/performance/go.sum @@ -96,8 +96,8 @@ github.com/nats-io/nkeys v0.4.6 h1:IzVe95ru2CT6ta874rt9saQRkWfe2nFj1NtvYSLqMzY= github.com/nats-io/nkeys v0.4.6/go.mod h1:4DxZNzenSVd1cYQoAa8948QY3QDjrHfcfVADymtkpts= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/nginxinc/nginx-go-crossplane v0.4.46 h1:QsmhZRHkl2IcPjqjbLB8s55ViH0u5hopSv6DpwgtmOo= -github.com/nginxinc/nginx-go-crossplane v0.4.46/go.mod h1:UzbZnyFv0vPlt1Urbnp/mrFCzBL4tYCReFuNBpFQEfI= +github.com/nginxinc/nginx-go-crossplane v0.4.48 h1:Cf8sn8dTLJevtvNjGsla/wwa+rPTjm8eTfwSMqWisoI= +github.com/nginxinc/nginx-go-crossplane v0.4.48/go.mod h1:fgSibLM12jGRsh7QHpgL8wTKMEbfc594vSLK9ovwM6U= github.com/nginxinc/nginx-plus-go-client v1.1.0 h1:J860nVSuF5w+uwDLFEWTGRD7NPJnF67kKqaH/oNAkx4= github.com/nginxinc/nginx-plus-go-client v1.1.0/go.mod h1:n8OFLzrJulJ2fur28Cwa1Qp5DZNS2VicLV+Adt30LQ4= github.com/nginxinc/nginx-prometheus-exporter v0.11.0 h1:21xjnqNgxtni2jDgAQ90bl15uDnrTreO9sIlu1YsX/U= diff --git a/test/performance/vendor/github.com/nginxinc/nginx-go-crossplane/README.md b/test/performance/vendor/github.com/nginxinc/nginx-go-crossplane/README.md index 5dc6d482bb..3f84bce266 100644 --- a/test/performance/vendor/github.com/nginxinc/nginx-go-crossplane/README.md +++ b/test/performance/vendor/github.com/nginxinc/nginx-go-crossplane/README.md @@ -73,6 +73,49 @@ func main() { } ``` +# Generate support for third-party modules +This is an example that takes the path of a third-party module source code to generate support for it. Assume the source code path of that module is `./src`. You can call `go run cmd/generate/main.go ./src`. The stdout will be like + +```go +/** + * Copyright (c) F5, Inc. + * + * This source code is licensed under the Apache License, Version 2.0 license found in the + * LICENSE file in the root directory of this source tree. + */ + +// Code generated by generator; DO NOT EDIT. +// All the definitions are extracted from the source code +// Each bit mask describes these behaviors: +// - how many arguments the directive can take +// - whether or not it is a block directive +// - whether this is a flag (takes one argument that's either "on" or "off") +// - which contexts it's allowed to be in + +package crossplane + +var directives = map[string][]uint{ + "my_directive_1": { + bitmask01|bitmask02|..., + bitmask11|bitmask12|..., + ... + }, + "my_directive_2": { + bitmask01|bitmask02|..., + bitmask11|bitmask12|..., + ... + }, +} + +// Match is a matchFunc for parsing an NGINX config that contains the +// preceding directives. +func Match(directive string) ([]uint, bool) { + m, ok := directives[directive] + return m, ok +} +``` +You can redirect the stdout into a `.go` file, and pass the generated `matchFunc` to `ParseOptions.DirectiveSources` when invoking `Parse`. + ## Contributing If you'd like to contribute to the project, please read our [Contributing guide](CONTRIBUTING.md). diff --git a/test/performance/vendor/github.com/nginxinc/nginx-go-crossplane/analyze_nplus_latest_directives.go b/test/performance/vendor/github.com/nginxinc/nginx-go-crossplane/analyze_nplus_latest_directives.go index 2b0e6f7395..66cec3bc0b 100644 --- a/test/performance/vendor/github.com/nginxinc/nginx-go-crossplane/analyze_nplus_latest_directives.go +++ b/test/performance/vendor/github.com/nginxinc/nginx-go-crossplane/analyze_nplus_latest_directives.go @@ -695,8 +695,8 @@ var ngxPlusLatestDirectives = map[string][]uint{ ngxHTTPMainConf | ngxHTTPSrvConf | ngxHTTPLocConf | ngxConfTake12, }, "keyval": { - ngxHTTPMainConf | ngxConfTake3 | ngxConfTake2, - ngxStreamMainConf | ngxConfTake3 | ngxConfTake2, + ngxHTTPMainConf | ngxConfTake3 | ngxConfTake4, + ngxStreamMainConf | ngxConfTake3 | ngxConfTake4, }, "keyval_zone": { ngxHTTPMainConf | ngxConf1More, @@ -754,7 +754,7 @@ var ngxPlusLatestDirectives = map[string][]uint{ ngxHTTPMainConf | ngxHTTPSrvConf | ngxHTTPLocConf | ngxConfTake1, }, "limit_req_zone": { - ngxHTTPMainConf | ngxConfTake3 | ngxConfTake2, + ngxHTTPMainConf | ngxConfTake3 | ngxConfTake4, }, "lingering_close": { ngxHTTPMainConf | ngxHTTPSrvConf | ngxHTTPLocConf | ngxConfTake1, diff --git a/test/performance/vendor/modules.txt b/test/performance/vendor/modules.txt index 194da90504..f9d2b9f84a 100644 --- a/test/performance/vendor/modules.txt +++ b/test/performance/vendor/modules.txt @@ -176,7 +176,7 @@ github.com/nginx/agent/v2/src/extensions/prometheus-metrics github.com/nginx/agent/v2/src/plugins github.com/nginx/agent/v2/test/utils github.com/nginx/agent/v2/test/utils/system -# github.com/nginxinc/nginx-go-crossplane v0.4.46 +# github.com/nginxinc/nginx-go-crossplane v0.4.48 ## explicit; go 1.19 github.com/nginxinc/nginx-go-crossplane # github.com/nginxinc/nginx-plus-go-client v1.1.0 diff --git a/vendor/github.com/nginxinc/nginx-go-crossplane/README.md b/vendor/github.com/nginxinc/nginx-go-crossplane/README.md index 5dc6d482bb..3f84bce266 100644 --- a/vendor/github.com/nginxinc/nginx-go-crossplane/README.md +++ b/vendor/github.com/nginxinc/nginx-go-crossplane/README.md @@ -73,6 +73,49 @@ func main() { } ``` +# Generate support for third-party modules +This is an example that takes the path of a third-party module source code to generate support for it. Assume the source code path of that module is `./src`. You can call `go run cmd/generate/main.go ./src`. The stdout will be like + +```go +/** + * Copyright (c) F5, Inc. + * + * This source code is licensed under the Apache License, Version 2.0 license found in the + * LICENSE file in the root directory of this source tree. + */ + +// Code generated by generator; DO NOT EDIT. +// All the definitions are extracted from the source code +// Each bit mask describes these behaviors: +// - how many arguments the directive can take +// - whether or not it is a block directive +// - whether this is a flag (takes one argument that's either "on" or "off") +// - which contexts it's allowed to be in + +package crossplane + +var directives = map[string][]uint{ + "my_directive_1": { + bitmask01|bitmask02|..., + bitmask11|bitmask12|..., + ... + }, + "my_directive_2": { + bitmask01|bitmask02|..., + bitmask11|bitmask12|..., + ... + }, +} + +// Match is a matchFunc for parsing an NGINX config that contains the +// preceding directives. +func Match(directive string) ([]uint, bool) { + m, ok := directives[directive] + return m, ok +} +``` +You can redirect the stdout into a `.go` file, and pass the generated `matchFunc` to `ParseOptions.DirectiveSources` when invoking `Parse`. + ## Contributing If you'd like to contribute to the project, please read our [Contributing guide](CONTRIBUTING.md). diff --git a/vendor/github.com/nginxinc/nginx-go-crossplane/analyze_nplus_latest_directives.go b/vendor/github.com/nginxinc/nginx-go-crossplane/analyze_nplus_latest_directives.go index 2b0e6f7395..66cec3bc0b 100644 --- a/vendor/github.com/nginxinc/nginx-go-crossplane/analyze_nplus_latest_directives.go +++ b/vendor/github.com/nginxinc/nginx-go-crossplane/analyze_nplus_latest_directives.go @@ -695,8 +695,8 @@ var ngxPlusLatestDirectives = map[string][]uint{ ngxHTTPMainConf | ngxHTTPSrvConf | ngxHTTPLocConf | ngxConfTake12, }, "keyval": { - ngxHTTPMainConf | ngxConfTake3 | ngxConfTake2, - ngxStreamMainConf | ngxConfTake3 | ngxConfTake2, + ngxHTTPMainConf | ngxConfTake3 | ngxConfTake4, + ngxStreamMainConf | ngxConfTake3 | ngxConfTake4, }, "keyval_zone": { ngxHTTPMainConf | ngxConf1More, @@ -754,7 +754,7 @@ var ngxPlusLatestDirectives = map[string][]uint{ ngxHTTPMainConf | ngxHTTPSrvConf | ngxHTTPLocConf | ngxConfTake1, }, "limit_req_zone": { - ngxHTTPMainConf | ngxConfTake3 | ngxConfTake2, + ngxHTTPMainConf | ngxConfTake3 | ngxConfTake4, }, "lingering_close": { ngxHTTPMainConf | ngxHTTPSrvConf | ngxHTTPLocConf | ngxConfTake1, diff --git a/vendor/modules.txt b/vendor/modules.txt index ac1d56bb5a..ec303aea5c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -104,7 +104,7 @@ github.com/nginx/agent/sdk/v2/proto github.com/nginx/agent/sdk/v2/proto/common github.com/nginx/agent/sdk/v2/proto/events github.com/nginx/agent/sdk/v2/zip -# github.com/nginxinc/nginx-go-crossplane v0.4.46 +# github.com/nginxinc/nginx-go-crossplane v0.4.48 ## explicit; go 1.19 github.com/nginxinc/nginx-go-crossplane # github.com/nginxinc/nginx-plus-go-client v1.1.0