utils

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateFixedName added in v0.8.0

func GenerateFixedName(owner metav1.Object, prefix string) string

GenerateFixedName generates a fixed name for the given owning resource and human readable prefix. The name's length will be short enough to be valid for K8s Services.

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

ToDNS1123Subdomain 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