Add missing error handling in schema-related code

This commit is contained in:
Mikhail Mazurskiy
2018-06-03 14:59:58 +10:00
parent 3079c1df2f
commit bfe313d5f3
73 changed files with 208 additions and 119 deletions

View File

@@ -20,6 +20,8 @@ import (
"reflect"
"testing"
"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
@@ -53,7 +55,7 @@ func TestGetReference(t *testing.T) {
// then you run into trouble because the types aren't registered in the scheme by anything. This does the
// register manually to allow unit test execution
if _, _, err := legacyscheme.Scheme.ObjectKinds(&api.Pod{}); err != nil {
api.AddToScheme(legacyscheme.Scheme)
require.NoError(t, api.AddToScheme(legacyscheme.Scheme))
}
table := map[string]struct {