openshift

package
v0.0.0-...-0762dd7 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2016 License: Apache-2.0 Imports: 24 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Flags   = pflag.NewFlagSet("openshift-github-hooks", pflag.ContinueOnError)
	Factory = clientcmd.New(Flags)
)

init the factory early, to bind the flags

Functions

func DefaultOpenshiftPublicURL

func DefaultOpenshiftPublicURL() string

DefaultOpenshiftPublicURL returns the openshift public URL as defined in the master config - and exposed in the swagger API. Internally, this method will retrieve the swagger API to extract the public URL. If it can't be retrieved, it will either return an empty string, or the host of the server as defined by the client config.

func ExplodeOpenshiftWebhookURL

func ExplodeOpenshiftWebhookURL(url string) (namespace, buildconfig, secret string)

ExplodeOpenshiftWebhookURL explodes the given openshift webhook url and returns the namespace, buildconfig and webhook secret

func IsOpenshiftHook

func IsOpenshiftHook(hookURL string, openshiftPublicURL string) bool

IsOpenshiftHook returns true if the given hook URL is an Openshift hook URL that targets the given openshift instance (identified by its public URL)

Types

type BuildConfigsController

type BuildConfigsController struct {

	// BuildConfigsNamespacer is used to list/watch the BCs
	// and build the BC's hook URL.
	BuildConfigsNamespacer client.BuildConfigsNamespacer

	// HookHandlerFunc is the function that will handle the Hook
	HookHandlerFunc func(api.Hook) error

	// KeyListFunc is a function that returns the list of keys ("namespace/name" format)
	// that we "know about" (to get a 2-way sync)
	KeyListFunc func() []string

	// KeyGetFunc is a function that returns the object that we "know about"
	// for the given key ("namespace/name" format) - and a boolean if it exists
	KeyGetFunc func(key string) (interface{}, bool, error)

	// ResyncPeriod is the interval of time at which the controller
	// will perform of full resync (list) of the BuildConfigs
	ResyncPeriod time.Duration

	// OpenshiftPublicURL is the public URL of the OpenShift instance
	// used to make sure the hook URL does not use an internal hostname ;-)
	OpenshiftPublicURL string
}

BuildConfigsController represents a controller that will react to BC changes, and handle only the BC with a github hook trigger.

func (*BuildConfigsController) GetByKey

func (c *BuildConfigsController) GetByKey(key string) (interface{}, bool, error)

GetByKey implements the cache.KeyGetter interface It is a function that returns the object that we "know about" for the given key ("namespace/name" format) - and a boolean if it exists

func (*BuildConfigsController) List

List is for the cache.ListerWatcher implementation List should return a list type object; the Items field will be extracted, and the ResourceVersion field will be used to start the watch in the right place.

func (*BuildConfigsController) ListKeys

func (c *BuildConfigsController) ListKeys() []string

ListKeys implements the cache.KeyLister interface It is a function that returns the list of keys ("namespace/name" format) that we "know about" (to get a 2-way sync)

func (*BuildConfigsController) RunUntil

func (c *BuildConfigsController) RunUntil(stopChan <-chan struct{})

RunUntil runs the controller in a goroutine until stopChan is closed

func (*BuildConfigsController) Watch

Watch is for the cache.ListerWatcher implementation Watch should begin a watch at the specified version.

Jump to

Keyboard shortcuts

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