From 3f0f119e423407b0a70bc8a270d1863f8687e94a Mon Sep 17 00:00:00 2001 From: Satnam Singh Date: Mon, 25 Aug 2014 16:57:13 -0700 Subject: [PATCH] Very minor change to use camelCase for ReasonType as suggested in issue #914. --- pkg/api/v1beta1/types.go | 4 ++-- pkg/apiserver/errors_test.go | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) 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"))) {