[NO TESTS NEEDED] Vendor in containers/buildah v1.20.0

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2021-03-26 11:23:46 -04:00
parent fa6ba9b00f
commit fc197fb4f5
158 changed files with 3931 additions and 1954 deletions

View File

@ -44,6 +44,9 @@ type CreateExecOptions struct {
//
// See https://goo.gl/60TeBP for more details
func (c *Client) CreateExec(opts CreateExecOptions) (*Exec, error) {
if c.serverAPIVersion == nil {
c.checkAPIVersion()
}
if len(opts.Env) > 0 && c.serverAPIVersion.LessThan(apiVersion125) {
return nil, errors.New("exec configuration Env is only supported in API#1.25 and above")
}
@ -53,7 +56,8 @@ func (c *Client) CreateExec(opts CreateExecOptions) (*Exec, error) {
path := fmt.Sprintf("/containers/%s/exec", opts.Container)
resp, err := c.do(http.MethodPost, path, doOptions{data: opts, context: opts.Context})
if err != nil {
if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {
var e *Error
if errors.As(err, &e) && e.Status == http.StatusNotFound {
return nil, &NoSuchContainer{ID: opts.Container}
}
return nil, err
@ -122,7 +126,8 @@ func (c *Client) StartExecNonBlocking(id string, opts StartExecOptions) (CloseWa
if opts.Detach {
resp, err := c.do(http.MethodPost, path, doOptions{data: opts, context: opts.Context})
if err != nil {
if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {
var e *Error
if errors.As(err, &e) && e.Status == http.StatusNotFound {
return nil, &NoSuchExec{ID: id}
}
return nil, err
@ -195,7 +200,8 @@ func (c *Client) InspectExec(id string) (*ExecInspect, error) {
path := fmt.Sprintf("/exec/%s/json", id)
resp, err := c.do(http.MethodGet, path, doOptions{})
if err != nil {
if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {
var e *Error
if errors.As(err, &e) && e.Status == http.StatusNotFound {
return nil, &NoSuchExec{ID: id}
}
return nil, err