Update generic errors with the new http package codes

All of these errors are now part of the standard HTTP method. Formalize
those into our error types and remove duplication and unclear
separation.
This commit is contained in:
Clayton Coleman
2017-07-26 21:43:24 -04:00
parent 6000712803
commit d3be1ac92e
9 changed files with 44 additions and 30 deletions

View File

@@ -39,7 +39,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"k8s.io/api/core/v1"
apierrs "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/httpstream"
@@ -1065,7 +1064,7 @@ func TestContainerLogsWithInvalidTail(t *testing.T) {
t.Errorf("Got error GETing: %v", err)
}
defer resp.Body.Close()
if resp.StatusCode != apierrs.StatusUnprocessableEntity {
if resp.StatusCode != http.StatusUnprocessableEntity {
t.Errorf("Unexpected non-error reading container logs: %#v", resp)
}
}