From c4911cc3ba396b670228a9d4941664f673fde453 Mon Sep 17 00:00:00 2001 From: Dhia Ayachi Date: Thu, 22 Jul 2021 16:46:02 -0400 Subject: [PATCH] add http flag for admin partition (#10683) --- command/flags/http.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/command/flags/http.go b/command/flags/http.go index 5d003d94c..a1a60ee40 100644 --- a/command/flags/http.go +++ b/command/flags/http.go @@ -81,10 +81,7 @@ func (f *HTTPFlags) MultiTenancyFlags() *flag.FlagSet { "Specifies the namespace to query. If not provided, the namespace will be inferred "+ "from the request's ACL token, or will default to the `default` namespace. "+ "Namespaces are a Consul Enterprise feature.") - fs.Var(&f.partition, "partition", - "Specifies the admin partition to query. If not provided, the admin partition will be inferred "+ - "from the request's ACL token, or will default to the `default` admin partition. "+ - "Admin Partitions are a Consul Enterprise feature.") + f.AddPartitionFlag(fs) return fs } @@ -152,4 +149,12 @@ func (f *HTTPFlags) MergeOntoConfig(c *api.Config) { f.tlsServerName.Merge(&c.TLSConfig.Address) f.datacenter.Merge(&c.Datacenter) f.namespace.Merge(&c.Namespace) + f.partition.Merge(&c.Partition) +} + +func (f *HTTPFlags) AddPartitionFlag(fs *flag.FlagSet) { + fs.Var(&f.partition, "partition", + "Specifies the admin partition to query. If not provided, the admin partition will be inferred "+ + "from the request's ACL token, or will default to the `default` admin partition. "+ + "Admin Partitions are a Consul Enterprise feature.") }