boskos

package
v0.0.0-...-381424b Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GKEProjectResource is resource type defined for GKE projects
	GKEProjectResource = "gke-project"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*boskosclient.Client
}

Client a wrapper around k8s boskos client that implements Operation

func NewClient

func NewClient(host string, user string, pass string) (*Client, error)

NewClient creates a boskos Client with GKE operation. The owner of any resources acquired by this client is the same as the host name. `user` and `pass` are used for basic authentication for boskos client where pass is a password file. `user` and `pass` fields are passed directly to k8s boskos client. Refer to [k8s boskos](https://github.com/kubernetes/test-infra/tree/master/boskos) for more details. If host is "", it looks up JOB_NAME environment variable and set it to be the host name.

func (*Client) AcquireGKEProject

func (c *Client) AcquireGKEProject(resType string) (*boskoscommon.Resource, error)

AcquireGKEProject acquires GKE Boskos Project with "free" state, and not owned by anyone, sets its state to "busy" and assign it an owner of *host, which by default is env var `JOB_NAME`.

func (*Client) ReleaseGKEProject

func (c *Client) ReleaseGKEProject(name string) error

ReleaseGKEProject releases project, the host must match with the host name that acquired the project, which by default is env var `JOB_NAME`. The state is set to "dirty" for Janitor picking up. This function is very powerful, it can release Boskos resource acquired by other processes, regardless of where the other process is running.

type Operation

type Operation interface {
	AcquireGKEProject(string) (*boskoscommon.Resource, error)
	ReleaseGKEProject(string) error
}

Operation defines actions for handling GKE resources

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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