diff --git a/pkg/api/v1beta1/types.go b/pkg/api/v1beta1/types.go index ef959597477..a076b5986b7 100644 --- a/pkg/api/v1beta1/types.go +++ b/pkg/api/v1beta1/types.go @@ -436,14 +436,14 @@ const ( // resource. // "id" string - the identifier of the missing resource // Status code 404 - ReasonTypeNotFound ReasonType = "not_found" + ReasonTypeNotFound ReasonType = "notFound" // ReasonTypeAlreadyExists means the resource you are creating already exists. // Details (optional): // "kind" string - the kind attribute of the conflicting resource // "id" string - the identifier of the conflicting resource // Status code 409 - ReasonTypeAlreadyExists ReasonType = "already_exists" + ReasonTypeAlreadyExists ReasonType = "alreadyExists" // ResourceTypeConflict means the requested update operation cannot be completed // due to a conflict in the operation. The client may need to alter the request. diff --git a/pkg/apiserver/errors_test.go b/pkg/apiserver/errors_test.go index 7c7cd7eb86b..295560ffc4f 100644 --- a/pkg/apiserver/errors_test.go +++ b/pkg/apiserver/errors_test.go @@ -18,7 +18,10 @@ package apiserver import ( "errors" + "fmt" "testing" + + "github.com/GoogleCloudPlatform/kubernetes/pkg/api" ) func TestErrorNew(t *testing.T) { @@ -30,7 +33,7 @@ func TestErrorNew(t *testing.T) { t.Errorf("expected to not be confict") } if IsNotFound(err) { - t.Errorf("expected to not be not_found") + t.Errorf(fmt.Sprintf("expected to not be %s", api.ReasonTypeNotFound)) } if !IsConflict(NewConflictErr("test", "2", errors.New("message"))) {