mirror of https://github.com/docker/cli.git
Merge pull request #28529 from allencloud/update-secret-create-url
fix secret create url for consistency
This commit is contained in:
commit
4d87ef4432
|
@ -13,7 +13,7 @@ func (cli *Client) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (t
|
|||
var headers map[string][]string
|
||||
|
||||
var response types.SecretCreateResponse
|
||||
resp, err := cli.post(ctx, "/secrets", nil, secret, headers)
|
||||
resp, err := cli.post(ctx, "/secrets/create", nil, secret, headers)
|
||||
if err != nil {
|
||||
return response, err
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ func TestSecretCreateError(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestSecretCreate(t *testing.T) {
|
||||
expectedURL := "/secrets"
|
||||
expectedURL := "/secrets/create"
|
||||
client := &Client{
|
||||
client: newMockClient(func(req *http.Request) (*http.Response, error) {
|
||||
if !strings.HasPrefix(req.URL.Path, expectedURL) {
|
||||
|
@ -41,7 +41,7 @@ func TestSecretCreate(t *testing.T) {
|
|||
return nil, err
|
||||
}
|
||||
return &http.Response{
|
||||
StatusCode: http.StatusOK,
|
||||
StatusCode: http.StatusCreated,
|
||||
Body: ioutil.NopCloser(bytes.NewReader(b)),
|
||||
}, nil
|
||||
}),
|
||||
|
|
Loading…
Reference in New Issue