<p>I'm doing some unit testing and part of the function does this -</p>
<pre><code>    o := &amp;corev1.Secret{}
    if err := c.Scheme.Convert(c.Object, o, nil); err != nil {
        return o, err
    }

</code></pre>
<p>When I'm running the unit test it's throwing this error <code>&amp;runtime.notRegisteredErr{schemeName:&quot;pkg/runtime/scheme.go:101&quot;, gvk:schema.GroupVersionKind{Group:&quot;&quot;, Version:&quot;v1&quot;, Kind:&quot;secret&quot;}, target:runtime.GroupVersioner(nil)</code></p>
<p>even though I generate a new schema with CoreV1 Secret &amp; SecretList</p>
<pre><code>func schemeGet() *runtime.Scheme {
    s := runtime.NewScheme()
    s.AddKnownTypes(corev1.SchemeGroupVersion,
        &amp;corev1.Secret{},
        &amp;corev1.SecretList{},
    )
    return s
}
</code></pre>
<p>Any help is appreciated.</p>
<p>Thanks</p>

kotyara85
<p>I think the right way is create a <code>Mock</code> of <code>runtime.Scheme</code> 👉🏻 tests will be more independent.</p>
