Don't clone OutputCurlString value (#14968)
* Don't clone OutputCurlString value, add flag to docs * Add changelog
This commit is contained in:
parent
8ffe70d029
commit
5f80aec3c7
|
@ -588,7 +588,6 @@ func (c *Client) CloneConfig() *Config {
|
||||||
newConfig.CheckRetry = c.config.CheckRetry
|
newConfig.CheckRetry = c.config.CheckRetry
|
||||||
newConfig.Logger = c.config.Logger
|
newConfig.Logger = c.config.Logger
|
||||||
newConfig.Limiter = c.config.Limiter
|
newConfig.Limiter = c.config.Limiter
|
||||||
newConfig.OutputCurlString = c.config.OutputCurlString
|
|
||||||
newConfig.SRVLookup = c.config.SRVLookup
|
newConfig.SRVLookup = c.config.SRVLookup
|
||||||
newConfig.CloneHeaders = c.config.CloneHeaders
|
newConfig.CloneHeaders = c.config.CloneHeaders
|
||||||
newConfig.CloneToken = c.config.CloneToken
|
newConfig.CloneToken = c.config.CloneToken
|
||||||
|
@ -1012,7 +1011,6 @@ func (c *Client) clone(cloneHeaders bool) (*Client, error) {
|
||||||
CheckRetry: config.CheckRetry,
|
CheckRetry: config.CheckRetry,
|
||||||
Logger: config.Logger,
|
Logger: config.Logger,
|
||||||
Limiter: config.Limiter,
|
Limiter: config.Limiter,
|
||||||
OutputCurlString: config.OutputCurlString,
|
|
||||||
AgentAddress: config.AgentAddress,
|
AgentAddress: config.AgentAddress,
|
||||||
SRVLookup: config.SRVLookup,
|
SRVLookup: config.SRVLookup,
|
||||||
CloneHeaders: config.CloneHeaders,
|
CloneHeaders: config.CloneHeaders,
|
||||||
|
|
|
@ -526,8 +526,8 @@ func TestClone(t *testing.T) {
|
||||||
if parent.MaxRetries() != clone.MaxRetries() {
|
if parent.MaxRetries() != clone.MaxRetries() {
|
||||||
t.Fatalf("maxRetries don't match: %v vs %v", parent.MaxRetries(), clone.MaxRetries())
|
t.Fatalf("maxRetries don't match: %v vs %v", parent.MaxRetries(), clone.MaxRetries())
|
||||||
}
|
}
|
||||||
if parent.OutputCurlString() != clone.OutputCurlString() {
|
if parent.OutputCurlString() == clone.OutputCurlString() {
|
||||||
t.Fatalf("outputCurlString doesn't match: %v vs %v", parent.OutputCurlString(), clone.OutputCurlString())
|
t.Fatalf("outputCurlString was copied over when it shouldn't have been: %v and %v", parent.OutputCurlString(), clone.OutputCurlString())
|
||||||
}
|
}
|
||||||
if parent.SRVLookup() != clone.SRVLookup() {
|
if parent.SRVLookup() != clone.SRVLookup() {
|
||||||
t.Fatalf("SRVLookup doesn't match: %v vs %v", parent.SRVLookup(), clone.SRVLookup())
|
t.Fatalf("SRVLookup doesn't match: %v vs %v", parent.SRVLookup(), clone.SRVLookup())
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
```release-note:bug
|
||||||
|
api: Fixes bug where OutputCurlString field was unintentionally being copied over during client cloning
|
||||||
|
```
|
|
@ -37,6 +37,11 @@ To get help for a subcommand, run:
|
||||||
$ vault <subcommand> -h
|
$ vault <subcommand> -h
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To see the equivalent API call required to perform the same operation, use the `-output-curl-string` flag after the subcommand.
|
||||||
|
```shell-session
|
||||||
|
vault auth enable -output-curl-string approle
|
||||||
|
```
|
||||||
|
|
||||||
## CLI Command Structure
|
## CLI Command Structure
|
||||||
|
|
||||||
There are a number of command and subcommand options available: HTTP options,
|
There are a number of command and subcommand options available: HTTP options,
|
||||||
|
|
Loading…
Reference in New Issue