<p>So I was following along this tutorial (<a href="https://www.youtube.com/watch?v=KBTXBUVNF2I" rel="nofollow noreferrer">https://www.youtube.com/watch?v=KBTXBUVNF2I</a>) and after setting up the reconciler, when I execute "make run", I am getting the following error:</p>

<pre><code>/Users/sourav/go/bin/controller-gen object:headerFile=./hack/boilerplate.go.txt paths="./..."
go fmt ./...
go vet ./...
/Users/sourav/go/bin/controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
go run ./main.go
2020-03-15T22:13:29.111+0530 INFO controller-runtime.metrics metrics server is starting to listen {"addr": ":8080"}
2020-03-15T22:13:29.112+0530 INFO setup starting manager
2020-03-15T22:13:29.113+0530 INFO controller-runtime.manager starting metrics server {"path": "/metrics"}
2020-03-15T22:13:29.213+0530 INFO controller-runtime.controller Starting EventSource {"controller": "guestbook", "source": "kind source: /, Kind="}
2020-03-15T22:13:29.213+0530 INFO controller-runtime.controller Starting EventSource {"controller": "redis", "source": "kind source: /, Kind="}
2020-03-15T22:13:29.213+0530 INFO controller-runtime.controller Starting EventSource {"controller": "guestbook", "source": "kind source: /, Kind="}
2020-03-15T22:13:29.315+0530 INFO controller-runtime.controller Starting EventSource {"controller": "redis", "source": "kind source: /, Kind="}
2020-03-15T22:13:29.315+0530 INFO controller-runtime.controller Starting EventSource {"controller": "guestbook", "source": "kind source: /, Kind="}
2020-03-15T22:13:29.418+0530 INFO controller-runtime.controller Starting EventSource {"controller": "guestbook", "source": "kind source: /, Kind="}
2020-03-15T22:13:29.418+0530 INFO controller-runtime.controller Starting EventSource {"controller": "redis", "source": "kind source: /, Kind="}
2020-03-15T22:13:29.418+0530 INFO controller-runtime.controller Starting Controller {"controller": "guestbook"}
2020-03-15T22:13:29.418+0530 INFO controller-runtime.controller Starting Controller {"controller": "redis"}
2020-03-15T22:13:29.519+0530 INFO controller-runtime.controller Starting workers {"controller": "redis", "worker count": 1}
2020-03-15T22:13:29.519+0530 INFO controllers.Redis reconciling redis {"redis": "default/redis-sample"}
2020-03-15T22:13:29.523+0530 INFO controller-runtime.controller Starting workers {"controller": "guestbook", "worker count": 1}
2020-03-15T22:13:29.527+0530 ERROR controller-runtime.controller Reconciler error {"controller": "redis", "request": "default/redis-sample", "error": "415: Unsupported Media Type"}
github.com/go-logr/zapr.(*zapLogger).Error
/Users/sourav/go/pkg/mod/github.com/go-logr/zapr@v0.1.0/zapr.go:128
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
/Users/sourav/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:258
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
/Users/sourav/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:232
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker
/Users/sourav/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:211
k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1
/Users/sourav/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190913080033-27d36303b655/pkg/util/wait/wait.go:152
k8s.io/apimachinery/pkg/util/wait.JitterUntil
/Users/sourav/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190913080033-27d36303b655/pkg/util/wait/wait.go:153
k8s.io/apimachinery/pkg/util/wait.Until
/Users/sourav/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190913080033-27d36303b655/pkg/util/wait/wait.go:88
2020-03-15T22:13:30.528+0530 INFO controllers.Redis reconciling redis {"redis": "default/redis-sample"}
2020-03-15T22:13:30.548+0530 ERROR controller-runtime.controller Reconciler error {"controller": "redis", "request": "default/redis-sample", "error": "415: Unsupported Media Type"}
</code></pre>

<p>The error seems to originate from this line:</p>

<p><a href="https://github.com/DirectXMan12/kubebuilder-workshops/blob/605890232fb368a8ff00ac5e9879c8dfd90f904c/controllers/redis_controller.go#L73" rel="nofollow noreferrer">https://github.com/DirectXMan12/kubebuilder-workshops/blob/605890232fb368a8ff00ac5e9879c8dfd90f904c/controllers/redis_controller.go#L73</a></p>

<p>Any Idea what might be causing this error and how to solve it?</p>

DarthSett
<p>That is using a relatively new feature, make sure your kubernetes is very up to date and has server side apply enabled.</p>
