From 20c7d7a83b770e1489206ec8769efd13c72587db Mon Sep 17 00:00:00 2001 From: Weston Haught Date: Thu, 7 May 2020 09:07:15 -0700 Subject: [PATCH 1/4] implement krshaped for networking --- .../v1alpha1/certificate_lifecycle.go | 5 +++ .../v1alpha1/certificate_lifecycle_test.go | 8 ++++ .../networking/v1alpha1/certificate_types.go | 13 ++++++ .../v1alpha1/certificate_types_test.go | 42 +++++++++++++++++++ .../networking/v1alpha1/ingress_lifecycle.go | 5 +++ .../v1alpha1/ingress_lifecycle_test.go | 8 ++++ pkg/apis/networking/v1alpha1/ingress_types.go | 13 ++++++ .../networking/v1alpha1/ingress_types_test.go | 42 +++++++++++++++++++ .../v1alpha1/serverlessservice_lifecycle.go | 5 +++ .../serverlessservice_lifecycle_test.go | 9 ++++ .../v1alpha1/serverlessservice_types.go | 13 ++++++ .../v1alpha1/serverlessservice_types_test.go | 42 +++++++++++++++++++ 12 files changed, 205 insertions(+) create mode 100644 pkg/apis/networking/v1alpha1/certificate_types_test.go create mode 100644 pkg/apis/networking/v1alpha1/ingress_types_test.go create mode 100644 pkg/apis/networking/v1alpha1/serverlessservice_types_test.go diff --git a/pkg/apis/networking/v1alpha1/certificate_lifecycle.go b/pkg/apis/networking/v1alpha1/certificate_lifecycle.go index 9a0a851f327a..098bbbdc0e51 100644 --- a/pkg/apis/networking/v1alpha1/certificate_lifecycle.go +++ b/pkg/apis/networking/v1alpha1/certificate_lifecycle.go @@ -69,6 +69,11 @@ const ( var certificateCondSet = apis.NewLivingConditionSet(CertificateConditionReady) +// GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface. +func (*Certificate) GetConditionSet() apis.ConditionSet { + return certificateCondSet +} + // GetGroupVersionKind returns the GroupVersionKind of Certificate. func (c *Certificate) GetGroupVersionKind() schema.GroupVersionKind { return SchemeGroupVersion.WithKind("Certificate") diff --git a/pkg/apis/networking/v1alpha1/certificate_lifecycle_test.go b/pkg/apis/networking/v1alpha1/certificate_lifecycle_test.go index 9320b8f1aad6..eb85817fe39b 100644 --- a/pkg/apis/networking/v1alpha1/certificate_lifecycle_test.go +++ b/pkg/apis/networking/v1alpha1/certificate_lifecycle_test.go @@ -45,6 +45,14 @@ func TestCertificateDuckTypes(t *testing.T) { } } +func TestCertificateGetConditionSet(t *testing.T) { + r := &Certificate{} + want := apis.ConditionReady + if got := r.GetConditionSet().GetTopLevelConditionType(); got != want { + t.Errorf("got: %v, want: %v", got, want) + } +} + func TestCertificateGetGroupVersionKind(t *testing.T) { c := Certificate{} expected := SchemeGroupVersion.WithKind("Certificate") diff --git a/pkg/apis/networking/v1alpha1/certificate_types.go b/pkg/apis/networking/v1alpha1/certificate_types.go index d479eb5a6329..4691da7cbe80 100644 --- a/pkg/apis/networking/v1alpha1/certificate_types.go +++ b/pkg/apis/networking/v1alpha1/certificate_types.go @@ -57,6 +57,9 @@ var ( // Check that we can create OwnerReferences to a Certificate.. _ kmeta.OwnerRefable = (*Certificate)(nil) + + // Check that the type conforms to the duck Knative Resource shape. + _ duckv1.KRShaped = (*Certificate)(nil) ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -116,3 +119,13 @@ type HTTP01Challenge struct { // ServicePort is the port of the service to serve HTTP01 challenge requests. ServicePort intstr.IntOrString `json:"servicePort,omitempty"` } + +// GetTypeMeta retrieves the ObjectMeta of the Certificate. Implements the KRShaped interface. +func (t *Certificate) GetTypeMeta() *metav1.TypeMeta { + return &t.TypeMeta +} + +// GetStatus retrieves the status of the Certificate. Implements the KRShaped interface. +func (t *Certificate) GetStatus() *duckv1.Status { + return &t.Status.Status +} diff --git a/pkg/apis/networking/v1alpha1/certificate_types_test.go b/pkg/apis/networking/v1alpha1/certificate_types_test.go new file mode 100644 index 000000000000..1e2b5a3331b5 --- /dev/null +++ b/pkg/apis/networking/v1alpha1/certificate_types_test.go @@ -0,0 +1,42 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package v1alpha1 + +import ( + "testing" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func TestCertificateGetStatus(t *testing.T) { + r := &Certificate{ + Status: CertificateStatus{}, + } + want := &r.Status.Status + if got := r.GetStatus(); got != want { + t.Errorf("got: %v, want: %v", got, want) + } +} + +func TestCertificateGetObjectMeta(t *testing.T) { + r := &Certificate{ + TypeMeta: metav1.TypeMeta{}, + } + want := &r.TypeMeta + if got := r.GetTypeMeta(); got != want { + t.Errorf("got: %v, want: %v", got, want) + } +} diff --git a/pkg/apis/networking/v1alpha1/ingress_lifecycle.go b/pkg/apis/networking/v1alpha1/ingress_lifecycle.go index 45756f736dfa..da71e12ebd46 100644 --- a/pkg/apis/networking/v1alpha1/ingress_lifecycle.go +++ b/pkg/apis/networking/v1alpha1/ingress_lifecycle.go @@ -28,6 +28,11 @@ var ingressCondSet = apis.NewLivingConditionSet( IngressConditionLoadBalancerReady, ) +// GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface. +func (*Ingress) GetConditionSet() apis.ConditionSet { + return ingressCondSet +} + // GetGroupVersionKind returns SchemeGroupVersion of an Ingress func (i *Ingress) GetGroupVersionKind() schema.GroupVersionKind { return SchemeGroupVersion.WithKind("Ingress") diff --git a/pkg/apis/networking/v1alpha1/ingress_lifecycle_test.go b/pkg/apis/networking/v1alpha1/ingress_lifecycle_test.go index 8c1c9793be0c..190218a79f7b 100644 --- a/pkg/apis/networking/v1alpha1/ingress_lifecycle_test.go +++ b/pkg/apis/networking/v1alpha1/ingress_lifecycle_test.go @@ -45,6 +45,14 @@ func TestIngressDuckTypes(t *testing.T) { } } +func TestIngressGetConditionSet(t *testing.T) { + r := &Ingress{} + want := apis.ConditionReady + if got := r.GetConditionSet().GetTopLevelConditionType(); got != want { + t.Errorf("got: %v, want: %v", got, want) + } +} + func TestIngressGetGroupVersionKind(t *testing.T) { ci := Ingress{} expected := SchemeGroupVersion.WithKind("Ingress") diff --git a/pkg/apis/networking/v1alpha1/ingress_types.go b/pkg/apis/networking/v1alpha1/ingress_types.go index 5003dfdcc1d4..1ddf40e870bc 100644 --- a/pkg/apis/networking/v1alpha1/ingress_types.go +++ b/pkg/apis/networking/v1alpha1/ingress_types.go @@ -60,6 +60,9 @@ var ( // Check that we can create OwnerReferences to a Ingress. _ kmeta.OwnerRefable = (*Ingress)(nil) + + // Check that the type conforms to the duck Knative Resource shape. + _ duckv1.KRShaped = (*Ingress)(nil) ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -342,3 +345,13 @@ const ( // IngressConditionLoadBalancerReady is set when the Ingress has a ready LoadBalancer. IngressConditionLoadBalancerReady apis.ConditionType = "LoadBalancerReady" ) + +// GetTypeMeta retrieves the ObjectMeta of the Ingress. Implements the KRShaped interface. +func (t *Ingress) GetTypeMeta() *metav1.TypeMeta { + return &t.TypeMeta +} + +// GetStatus retrieves the status of the Ingress. Implements the KRShaped interface. +func (t *Ingress) GetStatus() *duckv1.Status { + return &t.Status.Status +} diff --git a/pkg/apis/networking/v1alpha1/ingress_types_test.go b/pkg/apis/networking/v1alpha1/ingress_types_test.go new file mode 100644 index 000000000000..921d9f2cc137 --- /dev/null +++ b/pkg/apis/networking/v1alpha1/ingress_types_test.go @@ -0,0 +1,42 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package v1alpha1 + +import ( + "testing" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func TestIngressGetStatus(t *testing.T) { + r := &Ingress{ + Status: IngressStatus{}, + } + want := &r.Status.Status + if got := r.GetStatus(); got != want { + t.Errorf("got: %v, want: %v", got, want) + } +} + +func TestIngressGetObjectMeta(t *testing.T) { + r := &Ingress{ + TypeMeta: metav1.TypeMeta{}, + } + want := &r.TypeMeta + if got := r.GetTypeMeta(); got != want { + t.Errorf("got: %v, want: %v", got, want) + } +} diff --git a/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle.go b/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle.go index fd32fb9b29b8..e521c85ad755 100644 --- a/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle.go +++ b/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle.go @@ -29,6 +29,11 @@ var serverlessServiceCondSet = apis.NewLivingConditionSet( ServerlessServiceConditionEndspointsPopulated, ) +// GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface. +func (*ServerlessService) GetConditionSet() apis.ConditionSet { + return serverlessServiceCondSet +} + // GetGroupVersionKind returns the GVK for the ServerlessService. func (ss *ServerlessService) GetGroupVersionKind() schema.GroupVersionKind { return SchemeGroupVersion.WithKind("ServerlessService") diff --git a/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle_test.go b/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle_test.go index 074aa0a52898..85cf47d76b45 100644 --- a/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle_test.go +++ b/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle_test.go @@ -20,6 +20,7 @@ import ( "time" "github.com/google/go-cmp/cmp" + "knative.dev/pkg/apis" "knative.dev/pkg/apis/duck" duckv1 "knative.dev/pkg/apis/duck/v1" apistest "knative.dev/pkg/apis/testing" @@ -44,6 +45,14 @@ func TestServerlessServiceDuckTypes(t *testing.T) { } } +func TestServerlessServiceGetConditionSet(t *testing.T) { + r := &ServerlessService{} + want := apis.ConditionReady + if got := r.GetConditionSet().GetTopLevelConditionType(); got != want { + t.Errorf("got: %v, want: %v", got, want) + } +} + func TestGetGroupVersionKind(t *testing.T) { ss := ServerlessService{} expected := SchemeGroupVersion.WithKind("ServerlessService") diff --git a/pkg/apis/networking/v1alpha1/serverlessservice_types.go b/pkg/apis/networking/v1alpha1/serverlessservice_types.go index 994992348657..8c2d0cd5a6ce 100644 --- a/pkg/apis/networking/v1alpha1/serverlessservice_types.go +++ b/pkg/apis/networking/v1alpha1/serverlessservice_types.go @@ -59,6 +59,9 @@ var ( // Check that we can create OwnerReferences to a ServerlessService. _ kmeta.OwnerRefable = (*ServerlessService)(nil) + + // Check that the type conforms to the duck Knative Resource shape. + _ duckv1.KRShaped = (*ServerlessService)(nil) ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -139,3 +142,13 @@ const ( // (e.g. due to target burst capacity settings). ActivatorEndpointsPopulated apis.ConditionType = "ActivatorEndpointsPopulated" ) + +// GetTypeMeta retrieves the ObjectMeta of the ServerlessService. Implements the KRShaped interface. +func (t *ServerlessService) GetTypeMeta() *metav1.TypeMeta { + return &t.TypeMeta +} + +// GetStatus retrieves the status of the ServerlessService. Implements the KRShaped interface. +func (t *ServerlessService) GetStatus() *duckv1.Status { + return &t.Status.Status +} diff --git a/pkg/apis/networking/v1alpha1/serverlessservice_types_test.go b/pkg/apis/networking/v1alpha1/serverlessservice_types_test.go new file mode 100644 index 000000000000..f3cf73036800 --- /dev/null +++ b/pkg/apis/networking/v1alpha1/serverlessservice_types_test.go @@ -0,0 +1,42 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package v1alpha1 + +import ( + "testing" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func TestServerlessServiceGetStatus(t *testing.T) { + r := &ServerlessService{ + Status: ServerlessServiceStatus{}, + } + want := &r.Status.Status + if got := r.GetStatus(); got != want { + t.Errorf("got: %v, want: %v", got, want) + } +} + +func TestServerlessServiceGetObjectMeta(t *testing.T) { + r := &ServerlessService{ + TypeMeta: metav1.TypeMeta{}, + } + want := &r.TypeMeta + if got := r.GetTypeMeta(); got != want { + t.Errorf("got: %v, want: %v", got, want) + } +} From 4c67b9aaafbd7589357c5d910b8803e1ac383084 Mon Sep 17 00:00:00 2001 From: Weston Haught Date: Thu, 7 May 2020 09:38:53 -0700 Subject: [PATCH 2/4] update tests with review feedback --- .../v1alpha1/certificate_lifecycle_test.go | 6 +++--- .../networking/v1alpha1/certificate_types_test.go | 12 ++++++------ .../networking/v1alpha1/ingress_lifecycle_test.go | 6 +++--- pkg/apis/networking/v1alpha1/ingress_types_test.go | 13 ++++++------- .../v1alpha1/serverlessservice_lifecycle_test.go | 7 +++---- .../v1alpha1/serverlessservice_types_test.go | 12 ++++++------ 6 files changed, 27 insertions(+), 29 deletions(-) diff --git a/pkg/apis/networking/v1alpha1/certificate_lifecycle_test.go b/pkg/apis/networking/v1alpha1/certificate_lifecycle_test.go index eb85817fe39b..eed31127ace9 100644 --- a/pkg/apis/networking/v1alpha1/certificate_lifecycle_test.go +++ b/pkg/apis/networking/v1alpha1/certificate_lifecycle_test.go @@ -47,9 +47,9 @@ func TestCertificateDuckTypes(t *testing.T) { func TestCertificateGetConditionSet(t *testing.T) { r := &Certificate{} - want := apis.ConditionReady - if got := r.GetConditionSet().GetTopLevelConditionType(); got != want { - t.Errorf("got: %v, want: %v", got, want) + + if got, want := r.GetConditionSet().GetTopLevelConditionType(), apis.ConditionReady; got != want { + t.Errorf("GotConditionSet=%v, want=%v", got, want) } } diff --git a/pkg/apis/networking/v1alpha1/certificate_types_test.go b/pkg/apis/networking/v1alpha1/certificate_types_test.go index 1e2b5a3331b5..f14385455c5d 100644 --- a/pkg/apis/networking/v1alpha1/certificate_types_test.go +++ b/pkg/apis/networking/v1alpha1/certificate_types_test.go @@ -25,9 +25,9 @@ func TestCertificateGetStatus(t *testing.T) { r := &Certificate{ Status: CertificateStatus{}, } - want := &r.Status.Status - if got := r.GetStatus(); got != want { - t.Errorf("got: %v, want: %v", got, want) + + if got, want := r.GetStatus(), &r.Status.Status; got != want { + t.Errorf("GotStatus=%v, want=%v", got, want) } } @@ -35,8 +35,8 @@ func TestCertificateGetObjectMeta(t *testing.T) { r := &Certificate{ TypeMeta: metav1.TypeMeta{}, } - want := &r.TypeMeta - if got := r.GetTypeMeta(); got != want { - t.Errorf("got: %v, want: %v", got, want) + + if got, want := r.GetTypeMeta(), &r.TypeMeta; got != want { + t.Errorf("GotTypeMeta=%v, want=%v", got, want) } } diff --git a/pkg/apis/networking/v1alpha1/ingress_lifecycle_test.go b/pkg/apis/networking/v1alpha1/ingress_lifecycle_test.go index 190218a79f7b..c4bf343dacde 100644 --- a/pkg/apis/networking/v1alpha1/ingress_lifecycle_test.go +++ b/pkg/apis/networking/v1alpha1/ingress_lifecycle_test.go @@ -47,9 +47,9 @@ func TestIngressDuckTypes(t *testing.T) { func TestIngressGetConditionSet(t *testing.T) { r := &Ingress{} - want := apis.ConditionReady - if got := r.GetConditionSet().GetTopLevelConditionType(); got != want { - t.Errorf("got: %v, want: %v", got, want) + + if got, want := r.GetConditionSet().GetTopLevelConditionType(), apis.ConditionReady; got != want { + t.Errorf("GotConditionSet=%v, want=%v", got, want) } } diff --git a/pkg/apis/networking/v1alpha1/ingress_types_test.go b/pkg/apis/networking/v1alpha1/ingress_types_test.go index 921d9f2cc137..2ea100a6a9c5 100644 --- a/pkg/apis/networking/v1alpha1/ingress_types_test.go +++ b/pkg/apis/networking/v1alpha1/ingress_types_test.go @@ -25,9 +25,9 @@ func TestIngressGetStatus(t *testing.T) { r := &Ingress{ Status: IngressStatus{}, } - want := &r.Status.Status - if got := r.GetStatus(); got != want { - t.Errorf("got: %v, want: %v", got, want) + + if got, want := r.GetStatus(), &r.Status.Status; got != want { + t.Errorf("GotStatus=%v, want=%v", got, want) } } @@ -35,8 +35,7 @@ func TestIngressGetObjectMeta(t *testing.T) { r := &Ingress{ TypeMeta: metav1.TypeMeta{}, } - want := &r.TypeMeta - if got := r.GetTypeMeta(); got != want { - t.Errorf("got: %v, want: %v", got, want) + + if got, want := r.GetTypeMeta(), &r.TypeMeta; got != want { + t.Errorf("GotTypeMeta=%v, want=%v", got, want) } -} diff --git a/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle_test.go b/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle_test.go index 85cf47d76b45..3e81af304473 100644 --- a/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle_test.go +++ b/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle_test.go @@ -47,11 +47,10 @@ func TestServerlessServiceDuckTypes(t *testing.T) { func TestServerlessServiceGetConditionSet(t *testing.T) { r := &ServerlessService{} - want := apis.ConditionReady - if got := r.GetConditionSet().GetTopLevelConditionType(); got != want { - t.Errorf("got: %v, want: %v", got, want) + + if got, want := r.GetConditionSet().GetTopLevelConditionType(), apis.ConditionReady; got != want { + t.Errorf("GotConditionSet=%v, want=%v", got, want) } -} func TestGetGroupVersionKind(t *testing.T) { ss := ServerlessService{} diff --git a/pkg/apis/networking/v1alpha1/serverlessservice_types_test.go b/pkg/apis/networking/v1alpha1/serverlessservice_types_test.go index f3cf73036800..b862630a2954 100644 --- a/pkg/apis/networking/v1alpha1/serverlessservice_types_test.go +++ b/pkg/apis/networking/v1alpha1/serverlessservice_types_test.go @@ -25,9 +25,9 @@ func TestServerlessServiceGetStatus(t *testing.T) { r := &ServerlessService{ Status: ServerlessServiceStatus{}, } - want := &r.Status.Status - if got := r.GetStatus(); got != want { - t.Errorf("got: %v, want: %v", got, want) + + if got, want := r.GetStatus(), &r.Status.Status; got != want { + t.Errorf("GotStatus=%v, want=%v", got, want) } } @@ -35,8 +35,8 @@ func TestServerlessServiceGetObjectMeta(t *testing.T) { r := &ServerlessService{ TypeMeta: metav1.TypeMeta{}, } - want := &r.TypeMeta - if got := r.GetTypeMeta(); got != want { - t.Errorf("got: %v, want: %v", got, want) + + if got, want := r.GetTypeMeta(), &r.TypeMeta; got != want { + t.Errorf("GotTypeMeta=%v, want=%v", got, want) } } From ee417ccaec6e1bf690da7c58f2e301c1a9ea877a Mon Sep 17 00:00:00 2001 From: Weston Haught Date: Thu, 7 May 2020 09:40:09 -0700 Subject: [PATCH 3/4] Update pkg/apis/networking/v1alpha1/serverlessservice_lifecycle_test.go Co-authored-by: Matt Moore --- pkg/apis/networking/v1alpha1/serverlessservice_lifecycle_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle_test.go b/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle_test.go index 3e81af304473..e135c53ffff6 100644 --- a/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle_test.go +++ b/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle_test.go @@ -47,7 +47,6 @@ func TestServerlessServiceDuckTypes(t *testing.T) { func TestServerlessServiceGetConditionSet(t *testing.T) { r := &ServerlessService{} - if got, want := r.GetConditionSet().GetTopLevelConditionType(), apis.ConditionReady; got != want { t.Errorf("GotConditionSet=%v, want=%v", got, want) } From 673544b86aaa1af1e80532ac42acf1c322003a46 Mon Sep 17 00:00:00 2001 From: Weston Haught Date: Thu, 7 May 2020 09:52:11 -0700 Subject: [PATCH 4/4] put back weird truncated }s --- pkg/apis/networking/v1alpha1/ingress_types_test.go | 1 + pkg/apis/networking/v1alpha1/serverlessservice_lifecycle_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg/apis/networking/v1alpha1/ingress_types_test.go b/pkg/apis/networking/v1alpha1/ingress_types_test.go index 2ea100a6a9c5..9ee4bc096944 100644 --- a/pkg/apis/networking/v1alpha1/ingress_types_test.go +++ b/pkg/apis/networking/v1alpha1/ingress_types_test.go @@ -39,3 +39,4 @@ func TestIngressGetObjectMeta(t *testing.T) { if got, want := r.GetTypeMeta(), &r.TypeMeta; got != want { t.Errorf("GotTypeMeta=%v, want=%v", got, want) } +} diff --git a/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle_test.go b/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle_test.go index e135c53ffff6..56408e07a460 100644 --- a/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle_test.go +++ b/pkg/apis/networking/v1alpha1/serverlessservice_lifecycle_test.go @@ -50,6 +50,7 @@ func TestServerlessServiceGetConditionSet(t *testing.T) { if got, want := r.GetConditionSet().GetTopLevelConditionType(), apis.ConditionReady; got != want { t.Errorf("GotConditionSet=%v, want=%v", got, want) } +} func TestGetGroupVersionKind(t *testing.T) { ss := ServerlessService{}