operator-sdk icon indicating copy to clipboard operation
operator-sdk copied to clipboard

[refactor] Use CR manager.Runnable to start Ansible servers

Open asmacdo opened this issue 2 years ago • 1 comments

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.

asmacdo avatar Jan 26 '22 14:01 asmacdo

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

asmacdo avatar Jan 26 '22 21:01 asmacdo

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

openshift-bot avatar Oct 19 '22 01:10 openshift-bot

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

openshift-bot avatar Nov 18 '22 08:11 openshift-bot

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 avatar Dec 19 '22 00:12 openshift-bot

@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.

openshift-ci[bot] avatar Dec 19 '22 00:12 openshift-ci[bot]