Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) CreatePod(p Pod) (Pod, error)
- func (c *Client) CreateProwJob(j ProwJob) (ProwJob, error)
- func (c *Client) DeletePod(name string) error
- func (c *Client) DeleteProwJob(name string) error
- func (c *Client) GetLog(pod string) ([]byte, error)
- func (c *Client) GetPod(name string) (Pod, error)
- func (c *Client) GetProwJob(name string) (ProwJob, error)
- func (c *Client) ListPods(labels map[string]string) ([]Pod, error)
- func (c *Client) ListProwJobs(labels map[string]string) ([]ProwJob, error)
- func (c *Client) Namespace(ns string) *Client
- func (c *Client) ReplaceProwJob(name string, job ProwJob) (ProwJob, error)
- func (c *Client) ReplaceSecret(name string, s Secret) error
- type Cluster
- type ConfigMapKeySelector
- type ConfigMapSource
- type ConflictError
- type Container
- type DownwardAPIFile
- type DownwardAPISource
- type EnvVar
- type EnvVarSource
- type HostPathSource
- type Job
- type JobSpec
- type JobStatus
- type Logger
- type ObjectFieldSelector
- type ObjectMeta
- type Pod
- type PodPhase
- type PodSpec
- type PodStatus
- type PodTemplateSpec
- type Port
- type ProwJob
- type ProwJobAgent
- type ProwJobSpec
- type ProwJobState
- type ProwJobStatus
- type ProwJobType
- type Pull
- type Refs
- type ResourceRequest
- type Resources
- type Secret
- type SecretSource
- type SecurityContext
- type Volume
- type VolumeMount
Constants ¶
View Source
const ( PresubmitJob ProwJobType = "presubmit" PostsubmitJob = "postsubmit" PeriodicJob = "periodic" BatchJob = "batch" )
View Source
const ( TriggeredState ProwJobState = "triggered" PendingState = "pending" SuccessState = "success" FailureState = "failure" AbortedState = "aborted" ErrorState = "error" )
View Source
const ( ProwNamespace = "default" TestPodNamespace = "test-pods" )
View Source
const (
Evicted = "Evicted"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // If Logger is non-nil, log all method calls with it. Logger Logger // contains filtered or unexported fields }
Client interacts with the Kubernetes api-server.
func NewClientFromFile ¶
NewClientFromFile reads a Cluster object at clusterPath and returns an authenticated client using the keys within.
func NewClientInCluster ¶
NewClientInCluster creates a Client that works from within a pod.
func NewFakeClient ¶
func NewFakeClient() *Client
NewFakeClient creates a client that doesn't do anything.
func (*Client) DeleteProwJob ¶
func (*Client) ListProwJobs ¶
func (*Client) Namespace ¶
Namespace returns a copy of the client pointing at the specified namespace.
func (*Client) ReplaceProwJob ¶
type Cluster ¶
type Cluster struct { // The IP address of the cluster's master endpoint. Endpoint string `yaml:"endpoint"` // Base64-encoded public cert used by clients to authenticate to the // cluster endpoint. ClientCertificate string `yaml:"clientCertificate"` // Base64-encoded private key used by clients.. ClientKey string `yaml:"clientKey"` // Base64-encoded public certificate that is the root of trust for the // cluster. ClusterCACertificate string `yaml:"clusterCaCertificate"` }
Cluster represents the information necessary to talk to a Kubernetes master endpoint.
type ConfigMapKeySelector ¶
type ConfigMapSource ¶
type ConfigMapSource struct {
Name string `json:"name,omitempty"`
}
type ConflictError ¶
type ConflictError error
type Container ¶
type Container struct { Name string `json:"name,omitempty"` Image string `json:"image,omitempty"` Command []string `json:"command,omitempty"` Args []string `json:"args,omitempty"` WorkDir string `json:"workingDir,omitempty"` Env []EnvVar `json:"env,omitempty"` Ports []Port `json:"ports,omitempty"` Resources Resources `json:"resources,omitempty"` SecurityContext *SecurityContext `json:"securityContext,omitempty"` VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"` }
type DownwardAPIFile ¶
type DownwardAPIFile struct { Path string `json:"path"` Field ObjectFieldSelector `json:"fieldRef,omitempty"` }
type DownwardAPISource ¶
type DownwardAPISource struct {
Items []DownwardAPIFile `json:"items,omitempty"`
}
type EnvVar ¶
type EnvVar struct { Name string `json:"name,omitempty"` Value string `json:"value,omitempty"` ValueFrom *EnvVarSource `json:"valueFrom,omitempty"` }
type EnvVarSource ¶
type EnvVarSource struct {
ConfigMap ConfigMapKeySelector `json:"configMapKeyRef,omitempty"`
}
type HostPathSource ¶
type HostPathSource struct {
Path string `json:"path,omitempty"`
}
type Job ¶
type Job struct { Metadata ObjectMeta `json:"metadata,omitempty"` Spec JobSpec `json:"spec,omitempty"` Status JobStatus `json:"status,omitempty"` }
type JobSpec ¶
type JobSpec struct { Completions *int `json:"completions,omitempty"` Parallelism *int `json:"parallelism,omitempty"` ActiveDeadlineSeconds int `json:"activeDeadlineSeconds,omitempty"` Template PodTemplateSpec `json:"template,omitempty"` }
type ObjectFieldSelector ¶
type ObjectFieldSelector struct {
FieldPath string `json:"fieldPath"`
}
type ObjectMeta ¶
type ObjectMeta struct { Name string `json:"name,omitempty"` Namespace string `json:"namespace,omitempty"` Labels map[string]string `json:"labels,omitempty"` Annotations map[string]string `json:"annotations,omitempty"` ResourceVersion string `json:"resourceVersion,omitempty"` UID string `json:"uid,omitempty"` }
type Pod ¶
type Pod struct { Metadata ObjectMeta `json:"metadata,omitempty"` Spec PodSpec `json:"spec,omitempty"` Status PodStatus `json:"status,omitempty"` }
type PodTemplateSpec ¶
type PodTemplateSpec struct { Metadata ObjectMeta `json:"metadata,omitempty"` Spec PodSpec `json:"spec,omitempty"` }
type ProwJob ¶
type ProwJob struct { APIVersion string `json:"apiVersion,omitempty"` Kind string `json:"kind,omitempty"` Metadata ObjectMeta `json:"metadata,omitempty"` Spec ProwJobSpec `json:"spec,omitempty"` Status ProwJobStatus `json:"status,omitempty"` }
type ProwJobAgent ¶
type ProwJobAgent string
const ( KubernetesAgent ProwJobAgent = "kubernetes" JenkinsAgent = "jenkins" )
type ProwJobSpec ¶
type ProwJobSpec struct { Type ProwJobType `json:"type,omitempty"` Agent ProwJobAgent `json:"agent,omitempty"` Job string `json:"job,omitempty"` Refs Refs `json:"refs,omitempty"` Report bool `json:"report,omitempty"` Context string `json:"context,omitempty"` RerunCommand string `json:"rerun_command,omitempty"` PodSpec PodSpec `json:"pod_spec,omitempty"` RunAfterSuccess []ProwJobSpec `json:"run_after_success,omitempty"` }
type ProwJobState ¶
type ProwJobState string
type ProwJobStatus ¶
type ProwJobStatus struct { StartTime time.Time `json:"startTime,omitempty"` CompletionTime time.Time `json:"completionTime,omitempty"` State ProwJobState `json:"state,omitempty"` Description string `json:"description,omitempty"` URL string `json:"url,omitempty"` PodName string `json:"pod_name,omitempty"` BuildID string `json:"build_id,omitempty"` JenkinsQueueURL string `json:"jenkins_queue_url,omitempty"` JenkinsEnqueued bool `json:"jenkins_enqueued,omitempty"` JenkinsBuildID string `json:"jenkins_build_id,omitempty"` }
type ProwJobType ¶
type ProwJobType string
type Refs ¶
type ResourceRequest ¶
type Resources ¶
type Resources struct { Requests *ResourceRequest `json:"requests,omitempty"` Limits *ResourceRequest `json:"limits,omitempty"` }
type Secret ¶
type Secret struct { Metadata ObjectMeta `json:"metadata,omitempty"` Data map[string]string `json:"data,omitempty"` }
type SecretSource ¶
type SecurityContext ¶
type SecurityContext struct {
Privileged bool `json:"privileged,omitempty"`
}
type Volume ¶
type Volume struct { Name string `json:"name,omitempty"` Secret *SecretSource `json:"secret,omitempty"` DownwardAPI *DownwardAPISource `json:"downwardAPI,omitempty"` HostPath *HostPathSource `json:"hostPath,omitempty"` ConfigMap *ConfigMapSource `json:"configMap,omitempty"` }
type VolumeMount ¶
Click to show internal directories.
Click to hide internal directories.