Documentation ¶
Index ¶
- Variables
- func DefaultOpenshiftPublicURL() string
- func ExplodeOpenshiftWebhookURL(url string) (namespace, buildconfig, secret string)
- func IsOpenshiftHook(hookURL string, openshiftPublicURL string) bool
- type BuildConfigsController
- func (c *BuildConfigsController) GetByKey(key string) (interface{}, bool, error)
- func (c *BuildConfigsController) List(options kapi.ListOptions) (runtime.Object, error)
- func (c *BuildConfigsController) ListKeys() []string
- func (c *BuildConfigsController) RunUntil(stopChan <-chan struct{})
- func (c *BuildConfigsController) Watch(options kapi.ListOptions) (watch.Interface, error)
Constants ¶
This section is empty.
Variables ¶
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 ¶
ExplodeOpenshiftWebhookURL explodes the given openshift webhook url and returns the namespace, buildconfig and webhook secret
func IsOpenshiftHook ¶
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 ¶
func (c *BuildConfigsController) List(options kapi.ListOptions) (runtime.Object, error)
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 ¶
func (c *BuildConfigsController) Watch(options kapi.ListOptions) (watch.Interface, error)
Watch is for the cache.ListerWatcher implementation Watch should begin a watch at the specified version.