downwardapi

package
v0.0.0-...-d7867ec Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package downwardapi declares the types used to expose job configuration to the jobs themselves

Index

Constants

View Source
const (
	// JobSpecEnv is the name that contains JobSpec marshaled into a string.
	JobSpecEnv = "JOB_SPEC"
)

Variables

This section is empty.

Functions

func EnvForSpec

func EnvForSpec(spec JobSpec) (map[string]string, error)

EnvForSpec returns a mapping of environment variables to their values that should be available for a job spec

func EnvForType

func EnvForType(jobType kube.ProwJobType) []string

EnvForType returns the slice of environment variables to export for jobType

Types

type JobSpec

type JobSpec struct {
	Type      kube.ProwJobType `json:"type,omitempty"`
	Job       string           `json:"job,omitempty"`
	BuildID   string           `json:"buildid,omitempty"`
	ProwJobID string           `json:"prowjobid,omitempty"`

	Refs kube.Refs `json:"refs,omitempty"`
	// contains filtered or unexported fields
}

JobSpec is the full downward API that we expose to jobs that realize a ProwJob. We will provide this data to jobs with environment variables in two ways:

  • the full spec, in serialized JSON in one variable
  • individual fields of the spec in their own variables

func NewJobSpec

func NewJobSpec(spec kube.ProwJobSpec, buildID, prowJobID string) JobSpec

NewJobSpec converts a kube.ProwJobSpec invocation into a JobSpec

func ResolveSpecFromEnv

func ResolveSpecFromEnv() (*JobSpec, error)

ResolveSpecFromEnv will determine the Refs being tested in by parsing Prow environment variable contents

Jump to

Keyboard shortcuts

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