mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
bugfix: Add back default cmd.RootCommand definition. (#7811)
This commit fixes an issue when upgrading codebases to OPA v1.7.0. In PR #7797, we introduced the ability to provide "branding" information in OPA commands and help messages, which would allow easier customized OPA distributions in the future. However, this changeset removed the public symbol `cmd.RootCommand`, and required refactoring to use `cmd.Command`, which breaks automated upgrades, such as those done by Dependabot. This PR adds back the missing symbol, with the original/default "OPA" branding provided. This should allow existing codebases to upgrade without requiring any code changes. Signed-off-by: Philip Conrad <philip@chariot-chaser.net>
This commit is contained in:
@@ -23,7 +23,7 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
cmd := cmd.Command(nil, "OPA")
|
||||
cmd := cmd.RootCommand
|
||||
cmd.Use = "opa [command]"
|
||||
cmd.DisableAutoGenTag = true
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@ import (
|
||||
iversion "github.com/open-policy-agent/opa/internal/version"
|
||||
)
|
||||
|
||||
// Backwards compatibility definition. Newer code should use Command.
|
||||
var RootCommand = Command(nil, "OPA")
|
||||
|
||||
// UserAgent lets you override the OPA UA sent with all the HTTP requests.
|
||||
// It's another vanity thing -- if you build your own version of OPA, you
|
||||
// may want to adjust this.
|
||||
|
||||
Reference in New Issue
Block a user