github

package
v0.0.0-...-d10fae5 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

based on https://gist.github.com/ahmetb/548059cdbf12fb571e4e2f1e29c48997

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitalStatusUpdate

func InitalStatusUpdate(ctx context.Context, client *github.Client, cluster *clustersv1alpha2.TestClusterGKE) error

InitalStatusUpdate assumes that SetMetdata was called and makes a direct update to GitHub status API, which may result in an error

func NewClient

func NewClient(ctx context.Context) (*github.Client, error)

func ParsePushEvent

func ParsePushEvent() (*github.PushEvent, error)

func SetMetadata

func SetMetadata(cluster *clustersv1alpha2.TestClusterGKE, commitHash, repoOwner, repoName, context string)

Types

type State

type State string
const (
	StateError   State = "error"
	StateFailure State = "failure"
	StatePending State = "pending"
	StateSuccess State = "success"
)

type StatusUpdater

type StatusUpdater struct {
	// contains filtered or unexported fields
}

func NewStatusUpdater

func NewStatusUpdater(log logr.Logger, meta metav1.ObjectMeta) *StatusUpdater

NewStatusUpdater constructs an updater to be used in controller context, it only logs errors, so doesn't introduce reconciliation failures

func (*StatusUpdater) Update

func (s *StatusUpdater) Update(ctx context.Context, state State, description, url string)

Jump to

Keyboard shortcuts

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