operator-sdk
operator-sdk copied to clipboard
[refactor] Use CR manager.Runnable to start Ansible servers
Currently, the proxy server is starting the server manually, but we can use controller runtime Runnables to do this for us.
I have also just added another server that is started manually in the custom-metrics PR https://github.com/operator-framework/operator-sdk/pull/5438. The API server should also be started with Runnables.
Getting started tips from slack. Ty to @ryantking
package metrics
type Server struct {
Addr string
Port uint
}
func NewServer(addr string, port uint) Server { /* ... */ }
func (srv Server) Run(ctx context.Context) error {
// run the server
}
That will implement the controller-runtime manager.Runnable interface
https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/manager#Runnable
Then before you start the manager, you just “Add” the runnable https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/manager#example-Manager-Add
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen
.
If this issue is safe to close now please do so with /close
.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen
.
If this issue is safe to close now please do so with /close
.
/lifecycle rotten /remove-lifecycle stale
Rotten issues close after 30d of inactivity.
Reopen the issue by commenting /reopen
.
Mark the issue as fresh by commenting /remove-lifecycle rotten
.
Exclude this issue from closing again by commenting /lifecycle frozen
.
/close
@openshift-bot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity.
Reopen the issue by commenting
/reopen
. Mark the issue as fresh by commenting/remove-lifecycle rotten
. Exclude this issue from closing again by commenting/lifecycle frozen
./close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.