utils

package
v0.0.0-...-157142f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClusterDomainName

func GetClusterDomainName() string

GetClusterDomainName returns cluster's domain name or an error Closes issue: https://github.com/knative/eventing/issues/714

func NewBlockingStart

func NewBlockingStart(logger *zap.Logger, runnable manager.Runnable) manager.Runnable

NewBlockingStart creates a wrapper around the provided runnable that will block until either the runnable returns a non-nil error or the stop channel is closed.

Types

type RunnableServer

type RunnableServer struct {
	// Server is the http.Server to wrap.
	*http.Server

	// ServeFunc is the function used to start the http.Server. If nil,
	// ListenAndServe() will be used.
	ServeFunc func() error

	// ShutdownTimeout is the duration to wait for the http.Server to gracefully
	// shut down when the stop channel is closed. If this is zero or negative,
	// the http.Server will be immediately closed instead.
	ShutdownTimeout time.Duration

	// WaitGroup is a temporary workaround for Manager returning immediately
	// without waiting for Runnables to stop. See
	// https://github.com/kubernetes-sigs/controller-runtime/issues/350.
	WaitGroup *sync.WaitGroup
}

RunnableServer is a small wrapper around http.Server so that it matches the manager.Runnable interface.

func (*RunnableServer) Start

func (r *RunnableServer) Start(stopCh <-chan struct{}) error

Start the server. The server will be shut down when StopCh is closed.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL