forked from docker/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28595 from anusha-ragunathan/plugin_timeout
Allow HTTP client timeout to be configurable on plugin enable.
- Loading branch information
Showing
4 changed files
with
14 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
package client | ||
|
||
import ( | ||
"net/url" | ||
"strconv" | ||
|
||
"github.com/docker/docker/api/types" | ||
"golang.org/x/net/context" | ||
) | ||
|
||
// PluginEnable enables a plugin | ||
func (cli *Client) PluginEnable(ctx context.Context, name string) error { | ||
resp, err := cli.post(ctx, "/plugins/"+name+"/enable", nil, nil, nil) | ||
func (cli *Client) PluginEnable(ctx context.Context, name string, options types.PluginEnableOptions) error { | ||
query := url.Values{} | ||
query.Set("timeout", strconv.Itoa(options.Timeout)) | ||
|
||
resp, err := cli.post(ctx, "/plugins/"+name+"/enable", query, nil, nil) | ||
ensureReaderClosed(resp) | ||
return err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters