utils

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: Apache-2.0 Imports: 15 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 added in v0.5.0

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.

func ObjectRef added in v0.6.0

func ToDNS1123Subdomain added in v0.6.0

func ToDNS1123Subdomain(name string) string

Converts 'name' to a valid DNS1123 subdomain, required for object names in K8s.

Types

type RunnableServer added in v0.5.0

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 added in v0.5.0

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

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

Jump to

Keyboard shortcuts

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