apiutils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2017 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// KubeMasterURL, URL to kubernetes master.
	KubeMasterURL = "http://kubernetes.default:8080"
	// SkipSSLVerification allows to connect kubernetes without verifying certificates.
	SkipSSLVerification = true

	// CAFile to use with kubernetes if any.
	CAFile = ""

	// CertFile to use with kubernetes if any.
	CertFile = ""

	// KeyFile private key to use with kubernetes, if any.
	KeyFile = ""

	Verbose   = false
	InCluster = true
)

Functions

func Config added in v1.1.0

func Config()

func ImpactedDeployments

func ImpactedDeployments(event Event)

ImpactedDeployments will fetch deployments using the repository image found in event to be impacted. It will check label to know if it should be entered in updates list that are managed by rollout goroutine.

func StartRollout

func StartRollout()

StartRollout starts a goroutine on rollout() function that is a loop checking updates to send to Kubernetes Deployment objects.

func StopRollout

func StopRollout()

StopRollout stops rollout goroutine.

Types

type Event

type Event struct {
	Action  string  `json:"action"`
	Target  Target  `json:"target"`
	Request Request `json:"request"`
}

Event sent by Docker registry webhook.

type Events

type Events struct {
	Events []Event `json:"events"`
}

Events list from Docker webhook.

func GetEvents

func GetEvents(c []byte, registry string) Events

GetEvents returns events from registry message given from webook body.

type Request

type Request struct {
	Host string `json:"host"`
}

Request contains "host" from a Docker repository event.

type Target

type Target struct {
	Repository string `json:"repository"`
	Tag        string `json:"tag,omitempty"`
}

Target is the image to change in k8s struct.

Jump to

Keyboard shortcuts

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