nats-io / nats-operator

NATS Operator
https://nats-io.github.io/k8s/
Apache License 2.0
573 stars 111 forks source link

add feature gate to bypass namespace enforcement #347

Open colstrom opened 1 year ago

colstrom commented 1 year ago

This seems to be the only place where this is used, and the comment suggests it's intended to make things easier. It would be nice if there was a way to opt of out this restriction, so this PR adds a way to do that. It's using the same feature-gate mechanism as the ClusterScoped option, since that seemed appropriate, but if there's a better place for it, just let me know.

Thanks!

colstrom commented 1 year ago

Looking through the other issues and PRs, this would resolve #126 in a way that makes it explicit that the user is opting out of a safety feature, while still not requiring the namespace to be manually configured. It also supersedes #167 by not making it a build-time decision.

Speaking of build-time... looking at the CI failure above:

../../cloudflare/cfssl/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_serialize.go:41:26: undefined: math.MaxInt

It looks like a dependency unrelated to this change is referencing a constant that was first defined in Go 1.17, while the build environment is using Go 1.16.7. I'm not particularly familiar with Travis CI, but I can try to see about bumping the version of Go to 1.17.13 (the latest patch of the closest minor version to what's in use currently), unless there's any objection to that.