diff --git a/docker_test.go b/docker_test.go index 1fbd3f8ca5..f41a002a3b 100644 --- a/docker_test.go +++ b/docker_test.go @@ -2102,10 +2102,30 @@ func TestDockerProvider_BuildImage_Retries(t *testing.T) { shouldRetry: false, }, { - name: "no retry on permanent error", + name: "no retry when a resource is not found", + errReturned: errdefs.NotFound(errors.New("not available")), + shouldRetry: false, + }, + { + name: "no retry when parameters are invalid", errReturned: errdefs.InvalidParameter(errors.New("invalid")), shouldRetry: false, }, + { + name: "no retry when resource access not authorized", + errReturned: errdefs.Unauthorized(errors.New("not authorized")), + shouldRetry: false, + }, + { + name: "no retry when resource access is forbidden", + errReturned: errdefs.Forbidden(errors.New("forbidden")), + shouldRetry: false, + }, + { + name: "no retry when not implemented by provider", + errReturned: errdefs.NotImplemented(errors.New("unkown method")), + shouldRetry: false, + }, { name: "retry on non-permanent error", errReturned: errors.New("whoops"), @@ -2143,10 +2163,15 @@ func TestDockerProvider_waitContainerCreation_retries(t *testing.T) { shouldRetry: false, }, { - name: "no retry on permanent error", + name: "no retry when parameters are invalid", errReturned: errdefs.InvalidParameter(errors.New("invalid")), shouldRetry: false, }, + { + name: "no retry when not implemented by provider", + errReturned: errdefs.NotImplemented(errors.New("unkown method")), + shouldRetry: false, + }, { name: "retry when not found", errReturned: errdefs.NotFound(errors.New("not there yet")), @@ -2189,10 +2214,30 @@ func TestDockerProvider_attemptToPullImage_retries(t *testing.T) { shouldRetry: false, }, { - name: "no retry on permanent error", + name: "no retry when a resource is not found", errReturned: errdefs.NotFound(errors.New("not available")), shouldRetry: false, }, + { + name: "no retry when parameters are invalid", + errReturned: errdefs.InvalidParameter(errors.New("invalid")), + shouldRetry: false, + }, + { + name: "no retry when resource access not authorized", + errReturned: errdefs.Unauthorized(errors.New("not authorized")), + shouldRetry: false, + }, + { + name: "no retry when resource access is forbidden", + errReturned: errdefs.Forbidden(errors.New("forbidden")), + shouldRetry: false, + }, + { + name: "no retry when not implemented by provider", + errReturned: errdefs.NotImplemented(errors.New("unkown method")), + shouldRetry: false, + }, { name: "retry on non-permanent error", errReturned: errors.New("whoops"),