Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update serving to use new FieldError.Also #2067

Merged
merged 3 commits into from
Sep 20, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
all tests work again.
  • Loading branch information
Scott Nichols committed Sep 20, 2018
commit 3bf7fee3bc36af0b7604d5bf9dae2e3e86e56497
4 changes: 2 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ required = [

[[constraint]]
name = "github.com/knative/pkg"
# HEAD as of 2018-09-18
revision = "c15d7c8f2220a7578b33504df6edefa948c845ae"
# HEAD as of 2018-09-20
revision = "70762ec49b3f1738916e8cb727a646ece484d95e"

[[constraint]]
name = "github.com/knative/caching"
Expand Down
6 changes: 3 additions & 3 deletions pkg/apis/autoscaling/v1alpha1/kpa_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func TestPodAutoscalerSpecValidation(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
got := test.rs.Validate()
if diff := cmp.Diff(test.want, got); diff != "" {
if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
t.Errorf("Validate (-want, +got) = %v", diff)
}
})
Expand Down Expand Up @@ -196,7 +196,7 @@ func TestPodAutoscalerValidation(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
got := test.r.Validate()
if diff := cmp.Diff(test.want, got); diff != "" {
if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
t.Errorf("Validate (-want, +got) = %v", diff)
}
})
Expand Down Expand Up @@ -398,7 +398,7 @@ func TestImmutableFields(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
got := test.new.CheckImmutableFields(test.old)
if diff := cmp.Diff(test.want, got); diff != "" {
if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
t.Errorf("Validate (-want, +got) = %v", diff)
}
})
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/serving/v1alpha1/configuration_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func TestConfigurationSpecValidation(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
got := test.c.Validate()
if diff := cmp.Diff(test.want, got); diff != "" {
if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
t.Errorf("validateContainer (-want, +got) = %v", diff)
}
})
Expand Down Expand Up @@ -142,7 +142,7 @@ func TestConfigurationValidation(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
got := test.c.Validate()
if diff := cmp.Diff(test.want, got); diff != "" {
if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
t.Errorf("validateContainer (-want, +got) = %v", diff)
}
})
Expand Down
16 changes: 8 additions & 8 deletions pkg/apis/serving/v1alpha1/revision_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func TestContainerValidation(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
got := validateContainer(test.c)
if diff := cmp.Diff(test.want, got); diff != "" {
if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
t.Errorf("validateContainer (-want, +got) = %v", diff)
}
})
Expand Down Expand Up @@ -192,7 +192,7 @@ func TestConcurrencyModelValidation(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
got := test.cm.Validate()
if diff := cmp.Diff(test.want, got); diff != "" {
if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
t.Errorf("Validate (-want, +got) = %v", diff)
}
})
Expand Down Expand Up @@ -248,7 +248,7 @@ func TestContainerConcurrencyValidation(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
got := ValidateContainerConcurrency(test.cc, test.cm)
if diff := cmp.Diff(test.want, got); diff != "" {
if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
t.Errorf("Validate (-want, +got) = %v", diff)
}
})
Expand Down Expand Up @@ -289,7 +289,7 @@ func TestServingStateValidation(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
got := test.ss.Validate()
if diff := cmp.Diff(test.want, got); diff != "" {
if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
t.Errorf("Validate (-want, +got) = %v", diff)
}
})
Expand Down Expand Up @@ -339,7 +339,7 @@ func TestRevisionSpecValidation(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
got := test.rs.Validate()
if diff := cmp.Diff(test.want, got); diff != "" {
if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
t.Errorf("Validate (-want, +got) = %v", diff)
}
})
Expand Down Expand Up @@ -383,7 +383,7 @@ func TestRevisionTemplateSpecValidation(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
got := test.rts.Validate()
if diff := cmp.Diff(test.want, got); diff != "" {
if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
t.Errorf("Validate (-want, +got) = %v", diff)
}
})
Expand Down Expand Up @@ -443,7 +443,7 @@ func TestRevisionValidation(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
got := test.r.Validate()
if diff := cmp.Diff(test.want, got); diff != "" {
if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
t.Errorf("Validate (-want, +got) = %v", diff)
}
})
Expand Down Expand Up @@ -609,7 +609,7 @@ func TestImmutableFields(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
got := test.new.CheckImmutableFields(test.old)
if diff := cmp.Diff(test.want, got); diff != "" {
if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
t.Errorf("Validate (-want, +got) = %v", diff)
}
})
Expand Down
6 changes: 3 additions & 3 deletions pkg/apis/serving/v1alpha1/route_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func TestRouteValidation(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
got := test.r.Validate()
if diff := cmp.Diff(test.want, got); diff != "" {
if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
t.Errorf("Validate (-want, +got) = %v", diff)
}
})
Expand Down Expand Up @@ -224,7 +224,7 @@ func TestRouteSpecValidation(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
got := test.rs.Validate()
if diff := cmp.Diff(test.want, got); diff != "" {
if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
t.Errorf("Validate (-want, +got) = %v", diff)
}
})
Expand Down Expand Up @@ -305,7 +305,7 @@ func TestTrafficTargetValidation(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
got := test.tt.Validate()
if diff := cmp.Diff(test.want, got); diff != "" {
if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
t.Errorf("Validate (-want, +got) = %v", diff)
}
})
Expand Down
6 changes: 3 additions & 3 deletions pkg/apis/serving/v1alpha1/service_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func TestServiceValidation(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
got := test.s.Validate()
if diff := cmp.Diff(test.want, got); diff != "" {
if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
t.Errorf("validateContainer (-want, +got) = %v", diff)
}
})
Expand Down Expand Up @@ -215,7 +215,7 @@ func TestRunLatestTypeValidation(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
got := test.rlt.Validate()
if diff := cmp.Diff(test.want, got); diff != "" {
if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
t.Errorf("validateContainer (-want, +got) = %v", diff)
}
})
Expand Down Expand Up @@ -278,7 +278,7 @@ func TestPinnedTypeValidation(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
got := test.pt.Validate()
if diff := cmp.Diff(test.want, got); diff != "" {
if diff := cmp.Diff(test.want.Error(), got.Error()); diff != "" {
t.Errorf("validateContainer (-want, +got) = %v", diff)
}
})
Expand Down
90 changes: 72 additions & 18 deletions vendor/github.com/knative/pkg/apis/field_error.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.