mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
Rename validation 'New' funcs
This commit is contained in:
@@ -92,7 +92,7 @@ func TestNewInvalid(t *testing.T) {
|
||||
Details *unversioned.StatusDetails
|
||||
}{
|
||||
{
|
||||
validation.NewFieldDuplicate("field[0].name", "bar"),
|
||||
validation.NewDuplicateError("field[0].name", "bar"),
|
||||
&unversioned.StatusDetails{
|
||||
Kind: "kind",
|
||||
Name: "name",
|
||||
@@ -103,7 +103,7 @@ func TestNewInvalid(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
validation.NewFieldInvalid("field[0].name", "bar", "detail"),
|
||||
validation.NewInvalidError("field[0].name", "bar", "detail"),
|
||||
&unversioned.StatusDetails{
|
||||
Kind: "kind",
|
||||
Name: "name",
|
||||
@@ -114,7 +114,7 @@ func TestNewInvalid(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
validation.NewFieldNotFound("field[0].name", "bar"),
|
||||
validation.NewNotFoundError("field[0].name", "bar"),
|
||||
&unversioned.StatusDetails{
|
||||
Kind: "kind",
|
||||
Name: "name",
|
||||
@@ -125,7 +125,7 @@ func TestNewInvalid(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
validation.NewFieldNotSupported("field[0].name", "bar", nil),
|
||||
validation.NewNotSupportedError("field[0].name", "bar", nil),
|
||||
&unversioned.StatusDetails{
|
||||
Kind: "kind",
|
||||
Name: "name",
|
||||
@@ -136,7 +136,7 @@ func TestNewInvalid(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
validation.NewFieldRequired("field[0].name"),
|
||||
validation.NewRequiredError("field[0].name"),
|
||||
&unversioned.StatusDetails{
|
||||
Kind: "kind",
|
||||
Name: "name",
|
||||
|
||||
@@ -27,10 +27,10 @@ func ValidateEvent(event *api.Event) validation.ErrorList {
|
||||
// TODO: There is no namespace required for node.
|
||||
if event.InvolvedObject.Kind != "Node" &&
|
||||
event.Namespace != event.InvolvedObject.Namespace {
|
||||
allErrs = append(allErrs, validation.NewFieldInvalid("involvedObject.namespace", event.InvolvedObject.Namespace, "namespace does not match involvedObject"))
|
||||
allErrs = append(allErrs, validation.NewInvalidError("involvedObject.namespace", event.InvolvedObject.Namespace, "namespace does not match involvedObject"))
|
||||
}
|
||||
if !validation.IsDNS1123Subdomain(event.Namespace) {
|
||||
allErrs = append(allErrs, validation.NewFieldInvalid("namespace", event.Namespace, ""))
|
||||
allErrs = append(allErrs, validation.NewInvalidError("namespace", event.Namespace, ""))
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user