Skip to content
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

Give better error if namespaces not enabled #399

Merged
merged 1 commit into from
Nov 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion subcommand/server-acl-init/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,13 @@ func (c *Command) Run(args []string) int {
}
_, _, err = consulClient.Namespaces().Update(&consulNamespace, &api.WriteOptions{})
if err != nil {
c.log.Error("Error updating the default namespace to include the cross namespace policy", "err", err)
if strings.Contains(strings.ToLower(err.Error()), "unexpected response code: 404") {
// If this returns a 404 it's most likely because they're not running
// Consul Enterprise.
c.log.Error("Error updating the default namespace to include the cross namespace policy - ensure you're running Consul Enterprise with namespaces enabled", "err", err)
} else {
c.log.Error("Error updating the default namespace to include the cross namespace policy", "err", err)
}
return 1
}
}
Expand Down