|
9 | 9 | "k8s.io/apimachinery/pkg/util/validation/field"
|
10 | 10 | "k8s.io/apiserver/pkg/authentication/user"
|
11 | 11 | apirequest "k8s.io/apiserver/pkg/endpoints/request"
|
12 |
| - kapi "k8s.io/kubernetes/pkg/api" |
13 | 12 | authorizationapi "k8s.io/kubernetes/pkg/apis/authorization"
|
14 | 13 |
|
15 | 14 | routeapi "github.com/openshift/origin/pkg/route/apis/route"
|
@@ -88,21 +87,21 @@ func TestEmptyDefaultCACertificate(t *testing.T) {
|
88 | 87 | },
|
89 | 88 | }
|
90 | 89 | for i, testCase := range testCases {
|
91 |
| - copied, _ := kapi.Scheme.Copy(testCase.route) |
92 |
| - if err := DecorateLegacyRouteWithEmptyDestinationCACertificates(copied.(*routeapi.Route)); err != nil { |
| 90 | + copied := testCase.route.DeepCopy() |
| 91 | + if err := DecorateLegacyRouteWithEmptyDestinationCACertificates(copied); err != nil { |
93 | 92 | t.Errorf("%d: unexpected error: %v", i, err)
|
94 | 93 | continue
|
95 | 94 | }
|
96 |
| - routeStrategy{}.PrepareForCreate(nil, copied.(*routeapi.Route)) |
| 95 | + routeStrategy{}.PrepareForCreate(nil, copied) |
97 | 96 | if !reflect.DeepEqual(testCase.route, copied) {
|
98 | 97 | t.Errorf("%d: unexpected change: %#v", i, copied)
|
99 | 98 | continue
|
100 | 99 | }
|
101 |
| - if err := DecorateLegacyRouteWithEmptyDestinationCACertificates(copied.(*routeapi.Route)); err != nil { |
| 100 | + if err := DecorateLegacyRouteWithEmptyDestinationCACertificates(copied); err != nil { |
102 | 101 | t.Errorf("%d: unexpected error: %v", i, err)
|
103 | 102 | continue
|
104 | 103 | }
|
105 |
| - routeStrategy{}.PrepareForUpdate(nil, copied.(*routeapi.Route), &routeapi.Route{}) |
| 104 | + routeStrategy{}.PrepareForUpdate(nil, copied, &routeapi.Route{}) |
106 | 105 | if !reflect.DeepEqual(testCase.route, copied) {
|
107 | 106 | t.Errorf("%d: unexpected change: %#v", i, copied)
|
108 | 107 | continue
|
|
0 commit comments