Go Operator Tutorial Page: Incorrect Link(s) and some file path corrections
harshvijaythakkar opened this issue · 2 comments
What is the URL of the document?
Which section(s) is the issue in?
What needs fixing?
The latest operator-sdk version: "v1.34.0"
is pointing to wrong link for memcached_controller.go
file.
Additional context
First Issue
When I click on memcached_controller.go it is giving 404 not found error. On the "latest" branch
of operator-sdk repository under testdata
path I don't see go/v3
folder.
The correct file location of memcached_controller.go
file is under testdata/go/v4/memcached-operator/internal/controller/memcached_controller.go
On documentation I see following text
For this example replace the generated controller file controllers/memcached_controller.go with the example memcached_controller.go implementation.
I think it needs to be changed to
For this example replace the generated controller file internal/controller/memcached_controller.go with the example memcached_controller.go implementation.
Second Issue
On documentation I see following text
The SetupWithManager() function in controllers/memcached_controller.go specifies how the controller is built to watch a CR and other resources that are owned and managed by that controller.
I think it needs to be changed to
The SetupWithManager() function in internal/controllers/memcached_controller.go specifies how the controller is built to watch a CR and other resources that are owned and managed by that controller.
If my understanding is correct I think I can also make changes but just want to confirm that my understanding is correct before raising PR for changes.
Also, the tutorial is incompatible with go v1.22: #6681
I think a warning would save time for many of us.
And the namespace scoping as described in the tutorial also doesn't work anymore. Please update to follow https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/manager#example-New-LimitToNamespaces