mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Merge pull request #1035 from satnam6502/master
Very minor change to use camelCase for ReasonType as suggested in issue ...
This commit is contained in:
commit
1118241dec
@ -436,14 +436,14 @@ const (
|
|||||||
// resource.
|
// resource.
|
||||||
// "id" string - the identifier of the missing resource
|
// "id" string - the identifier of the missing resource
|
||||||
// Status code 404
|
// Status code 404
|
||||||
ReasonTypeNotFound ReasonType = "not_found"
|
ReasonTypeNotFound ReasonType = "notFound"
|
||||||
|
|
||||||
// ReasonTypeAlreadyExists means the resource you are creating already exists.
|
// ReasonTypeAlreadyExists means the resource you are creating already exists.
|
||||||
// Details (optional):
|
// Details (optional):
|
||||||
// "kind" string - the kind attribute of the conflicting resource
|
// "kind" string - the kind attribute of the conflicting resource
|
||||||
// "id" string - the identifier of the conflicting resource
|
// "id" string - the identifier of the conflicting resource
|
||||||
// Status code 409
|
// Status code 409
|
||||||
ReasonTypeAlreadyExists ReasonType = "already_exists"
|
ReasonTypeAlreadyExists ReasonType = "alreadyExists"
|
||||||
|
|
||||||
// ResourceTypeConflict means the requested update operation cannot be completed
|
// ResourceTypeConflict means the requested update operation cannot be completed
|
||||||
// due to a conflict in the operation. The client may need to alter the request.
|
// due to a conflict in the operation. The client may need to alter the request.
|
||||||
|
@ -18,7 +18,10 @@ package apiserver
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestErrorNew(t *testing.T) {
|
func TestErrorNew(t *testing.T) {
|
||||||
@ -30,7 +33,7 @@ func TestErrorNew(t *testing.T) {
|
|||||||
t.Errorf("expected to not be confict")
|
t.Errorf("expected to not be confict")
|
||||||
}
|
}
|
||||||
if IsNotFound(err) {
|
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"))) {
|
if !IsConflict(NewConflictErr("test", "2", errors.New("message"))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user