Fix 'kube apply' panic on nil items

Bug 1146024 - https://bugzilla.redhat.com/show_bug.cgi?id=1146024
Correct

----- Original Message -----
> > +func (*FakeResource) IsAnAPIObject() {}
> > +
> > +func TestApplySendsData(t *testing.T) {
> > +	fakeScheme := runtime.NewScheme()
> > +	// TODO: The below should work with "v1beta1", "FakeResource" instead.
> > +	fakeScheme.AddKnownTypeWithName("", "", &FakeResource{})
> > +	fakeCodec := runtime.CodecFor(fakeScheme, "v1beta1")
> > +
> > +	received := make(chan bool, 1)
> > +	fakeServer := httptest.NewServer(http.HandlerFunc(func(w
> > http.ResponseWriter, r *http.Request) {
> > +		received <- true
> > +		if r.RequestURI != "/api/v1beta1/FakeMapping" {
> > +			t.Errorf("Wrong RESTClient RequestURI. Expected: %v, got: %v.",
> > "/api/v1beta1/FakeMapping", r.RequestURI)
> > +		}
> > +	}))
> > +	defer fakeServer.Close()
> 
> you mean in tests in general, correct?
> 
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/openshift/origin/pull/146/files#r18190312