Updated Godeps and vendors.

Added:
- github.com/openshift/origin/pkg/build/api/install
- github.com/openshift/origin/pkg/build/api/v1
This commit is contained in:
Ratnadeep Debnath 2016-10-18 19:16:06 +05:30
parent 92b6678d1b
commit 1215a6366e
11 changed files with 15258 additions and 0 deletions

View File

@ -0,0 +1,109 @@
package install
import (
"fmt"
"github.com/golang/glog"
kapi "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/meta"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apimachinery"
"k8s.io/kubernetes/pkg/apimachinery/registered"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util/sets"
"github.com/openshift/origin/pkg/build/api"
"github.com/openshift/origin/pkg/build/api/v1"
)
const importPrefix = "github.com/openshift/origin/pkg/build/api"
var accessor = meta.NewAccessor()
// availableVersions lists all known external versions for this group from most preferred to least preferred
var availableVersions = []unversioned.GroupVersion{v1.SchemeGroupVersion}
func init() {
registered.RegisterVersions(availableVersions)
externalVersions := []unversioned.GroupVersion{}
for _, v := range availableVersions {
if registered.IsAllowedVersion(v) {
externalVersions = append(externalVersions, v)
}
}
if len(externalVersions) == 0 {
glog.Infof("No version is registered for group %v", api.GroupName)
return
}
if err := registered.EnableVersions(externalVersions...); err != nil {
panic(err)
}
if err := enableVersions(externalVersions); err != nil {
panic(err)
}
}
// TODO: enableVersions should be centralized rather than spread in each API
// group.
// We can combine registered.RegisterVersions, registered.EnableVersions and
// registered.RegisterGroup once we have moved enableVersions there.
func enableVersions(externalVersions []unversioned.GroupVersion) error {
addVersionsToScheme(externalVersions...)
preferredExternalVersion := externalVersions[0]
groupMeta := apimachinery.GroupMeta{
GroupVersion: preferredExternalVersion,
GroupVersions: externalVersions,
RESTMapper: newRESTMapper(externalVersions),
SelfLinker: runtime.SelfLinker(accessor),
InterfacesFor: interfacesFor,
}
if err := registered.RegisterGroup(groupMeta); err != nil {
return err
}
kapi.RegisterRESTMapper(groupMeta.RESTMapper)
return nil
}
func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) {
// add the internal version to Scheme
api.AddToScheme(kapi.Scheme)
// add the enabled external versions to Scheme
for _, v := range externalVersions {
if !registered.IsEnabledVersion(v) {
glog.Errorf("Version %s is not enabled, so it will not be added to the Scheme.", v)
continue
}
switch v {
case v1.SchemeGroupVersion:
v1.AddToScheme(kapi.Scheme)
default:
glog.Errorf("Version %s is not known, so it will not be added to the Scheme.", v)
continue
}
}
}
func newRESTMapper(externalVersions []unversioned.GroupVersion) meta.RESTMapper {
rootScoped := sets.NewString()
ignoredKinds := sets.NewString()
return kapi.NewDefaultRESTMapper(externalVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped)
}
func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, error) {
switch version {
case v1.SchemeGroupVersion:
return &meta.VersionInterfaces{
ObjectConvertor: kapi.Scheme,
MetadataAccessor: accessor,
}, nil
default:
g, _ := registered.Group(api.GroupName)
return nil, fmt.Errorf("unsupported storage version: %s (valid: %v)", version, g.GroupVersions)
}
}

View File

@ -0,0 +1,189 @@
package v1
import (
"k8s.io/kubernetes/pkg/conversion"
"k8s.io/kubernetes/pkg/runtime"
oapi "github.com/openshift/origin/pkg/api"
newer "github.com/openshift/origin/pkg/build/api"
buildutil "github.com/openshift/origin/pkg/build/util"
imageapi "github.com/openshift/origin/pkg/image/api"
)
func Convert_v1_BuildConfig_To_api_BuildConfig(in *BuildConfig, out *newer.BuildConfig, s conversion.Scope) error {
if err := autoConvert_v1_BuildConfig_To_api_BuildConfig(in, out, s); err != nil {
return err
}
newTriggers := []newer.BuildTriggerPolicy{}
// strip off any default imagechange triggers where the buildconfig's
// "from" is not an ImageStreamTag, because those triggers
// will never be invoked.
imageRef := buildutil.GetInputReference(out.Spec.Strategy)
hasIST := imageRef != nil && imageRef.Kind == "ImageStreamTag"
for _, trigger := range out.Spec.Triggers {
if trigger.Type != newer.ImageChangeBuildTriggerType {
newTriggers = append(newTriggers, trigger)
continue
}
if (trigger.ImageChange == nil || trigger.ImageChange.From == nil) && !hasIST {
continue
}
newTriggers = append(newTriggers, trigger)
}
out.Spec.Triggers = newTriggers
return nil
}
func Convert_v1_SourceBuildStrategy_To_api_SourceBuildStrategy(in *SourceBuildStrategy, out *newer.SourceBuildStrategy, s conversion.Scope) error {
if err := autoConvert_v1_SourceBuildStrategy_To_api_SourceBuildStrategy(in, out, s); err != nil {
return err
}
switch in.From.Kind {
case "ImageStream":
out.From.Kind = "ImageStreamTag"
out.From.Name = imageapi.JoinImageStreamTag(in.From.Name, "")
}
return nil
}
func Convert_v1_DockerBuildStrategy_To_api_DockerBuildStrategy(in *DockerBuildStrategy, out *newer.DockerBuildStrategy, s conversion.Scope) error {
if err := autoConvert_v1_DockerBuildStrategy_To_api_DockerBuildStrategy(in, out, s); err != nil {
return err
}
if in.From != nil {
switch in.From.Kind {
case "ImageStream":
out.From.Kind = "ImageStreamTag"
out.From.Name = imageapi.JoinImageStreamTag(in.From.Name, "")
}
}
return nil
}
func Convert_v1_CustomBuildStrategy_To_api_CustomBuildStrategy(in *CustomBuildStrategy, out *newer.CustomBuildStrategy, s conversion.Scope) error {
if err := autoConvert_v1_CustomBuildStrategy_To_api_CustomBuildStrategy(in, out, s); err != nil {
return err
}
switch in.From.Kind {
case "ImageStream":
out.From.Kind = "ImageStreamTag"
out.From.Name = imageapi.JoinImageStreamTag(in.From.Name, "")
}
return nil
}
func Convert_v1_BuildOutput_To_api_BuildOutput(in *BuildOutput, out *newer.BuildOutput, s conversion.Scope) error {
if err := autoConvert_v1_BuildOutput_To_api_BuildOutput(in, out, s); err != nil {
return err
}
if in.To != nil && (in.To.Kind == "ImageStream" || len(in.To.Kind) == 0) {
out.To.Kind = "ImageStreamTag"
out.To.Name = imageapi.JoinImageStreamTag(in.To.Name, "")
}
return nil
}
func Convert_v1_BuildTriggerPolicy_To_api_BuildTriggerPolicy(in *BuildTriggerPolicy, out *newer.BuildTriggerPolicy, s conversion.Scope) error {
if err := autoConvert_v1_BuildTriggerPolicy_To_api_BuildTriggerPolicy(in, out, s); err != nil {
return err
}
switch in.Type {
case ImageChangeBuildTriggerTypeDeprecated:
out.Type = newer.ImageChangeBuildTriggerType
case GenericWebHookBuildTriggerTypeDeprecated:
out.Type = newer.GenericWebHookBuildTriggerType
case GitHubWebHookBuildTriggerTypeDeprecated:
out.Type = newer.GitHubWebHookBuildTriggerType
}
return nil
}
func Convert_api_SourceRevision_To_v1_SourceRevision(in *newer.SourceRevision, out *SourceRevision, s conversion.Scope) error {
if err := autoConvert_api_SourceRevision_To_v1_SourceRevision(in, out, s); err != nil {
return err
}
out.Type = BuildSourceGit
return nil
}
func Convert_api_BuildSource_To_v1_BuildSource(in *newer.BuildSource, out *BuildSource, s conversion.Scope) error {
if err := autoConvert_api_BuildSource_To_v1_BuildSource(in, out, s); err != nil {
return err
}
switch {
// it is legal for a buildsource to have both a git+dockerfile source, but in v1 that was represented
// as type git.
case in.Git != nil:
out.Type = BuildSourceGit
// it is legal for a buildsource to have both a binary+dockerfile source, but in v1 that was represented
// as type binary.
case in.Binary != nil:
out.Type = BuildSourceBinary
case in.Dockerfile != nil:
out.Type = BuildSourceDockerfile
case len(in.Images) > 0:
out.Type = BuildSourceImage
default:
out.Type = BuildSourceNone
}
return nil
}
func Convert_api_BuildStrategy_To_v1_BuildStrategy(in *newer.BuildStrategy, out *BuildStrategy, s conversion.Scope) error {
if err := autoConvert_api_BuildStrategy_To_v1_BuildStrategy(in, out, s); err != nil {
return err
}
switch {
case in.SourceStrategy != nil:
out.Type = SourceBuildStrategyType
case in.DockerStrategy != nil:
out.Type = DockerBuildStrategyType
case in.CustomStrategy != nil:
out.Type = CustomBuildStrategyType
case in.JenkinsPipelineStrategy != nil:
out.Type = JenkinsPipelineBuildStrategyType
default:
out.Type = ""
}
return nil
}
func addConversionFuncs(scheme *runtime.Scheme) error {
if err := scheme.AddConversionFuncs(
Convert_v1_BuildConfig_To_api_BuildConfig,
Convert_api_BuildConfig_To_v1_BuildConfig,
Convert_v1_SourceBuildStrategy_To_api_SourceBuildStrategy,
Convert_api_SourceBuildStrategy_To_v1_SourceBuildStrategy,
Convert_v1_DockerBuildStrategy_To_api_DockerBuildStrategy,
Convert_api_DockerBuildStrategy_To_v1_DockerBuildStrategy,
Convert_v1_CustomBuildStrategy_To_api_CustomBuildStrategy,
Convert_api_CustomBuildStrategy_To_v1_CustomBuildStrategy,
Convert_v1_BuildOutput_To_api_BuildOutput,
Convert_api_BuildOutput_To_v1_BuildOutput,
Convert_v1_BuildTriggerPolicy_To_api_BuildTriggerPolicy,
Convert_api_BuildTriggerPolicy_To_v1_BuildTriggerPolicy,
Convert_v1_SourceRevision_To_api_SourceRevision,
Convert_api_SourceRevision_To_v1_SourceRevision,
Convert_v1_BuildSource_To_api_BuildSource,
Convert_api_BuildSource_To_v1_BuildSource,
Convert_v1_BuildStrategy_To_api_BuildStrategy,
Convert_api_BuildStrategy_To_v1_BuildStrategy,
); err != nil {
return err
}
if err := scheme.AddFieldLabelConversionFunc("v1", "Build",
oapi.GetFieldLabelConversionFunc(newer.BuildToSelectableFields(&newer.Build{}), map[string]string{"name": "metadata.name"}),
); err != nil {
return err
}
if err := scheme.AddFieldLabelConversionFunc("v1", "BuildConfig",
oapi.GetFieldLabelConversionFunc(newer.BuildConfigToSelectableFields(&newer.BuildConfig{}), map[string]string{"name": "metadata.name"}),
); err != nil {
return err
}
return nil
}

View File

@ -0,0 +1,57 @@
package v1
import "k8s.io/kubernetes/pkg/runtime"
func SetDefaults_BuildConfigSpec(config *BuildConfigSpec) {
if len(config.RunPolicy) == 0 {
config.RunPolicy = BuildRunPolicySerial
}
}
func SetDefaults_BuildSource(source *BuildSource) {
if (source != nil) && (source.Type == BuildSourceBinary) && (source.Binary == nil) {
source.Binary = &BinaryBuildSource{}
}
}
func SetDefaults_BuildStrategy(strategy *BuildStrategy) {
if (strategy != nil) && (strategy.Type == DockerBuildStrategyType) && (strategy.DockerStrategy == nil) {
strategy.DockerStrategy = &DockerBuildStrategy{}
}
}
func SetDefaults_SourceBuildStrategy(obj *SourceBuildStrategy) {
if len(obj.From.Kind) == 0 {
obj.From.Kind = "ImageStreamTag"
}
}
func SetDefaults_DockerBuildStrategy(obj *DockerBuildStrategy) {
if obj.From != nil && len(obj.From.Kind) == 0 {
obj.From.Kind = "ImageStreamTag"
}
}
func SetDefaults_CustomBuildStrategy(obj *CustomBuildStrategy) {
if len(obj.From.Kind) == 0 {
obj.From.Kind = "ImageStreamTag"
}
}
func SetDefaults_BuildTriggerPolicy(obj *BuildTriggerPolicy) {
if obj.Type == ImageChangeBuildTriggerType && obj.ImageChange == nil {
obj.ImageChange = &ImageChangeTrigger{}
}
}
func addDefaultingFuncs(scheme *runtime.Scheme) error {
return scheme.AddDefaultingFuncs(
SetDefaults_BuildConfigSpec,
SetDefaults_BuildSource,
SetDefaults_BuildStrategy,
SetDefaults_SourceBuildStrategy,
SetDefaults_DockerBuildStrategy,
SetDefaults_CustomBuildStrategy,
SetDefaults_BuildTriggerPolicy,
)
}

View File

@ -0,0 +1,5 @@
// +k8s:deepcopy-gen=package,register
// +k8s:conversion-gen=github.com/openshift/origin/pkg/build/api
// Package v1 is the v1 version of the API.
package v1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,776 @@
// This file was autogenerated by go-to-protobuf. Do not edit it manually!
syntax = 'proto2';
package github.com.openshift.origin.pkg.build.api.v1;
import "k8s.io/kubernetes/pkg/api/unversioned/generated.proto";
import "k8s.io/kubernetes/pkg/api/v1/generated.proto";
import "k8s.io/kubernetes/pkg/runtime/generated.proto";
import "k8s.io/kubernetes/pkg/util/intstr/generated.proto";
// Package-wide variables from generator "generated".
option go_package = "v1";
// BinaryBuildRequestOptions are the options required to fully speficy a binary build request
message BinaryBuildRequestOptions {
// metadata for BinaryBuildRequestOptions.
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// asFile determines if the binary should be created as a file within the source rather than extracted as an archive
optional string asFile = 2;
// revision.commit is the value identifying a specific commit
optional string revisionCommit = 3;
// revision.message is the description of a specific commit
optional string revisionMessage = 4;
// revision.authorName of the source control user
optional string revisionAuthorName = 5;
// revision.authorEmail of the source control user
optional string revisionAuthorEmail = 6;
// revision.committerName of the source control user
optional string revisionCommitterName = 7;
// revision.committerEmail of the source control user
optional string revisionCommitterEmail = 8;
}
// BinaryBuildSource describes a binary file to be used for the Docker and Source build strategies,
// where the file will be extracted and used as the build source.
message BinaryBuildSource {
// asFile indicates that the provided binary input should be considered a single file
// within the build input. For example, specifying "webapp.war" would place the provided
// binary as `/webapp.war` for the builder. If left empty, the Docker and Source build
// strategies assume this file is a zip, tar, or tar.gz file and extract it as the source.
// The custom strategy receives this binary as standard input. This filename may not
// contain slashes or be '..' or '.'.
optional string asFile = 1;
}
// Build encapsulates the inputs needed to produce a new deployable image, as well as
// the status of the execution and a reference to the Pod which executed the build.
message Build {
// Standard object's metadata.
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// spec is all the inputs used to execute the build.
optional BuildSpec spec = 2;
// status is the current status of the build.
optional BuildStatus status = 3;
}
// BuildConfig is a template which can be used to create new builds.
message BuildConfig {
// metadata for BuildConfig.
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// spec holds all the input necessary to produce a new build, and the conditions when
// to trigger them.
optional BuildConfigSpec spec = 2;
// status holds any relevant information about a build config
optional BuildConfigStatus status = 3;
}
// BuildConfigList is a collection of BuildConfigs.
message BuildConfigList {
// metadata for BuildConfigList.
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// items is a list of build configs
repeated BuildConfig items = 2;
}
// BuildConfigSpec describes when and how builds are created
message BuildConfigSpec {
// triggers determine how new Builds can be launched from a BuildConfig. If
// no triggers are defined, a new build can only occur as a result of an
// explicit client build creation.
repeated BuildTriggerPolicy triggers = 1;
// RunPolicy describes how the new build created from this build
// configuration will be scheduled for execution.
// This is optional, if not specified we default to "Serial".
optional string runPolicy = 2;
// CommonSpec is the desired build specification
optional CommonSpec commonSpec = 3;
}
// BuildConfigStatus contains current state of the build config object.
message BuildConfigStatus {
// lastVersion is used to inform about number of last triggered build.
optional int64 lastVersion = 1;
}
// BuildList is a collection of Builds.
message BuildList {
// metadata for BuildList.
optional k8s.io.kubernetes.pkg.api.unversioned.ListMeta metadata = 1;
// items is a list of builds
repeated Build items = 2;
}
// BuildLog is the (unused) resource associated with the build log redirector
message BuildLog {
}
// BuildLogOptions is the REST options for a build log
message BuildLogOptions {
// cointainer for which to stream logs. Defaults to only container if there is one container in the pod.
optional string container = 1;
// follow if true indicates that the build log should be streamed until
// the build terminates.
optional bool follow = 2;
// previous returns previous build logs. Defaults to false.
optional bool previous = 3;
// sinceSeconds is a relative time in seconds before the current time from which to show logs. If this value
// precedes the time a pod was started, only logs since the pod start will be returned.
// If this value is in the future, no logs will be returned.
// Only one of sinceSeconds or sinceTime may be specified.
optional int64 sinceSeconds = 4;
// sinceTime is an RFC3339 timestamp from which to show logs. If this value
// precedes the time a pod was started, only logs since the pod start will be returned.
// If this value is in the future, no logs will be returned.
// Only one of sinceSeconds or sinceTime may be specified.
optional k8s.io.kubernetes.pkg.api.unversioned.Time sinceTime = 5;
// timestamps, If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line
// of log output. Defaults to false.
optional bool timestamps = 6;
// tailLines, If set, is the number of lines from the end of the logs to show. If not specified,
// logs are shown from the creation of the container or sinceSeconds or sinceTime
optional int64 tailLines = 7;
// limitBytes, If set, is the number of bytes to read from the server before terminating the
// log output. This may not display a complete final line of logging, and may return
// slightly more or slightly less than the specified limit.
optional int64 limitBytes = 8;
// noWait if true causes the call to return immediately even if the build
// is not available yet. Otherwise the server will wait until the build has started.
// TODO: Fix the tag to 'noWait' in v2
optional bool nowait = 9;
// version of the build for which to view logs.
optional int64 version = 10;
}
// BuildOutput is input to a build strategy and describes the Docker image that the strategy
// should produce.
message BuildOutput {
// to defines an optional location to push the output of this build to.
// Kind must be one of 'ImageStreamTag' or 'DockerImage'.
// This value will be used to look up a Docker image repository to push to.
// In the case of an ImageStreamTag, the ImageStreamTag will be looked for in the namespace of
// the build unless Namespace is specified.
optional k8s.io.kubernetes.pkg.api.v1.ObjectReference to = 1;
// PushSecret is the name of a Secret that would be used for setting
// up the authentication for executing the Docker push to authentication
// enabled Docker Registry (or Docker Hub).
optional k8s.io.kubernetes.pkg.api.v1.LocalObjectReference pushSecret = 2;
}
// A BuildPostCommitSpec holds a build post commit hook specification. The hook
// executes a command in a temporary container running the build output image,
// immediately after the last layer of the image is committed and before the
// image is pushed to a registry. The command is executed with the current
// working directory ($PWD) set to the image's WORKDIR.
//
// The build will be marked as failed if the hook execution fails. It will fail
// if the script or command return a non-zero exit code, or if there is any
// other error related to starting the temporary container.
//
// There are five different ways to configure the hook. As an example, all forms
// below are equivalent and will execute `rake test --verbose`.
//
// 1. Shell script:
//
// "postCommit": {
// "script": "rake test --verbose",
// }
//
// The above is a convenient form which is equivalent to:
//
// "postCommit": {
// "command": ["/bin/sh", "-ic"],
// "args": ["rake test --verbose"]
// }
//
// 2. A command as the image entrypoint:
//
// "postCommit": {
// "commit": ["rake", "test", "--verbose"]
// }
//
// Command overrides the image entrypoint in the exec form, as documented in
// Docker: https://docs.docker.com/engine/reference/builder/#entrypoint.
//
// 3. Pass arguments to the default entrypoint:
//
// "postCommit": {
// "args": ["rake", "test", "--verbose"]
// }
//
// This form is only useful if the image entrypoint can handle arguments.
//
// 4. Shell script with arguments:
//
// "postCommit": {
// "script": "rake test $1",
// "args": ["--verbose"]
// }
//
// This form is useful if you need to pass arguments that would otherwise be
// hard to quote properly in the shell script. In the script, $0 will be
// "/bin/sh" and $1, $2, etc, are the positional arguments from Args.
//
// 5. Command with arguments:
//
// "postCommit": {
// "command": ["rake", "test"],
// "args": ["--verbose"]
// }
//
// This form is equivalent to appending the arguments to the Command slice.
//
// It is invalid to provide both Script and Command simultaneously. If none of
// the fields are specified, the hook is not executed.
message BuildPostCommitSpec {
// command is the command to run. It may not be specified with Script.
// This might be needed if the image doesn't have `/bin/sh`, or if you
// do not want to use a shell. In all other cases, using Script might be
// more convenient.
repeated string command = 1;
// args is a list of arguments that are provided to either Command,
// Script or the Docker image's default entrypoint. The arguments are
// placed immediately after the command to be run.
repeated string args = 2;
// script is a shell script to be run with `/bin/sh -ic`. It may not be
// specified with Command. Use Script when a shell script is appropriate
// to execute the post build hook, for example for running unit tests
// with `rake test`. If you need control over the image entrypoint, or
// if the image does not have `/bin/sh`, use Command and/or Args.
// The `-i` flag is needed to support CentOS and RHEL images that use
// Software Collections (SCL), in order to have the appropriate
// collections enabled in the shell. E.g., in the Ruby image, this is
// necessary to make `ruby`, `bundle` and other binaries available in
// the PATH.
optional string script = 3;
}
// BuildRequest is the resource used to pass parameters to build generator
message BuildRequest {
// metadata for BuildRequest.
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// revision is the information from the source for a specific repo snapshot.
optional SourceRevision revision = 2;
// triggeredByImage is the Image that triggered this build.
optional k8s.io.kubernetes.pkg.api.v1.ObjectReference triggeredByImage = 3;
// from is the reference to the ImageStreamTag that triggered the build.
optional k8s.io.kubernetes.pkg.api.v1.ObjectReference from = 4;
// binary indicates a request to build from a binary provided to the builder
optional BinaryBuildSource binary = 5;
// lastVersion (optional) is the LastVersion of the BuildConfig that was used
// to generate the build. If the BuildConfig in the generator doesn't match, a build will
// not be generated.
optional int64 lastVersion = 6;
// env contains additional environment variables you want to pass into a builder container
repeated k8s.io.kubernetes.pkg.api.v1.EnvVar env = 7;
// triggeredBy describes which triggers started the most recent update to the
// build configuration and contains information about those triggers.
repeated BuildTriggerCause triggeredBy = 8;
}
// BuildSource is the SCM used for the build.
message BuildSource {
// type of build input to accept
// +k8s:conversion-gen=false
optional string type = 1;
// binary builds accept a binary as their input. The binary is generally assumed to be a tar,
// gzipped tar, or zip file depending on the strategy. For Docker builds, this is the build
// context and an optional Dockerfile may be specified to override any Dockerfile in the
// build context. For Source builds, this is assumed to be an archive as described above. For
// Source and Docker builds, if binary.asFile is set the build will receive a directory with
// a single file. contextDir may be used when an archive is provided. Custom builds will
// receive this binary as input on STDIN.
optional BinaryBuildSource binary = 2;
// dockerfile is the raw contents of a Dockerfile which should be built. When this option is
// specified, the FROM may be modified based on your strategy base image and additional ENV
// stanzas from your strategy environment will be added after the FROM, but before the rest
// of your Dockerfile stanzas. The Dockerfile source type may be used with other options like
// git - in those cases the Git repo will have any innate Dockerfile replaced in the context
// dir.
optional string dockerfile = 3;
// git contains optional information about git build source
optional GitBuildSource git = 4;
// images describes a set of images to be used to provide source for the build
repeated ImageSource images = 5;
// contextDir specifies the sub-directory where the source code for the application exists.
// This allows to have buildable sources in directory other than root of
// repository.
optional string contextDir = 6;
// sourceSecret is the name of a Secret that would be used for setting
// up the authentication for cloning private repository.
// The secret contains valid credentials for remote repository, where the
// data's key represent the authentication method to be used and value is
// the base64 encoded credentials. Supported auth methods are: ssh-privatekey.
optional k8s.io.kubernetes.pkg.api.v1.LocalObjectReference sourceSecret = 7;
// secrets represents a list of secrets and their destinations that will
// be used only for the build.
repeated SecretBuildSource secrets = 8;
}
// BuildSpec has the information to represent a build and also additional
// information about a build
message BuildSpec {
// CommonSpec is the information that represents a build
optional CommonSpec commonSpec = 1;
// triggeredBy describes which triggers started the most recent update to the
// build configuration and contains information about those triggers.
repeated BuildTriggerCause triggeredBy = 2;
}
// BuildStatus contains the status of a build
message BuildStatus {
// phase is the point in the build lifecycle.
optional string phase = 1;
// cancelled describes if a cancel event was triggered for the build.
optional bool cancelled = 2;
// reason is a brief CamelCase string that describes any failure and is meant for machine parsing and tidy display in the CLI.
optional string reason = 3;
// message is a human-readable message indicating details about why the build has this status.
optional string message = 4;
// startTimestamp is a timestamp representing the server time when this Build started
// running in a Pod.
// It is represented in RFC3339 form and is in UTC.
optional k8s.io.kubernetes.pkg.api.unversioned.Time startTimestamp = 5;
// completionTimestamp is a timestamp representing the server time when this Build was
// finished, whether that build failed or succeeded. It reflects the time at which
// the Pod running the Build terminated.
// It is represented in RFC3339 form and is in UTC.
optional k8s.io.kubernetes.pkg.api.unversioned.Time completionTimestamp = 6;
// duration contains time.Duration object describing build time.
optional int64 duration = 7;
// outputDockerImageReference contains a reference to the Docker image that
// will be built by this build. Its value is computed from
// Build.Spec.Output.To, and should include the registry address, so that
// it can be used to push and pull the image.
optional string outputDockerImageReference = 8;
// config is an ObjectReference to the BuildConfig this Build is based on.
optional k8s.io.kubernetes.pkg.api.v1.ObjectReference config = 9;
}
// BuildStrategy contains the details of how to perform a build.
message BuildStrategy {
// type is the kind of build strategy.
// +k8s:conversion-gen=false
optional string type = 1;
// dockerStrategy holds the parameters to the Docker build strategy.
optional DockerBuildStrategy dockerStrategy = 2;
// sourceStrategy holds the parameters to the Source build strategy.
optional SourceBuildStrategy sourceStrategy = 3;
// customStrategy holds the parameters to the Custom build strategy
optional CustomBuildStrategy customStrategy = 4;
// JenkinsPipelineStrategy holds the parameters to the Jenkins Pipeline build strategy.
// This strategy is in tech preview.
optional JenkinsPipelineBuildStrategy jenkinsPipelineStrategy = 5;
}
// BuildTriggerCause holds information about a triggered build. It is used for
// displaying build trigger data for each build and build configuration in oc
// describe. It is also used to describe which triggers led to the most recent
// update in the build configuration.
message BuildTriggerCause {
// message is used to store a human readable message for why the build was
// triggered. E.g.: "Manually triggered by user", "Configuration change",etc.
optional string message = 1;
// genericWebHook holds data about a builds generic webhook trigger.
optional GenericWebHookCause genericWebHook = 2;
// gitHubWebHook represents data for a GitHub webhook that fired a
// specific build.
optional GitHubWebHookCause githubWebHook = 3;
// imageChangeBuild stores information about an imagechange event
// that triggered a new build.
optional ImageChangeCause imageChangeBuild = 4;
}
// BuildTriggerPolicy describes a policy for a single trigger that results in a new Build.
message BuildTriggerPolicy {
// type is the type of build trigger
optional string type = 1;
// github contains the parameters for a GitHub webhook type of trigger
optional WebHookTrigger github = 2;
// generic contains the parameters for a Generic webhook type of trigger
optional WebHookTrigger generic = 3;
// imageChange contains parameters for an ImageChange type of trigger
optional ImageChangeTrigger imageChange = 4;
}
// CommonSpec encapsulates all the inputs necessary to represent a build.
message CommonSpec {
// serviceAccount is the name of the ServiceAccount to use to run the pod
// created by this build.
// The pod will be allowed to use secrets referenced by the ServiceAccount
optional string serviceAccount = 1;
// source describes the SCM in use.
optional BuildSource source = 2;
// revision is the information from the source for a specific repo snapshot.
// This is optional.
optional SourceRevision revision = 3;
// strategy defines how to perform a build.
optional BuildStrategy strategy = 4;
// output describes the Docker image the Strategy should produce.
optional BuildOutput output = 5;
// resources computes resource requirements to execute the build.
optional k8s.io.kubernetes.pkg.api.v1.ResourceRequirements resources = 6;
// postCommit is a build hook executed after the build output image is
// committed, before it is pushed to a registry.
optional BuildPostCommitSpec postCommit = 7;
// completionDeadlineSeconds is an optional duration in seconds, counted from
// the time when a build pod gets scheduled in the system, that the build may
// be active on a node before the system actively tries to terminate the
// build; value must be positive integer
optional int64 completionDeadlineSeconds = 8;
}
// CustomBuildStrategy defines input parameters specific to Custom build.
message CustomBuildStrategy {
// from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which
// the docker image should be pulled
optional k8s.io.kubernetes.pkg.api.v1.ObjectReference from = 1;
// pullSecret is the name of a Secret that would be used for setting up
// the authentication for pulling the Docker images from the private Docker
// registries
optional k8s.io.kubernetes.pkg.api.v1.LocalObjectReference pullSecret = 2;
// env contains additional environment variables you want to pass into a builder container
repeated k8s.io.kubernetes.pkg.api.v1.EnvVar env = 3;
// exposeDockerSocket will allow running Docker commands (and build Docker images) from
// inside the Docker container.
// TODO: Allow admins to enforce 'false' for this option
optional bool exposeDockerSocket = 4;
// forcePull describes if the controller should configure the build pod to always pull the images
// for the builder or only pull if it is not present locally
optional bool forcePull = 5;
// secrets is a list of additional secrets that will be included in the build pod
repeated SecretSpec secrets = 6;
// buildAPIVersion is the requested API version for the Build object serialized and passed to the custom builder
optional string buildAPIVersion = 7;
}
// DockerBuildStrategy defines input parameters specific to Docker build.
message DockerBuildStrategy {
// from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which
// the docker image should be pulled
// the resulting image will be used in the FROM line of the Dockerfile for this build.
optional k8s.io.kubernetes.pkg.api.v1.ObjectReference from = 1;
// pullSecret is the name of a Secret that would be used for setting up
// the authentication for pulling the Docker images from the private Docker
// registries
optional k8s.io.kubernetes.pkg.api.v1.LocalObjectReference pullSecret = 2;
// noCache if set to true indicates that the docker build must be executed with the
// --no-cache=true flag
optional bool noCache = 3;
// env contains additional environment variables you want to pass into a builder container
repeated k8s.io.kubernetes.pkg.api.v1.EnvVar env = 4;
// forcePull describes if the builder should pull the images from registry prior to building.
optional bool forcePull = 5;
// dockerfilePath is the path of the Dockerfile that will be used to build the Docker image,
// relative to the root of the context (contextDir).
optional string dockerfilePath = 6;
}
// GenericWebHookCause holds information about a generic WebHook that
// triggered a build.
message GenericWebHookCause {
// revision is an optional field that stores the git source revision
// information of the generic webhook trigger when it is available.
optional SourceRevision revision = 1;
// secret is the obfuscated webhook secret that triggered a build.
optional string secret = 2;
}
// GenericWebHookEvent is the payload expected for a generic webhook post
message GenericWebHookEvent {
// type is the type of source repository
// +k8s:conversion-gen=false
optional string type = 1;
// git is the git information if the Type is BuildSourceGit
optional GitInfo git = 2;
// env contains additional environment variables you want to pass into a builder container
repeated k8s.io.kubernetes.pkg.api.v1.EnvVar env = 3;
}
// GitBuildSource defines the parameters of a Git SCM
message GitBuildSource {
// uri points to the source that will be built. The structure of the source
// will depend on the type of build to run
optional string uri = 1;
// ref is the branch/tag/ref to build.
optional string ref = 2;
// httpProxy is a proxy used to reach the git repository over http
optional string httpProxy = 3;
// httpsProxy is a proxy used to reach the git repository over https
optional string httpsProxy = 4;
}
// GitHubWebHookCause has information about a GitHub webhook that triggered a
// build.
message GitHubWebHookCause {
// revision is the git revision information of the trigger.
optional SourceRevision revision = 1;
// secret is the obfuscated webhook secret that triggered a build.
optional string secret = 2;
}
// GitInfo is the aggregated git information for a generic webhook post
message GitInfo {
optional GitBuildSource gitBuildSource = 1;
optional GitSourceRevision gitSourceRevision = 2;
}
// GitSourceRevision is the commit information from a git source for a build
message GitSourceRevision {
// commit is the commit hash identifying a specific commit
optional string commit = 1;
// author is the author of a specific commit
optional SourceControlUser author = 2;
// committer is the committer of a specific commit
optional SourceControlUser committer = 3;
// message is the description of a specific commit
optional string message = 4;
}
// ImageChangeCause contains information about the image that triggered a
// build
message ImageChangeCause {
// imageID is the ID of the image that triggered a a new build.
optional string imageID = 1;
// fromRef contains detailed information about an image that triggered a
// build.
optional k8s.io.kubernetes.pkg.api.v1.ObjectReference fromRef = 2;
}
// ImageChangeTrigger allows builds to be triggered when an ImageStream changes
message ImageChangeTrigger {
// lastTriggeredImageID is used internally by the ImageChangeController to save last
// used image ID for build
optional string lastTriggeredImageID = 1;
// from is a reference to an ImageStreamTag that will trigger a build when updated
// It is optional. If no From is specified, the From image from the build strategy
// will be used. Only one ImageChangeTrigger with an empty From reference is allowed in
// a build configuration.
optional k8s.io.kubernetes.pkg.api.v1.ObjectReference from = 2;
}
// ImageSource describes an image that is used as source for the build
message ImageSource {
// from is a reference to an ImageStreamTag, ImageStreamImage, or DockerImage to
// copy source from.
optional k8s.io.kubernetes.pkg.api.v1.ObjectReference from = 1;
// paths is a list of source and destination paths to copy from the image.
repeated ImageSourcePath paths = 2;
// pullSecret is a reference to a secret to be used to pull the image from a registry
// If the image is pulled from the OpenShift registry, this field does not need to be set.
optional k8s.io.kubernetes.pkg.api.v1.LocalObjectReference pullSecret = 3;
}
// ImageSourcePath describes a path to be copied from a source image and its destination within the build directory.
message ImageSourcePath {
// sourcePath is the absolute path of the file or directory inside the image to
// copy to the build directory.
optional string sourcePath = 1;
// destinationDir is the relative directory within the build directory
// where files copied from the image are placed.
optional string destinationDir = 2;
}
// JenkinsPipelineBuildStrategy holds parameters specific to a Jenkins Pipeline build.
// This strategy is in tech preview.
message JenkinsPipelineBuildStrategy {
// JenkinsfilePath is the optional path of the Jenkinsfile that will be used to configure the pipeline
// relative to the root of the context (contextDir). If both JenkinsfilePath & Jenkinsfile are
// both not specified, this defaults to Jenkinsfile in the root of the specified contextDir.
optional string jenkinsfilePath = 1;
// Jenkinsfile defines the optional raw contents of a Jenkinsfile which defines a Jenkins pipeline build.
optional string jenkinsfile = 2;
}
// SecretBuildSource describes a secret and its destination directory that will be
// used only at the build time. The content of the secret referenced here will
// be copied into the destination directory instead of mounting.
message SecretBuildSource {
// secret is a reference to an existing secret that you want to use in your
// build.
optional k8s.io.kubernetes.pkg.api.v1.LocalObjectReference secret = 1;
// destinationDir is the directory where the files from the secret should be
// available for the build time.
// For the Source build strategy, these will be injected into a container
// where the assemble script runs. Later, when the script finishes, all files
// injected will be truncated to zero length.
// For the Docker build strategy, these will be copied into the build
// directory, where the Dockerfile is located, so users can ADD or COPY them
// during docker build.
optional string destinationDir = 2;
}
// SecretSpec specifies a secret to be included in a build pod and its corresponding mount point
message SecretSpec {
// secretSource is a reference to the secret
optional k8s.io.kubernetes.pkg.api.v1.LocalObjectReference secretSource = 1;
// mountPath is the path at which to mount the secret
optional string mountPath = 2;
}
// SourceBuildStrategy defines input parameters specific to an Source build.
message SourceBuildStrategy {
// from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which
// the docker image should be pulled
optional k8s.io.kubernetes.pkg.api.v1.ObjectReference from = 1;
// pullSecret is the name of a Secret that would be used for setting up
// the authentication for pulling the Docker images from the private Docker
// registries
optional k8s.io.kubernetes.pkg.api.v1.LocalObjectReference pullSecret = 2;
// env contains additional environment variables you want to pass into a builder container
repeated k8s.io.kubernetes.pkg.api.v1.EnvVar env = 3;
// scripts is the location of Source scripts
optional string scripts = 4;
// incremental flag forces the Source build to do incremental builds if true.
optional bool incremental = 5;
// forcePull describes if the builder should pull the images from registry prior to building.
optional bool forcePull = 6;
// runtimeImage is an optional image that is used to run an application
// without unneeded dependencies installed. The building of the application
// is still done in the builder image but, post build, you can copy the
// needed artifacts in the runtime image for use.
// This field and the feature it enables are in tech preview.
optional k8s.io.kubernetes.pkg.api.v1.ObjectReference runtimeImage = 7;
// runtimeArtifacts specifies a list of source/destination pairs that will be
// copied from the builder to the runtime image. sourcePath can be a file or
// directory. destinationDir must be a directory. destinationDir can also be
// empty or equal to ".", in this case it just refers to the root of WORKDIR.
// This field and the feature it enables are in tech preview.
repeated ImageSourcePath runtimeArtifacts = 8;
}
// SourceControlUser defines the identity of a user of source control
message SourceControlUser {
// name of the source control user
optional string name = 1;
// email of the source control user
optional string email = 2;
}
// SourceRevision is the revision or commit information from the source for the build
message SourceRevision {
// type of the build source, may be one of 'Source', 'Dockerfile', 'Binary', or 'Images'
// +k8s:conversion-gen=false
optional string type = 1;
// Git contains information about git-based build source
optional GitSourceRevision git = 2;
}
// WebHookTrigger is a trigger that gets invoked using a webhook type of post
message WebHookTrigger {
// secret used to validate requests.
optional string secret = 1;
// allowEnv determines whether the webhook can set environment variables; can only
// be set to true for GenericWebHook.
optional bool allowEnv = 2;
}

View File

@ -0,0 +1,40 @@
package v1
import (
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/runtime"
)
const GroupName = ""
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1"}
var (
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addConversionFuncs, addDefaultingFuncs)
AddToScheme = SchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&Build{},
&BuildList{},
&BuildConfig{},
&BuildConfigList{},
&BuildLog{},
&BuildRequest{},
&BuildLogOptions{},
&BinaryBuildRequestOptions{},
)
return nil
}
func (obj *Build) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
func (obj *BuildList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
func (obj *BuildConfig) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
func (obj *BuildConfigList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
func (obj *BuildLog) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
func (obj *BuildRequest) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
func (obj *BuildLogOptions) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
func (obj *BinaryBuildRequestOptions) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }

View File

@ -0,0 +1,459 @@
package v1
// This file contains methods that can be used by the go-restful package to generate Swagger
// documentation for the object types found in 'types.go' This file is automatically generated
// by hack/update-generated-swagger-descriptions.sh and should be run after a full build of OpenShift.
// ==== DO NOT EDIT THIS FILE MANUALLY ====
var map_BinaryBuildRequestOptions = map[string]string{
"": "BinaryBuildRequestOptions are the options required to fully speficy a binary build request",
"metadata": "metadata for BinaryBuildRequestOptions.",
"asFile": "asFile determines if the binary should be created as a file within the source rather than extracted as an archive",
"revision.commit": "revision.commit is the value identifying a specific commit",
"revision.message": "revision.message is the description of a specific commit",
"revision.authorName": "revision.authorName of the source control user",
"revision.authorEmail": "revision.authorEmail of the source control user",
"revision.committerName": "revision.committerName of the source control user",
"revision.committerEmail": "revision.committerEmail of the source control user",
}
func (BinaryBuildRequestOptions) SwaggerDoc() map[string]string {
return map_BinaryBuildRequestOptions
}
var map_BinaryBuildSource = map[string]string{
"": "BinaryBuildSource describes a binary file to be used for the Docker and Source build strategies, where the file will be extracted and used as the build source.",
"asFile": "asFile indicates that the provided binary input should be considered a single file within the build input. For example, specifying \"webapp.war\" would place the provided binary as `/webapp.war` for the builder. If left empty, the Docker and Source build strategies assume this file is a zip, tar, or tar.gz file and extract it as the source. The custom strategy receives this binary as standard input. This filename may not contain slashes or be '..' or '.'.",
}
func (BinaryBuildSource) SwaggerDoc() map[string]string {
return map_BinaryBuildSource
}
var map_Build = map[string]string{
"": "Build encapsulates the inputs needed to produce a new deployable image, as well as the status of the execution and a reference to the Pod which executed the build.",
"metadata": "Standard object's metadata.",
"spec": "spec is all the inputs used to execute the build.",
"status": "status is the current status of the build.",
}
func (Build) SwaggerDoc() map[string]string {
return map_Build
}
var map_BuildConfig = map[string]string{
"": "BuildConfig is a template which can be used to create new builds.",
"metadata": "metadata for BuildConfig.",
"spec": "spec holds all the input necessary to produce a new build, and the conditions when to trigger them.",
"status": "status holds any relevant information about a build config",
}
func (BuildConfig) SwaggerDoc() map[string]string {
return map_BuildConfig
}
var map_BuildConfigList = map[string]string{
"": "BuildConfigList is a collection of BuildConfigs.",
"metadata": "metadata for BuildConfigList.",
"items": "items is a list of build configs",
}
func (BuildConfigList) SwaggerDoc() map[string]string {
return map_BuildConfigList
}
var map_BuildConfigSpec = map[string]string{
"": "BuildConfigSpec describes when and how builds are created",
"triggers": "triggers determine how new Builds can be launched from a BuildConfig. If no triggers are defined, a new build can only occur as a result of an explicit client build creation.",
"runPolicy": "RunPolicy describes how the new build created from this build configuration will be scheduled for execution. This is optional, if not specified we default to \"Serial\".",
}
func (BuildConfigSpec) SwaggerDoc() map[string]string {
return map_BuildConfigSpec
}
var map_BuildConfigStatus = map[string]string{
"": "BuildConfigStatus contains current state of the build config object.",
"lastVersion": "lastVersion is used to inform about number of last triggered build.",
}
func (BuildConfigStatus) SwaggerDoc() map[string]string {
return map_BuildConfigStatus
}
var map_BuildList = map[string]string{
"": "BuildList is a collection of Builds.",
"metadata": "metadata for BuildList.",
"items": "items is a list of builds",
}
func (BuildList) SwaggerDoc() map[string]string {
return map_BuildList
}
var map_BuildLog = map[string]string{
"": "BuildLog is the (unused) resource associated with the build log redirector",
}
func (BuildLog) SwaggerDoc() map[string]string {
return map_BuildLog
}
var map_BuildLogOptions = map[string]string{
"": "BuildLogOptions is the REST options for a build log",
"container": "cointainer for which to stream logs. Defaults to only container if there is one container in the pod.",
"follow": "follow if true indicates that the build log should be streamed until the build terminates.",
"previous": "previous returns previous build logs. Defaults to false.",
"sinceSeconds": "sinceSeconds is a relative time in seconds before the current time from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified.",
"sinceTime": "sinceTime is an RFC3339 timestamp from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified.",
"timestamps": "timestamps, If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line of log output. Defaults to false.",
"tailLines": "tailLines, If set, is the number of lines from the end of the logs to show. If not specified, logs are shown from the creation of the container or sinceSeconds or sinceTime",
"limitBytes": "limitBytes, If set, is the number of bytes to read from the server before terminating the log output. This may not display a complete final line of logging, and may return slightly more or slightly less than the specified limit.",
"nowait": "noWait if true causes the call to return immediately even if the build is not available yet. Otherwise the server will wait until the build has started.",
"version": "version of the build for which to view logs.",
}
func (BuildLogOptions) SwaggerDoc() map[string]string {
return map_BuildLogOptions
}
var map_BuildOutput = map[string]string{
"": "BuildOutput is input to a build strategy and describes the Docker image that the strategy should produce.",
"to": "to defines an optional location to push the output of this build to. Kind must be one of 'ImageStreamTag' or 'DockerImage'. This value will be used to look up a Docker image repository to push to. In the case of an ImageStreamTag, the ImageStreamTag will be looked for in the namespace of the build unless Namespace is specified.",
"pushSecret": "PushSecret is the name of a Secret that would be used for setting up the authentication for executing the Docker push to authentication enabled Docker Registry (or Docker Hub).",
}
func (BuildOutput) SwaggerDoc() map[string]string {
return map_BuildOutput
}
var map_BuildPostCommitSpec = map[string]string{
"": "A BuildPostCommitSpec holds a build post commit hook specification. The hook executes a command in a temporary container running the build output image, immediately after the last layer of the image is committed and before the image is pushed to a registry. The command is executed with the current working directory ($PWD) set to the image's WORKDIR.\n\nThe build will be marked as failed if the hook execution fails. It will fail if the script or command return a non-zero exit code, or if there is any other error related to starting the temporary container.\n\nThere are five different ways to configure the hook. As an example, all forms below are equivalent and will execute `rake test --verbose`.\n\n1. Shell script:\n\n \"postCommit\": {\n \"script\": \"rake test --verbose\",\n }\n\n The above is a convenient form which is equivalent to:\n\n \"postCommit\": {\n \"command\": [\"/bin/sh\", \"-ic\"],\n \"args\": [\"rake test --verbose\"]\n }\n\n2. A command as the image entrypoint:\n\n \"postCommit\": {\n \"commit\": [\"rake\", \"test\", \"--verbose\"]\n }\n\n Command overrides the image entrypoint in the exec form, as documented in\n Docker: https://docs.docker.com/engine/reference/builder/#entrypoint.\n\n3. Pass arguments to the default entrypoint:\n\n \"postCommit\": {\n\t\t \"args\": [\"rake\", \"test\", \"--verbose\"]\n\t }\n\n This form is only useful if the image entrypoint can handle arguments.\n\n4. Shell script with arguments:\n\n \"postCommit\": {\n \"script\": \"rake test $1\",\n \"args\": [\"--verbose\"]\n }\n\n This form is useful if you need to pass arguments that would otherwise be\n hard to quote properly in the shell script. In the script, $0 will be\n \"/bin/sh\" and $1, $2, etc, are the positional arguments from Args.\n\n5. Command with arguments:\n\n \"postCommit\": {\n \"command\": [\"rake\", \"test\"],\n \"args\": [\"--verbose\"]\n }\n\n This form is equivalent to appending the arguments to the Command slice.\n\nIt is invalid to provide both Script and Command simultaneously. If none of the fields are specified, the hook is not executed.",
"command": "command is the command to run. It may not be specified with Script. This might be needed if the image doesn't have `/bin/sh`, or if you do not want to use a shell. In all other cases, using Script might be more convenient.",
"args": "args is a list of arguments that are provided to either Command, Script or the Docker image's default entrypoint. The arguments are placed immediately after the command to be run.",
"script": "script is a shell script to be run with `/bin/sh -ic`. It may not be specified with Command. Use Script when a shell script is appropriate to execute the post build hook, for example for running unit tests with `rake test`. If you need control over the image entrypoint, or if the image does not have `/bin/sh`, use Command and/or Args. The `-i` flag is needed to support CentOS and RHEL images that use Software Collections (SCL), in order to have the appropriate collections enabled in the shell. E.g., in the Ruby image, this is necessary to make `ruby`, `bundle` and other binaries available in the PATH.",
}
func (BuildPostCommitSpec) SwaggerDoc() map[string]string {
return map_BuildPostCommitSpec
}
var map_BuildRequest = map[string]string{
"": "BuildRequest is the resource used to pass parameters to build generator",
"metadata": "metadata for BuildRequest.",
"revision": "revision is the information from the source for a specific repo snapshot.",
"triggeredByImage": "triggeredByImage is the Image that triggered this build.",
"from": "from is the reference to the ImageStreamTag that triggered the build.",
"binary": "binary indicates a request to build from a binary provided to the builder",
"lastVersion": "lastVersion (optional) is the LastVersion of the BuildConfig that was used to generate the build. If the BuildConfig in the generator doesn't match, a build will not be generated.",
"env": "env contains additional environment variables you want to pass into a builder container",
"triggeredBy": "triggeredBy describes which triggers started the most recent update to the build configuration and contains information about those triggers.",
}
func (BuildRequest) SwaggerDoc() map[string]string {
return map_BuildRequest
}
var map_BuildSource = map[string]string{
"": "BuildSource is the SCM used for the build.",
"type": "type of build input to accept",
"binary": "binary builds accept a binary as their input. The binary is generally assumed to be a tar, gzipped tar, or zip file depending on the strategy. For Docker builds, this is the build context and an optional Dockerfile may be specified to override any Dockerfile in the build context. For Source builds, this is assumed to be an archive as described above. For Source and Docker builds, if binary.asFile is set the build will receive a directory with a single file. contextDir may be used when an archive is provided. Custom builds will receive this binary as input on STDIN.",
"dockerfile": "dockerfile is the raw contents of a Dockerfile which should be built. When this option is specified, the FROM may be modified based on your strategy base image and additional ENV stanzas from your strategy environment will be added after the FROM, but before the rest of your Dockerfile stanzas. The Dockerfile source type may be used with other options like git - in those cases the Git repo will have any innate Dockerfile replaced in the context dir.",
"git": "git contains optional information about git build source",
"images": "images describes a set of images to be used to provide source for the build",
"contextDir": "contextDir specifies the sub-directory where the source code for the application exists. This allows to have buildable sources in directory other than root of repository.",
"sourceSecret": "sourceSecret is the name of a Secret that would be used for setting up the authentication for cloning private repository. The secret contains valid credentials for remote repository, where the data's key represent the authentication method to be used and value is the base64 encoded credentials. Supported auth methods are: ssh-privatekey.",
"secrets": "secrets represents a list of secrets and their destinations that will be used only for the build.",
}
func (BuildSource) SwaggerDoc() map[string]string {
return map_BuildSource
}
var map_BuildSpec = map[string]string{
"": "BuildSpec has the information to represent a build and also additional information about a build",
"triggeredBy": "triggeredBy describes which triggers started the most recent update to the build configuration and contains information about those triggers.",
}
func (BuildSpec) SwaggerDoc() map[string]string {
return map_BuildSpec
}
var map_BuildStatus = map[string]string{
"": "BuildStatus contains the status of a build",
"phase": "phase is the point in the build lifecycle.",
"cancelled": "cancelled describes if a cancel event was triggered for the build.",
"reason": "reason is a brief CamelCase string that describes any failure and is meant for machine parsing and tidy display in the CLI.",
"message": "message is a human-readable message indicating details about why the build has this status.",
"startTimestamp": "startTimestamp is a timestamp representing the server time when this Build started running in a Pod. It is represented in RFC3339 form and is in UTC.",
"completionTimestamp": "completionTimestamp is a timestamp representing the server time when this Build was finished, whether that build failed or succeeded. It reflects the time at which the Pod running the Build terminated. It is represented in RFC3339 form and is in UTC.",
"duration": "duration contains time.Duration object describing build time.",
"outputDockerImageReference": "outputDockerImageReference contains a reference to the Docker image that will be built by this build. Its value is computed from Build.Spec.Output.To, and should include the registry address, so that it can be used to push and pull the image.",
"config": "config is an ObjectReference to the BuildConfig this Build is based on.",
}
func (BuildStatus) SwaggerDoc() map[string]string {
return map_BuildStatus
}
var map_BuildStrategy = map[string]string{
"": "BuildStrategy contains the details of how to perform a build.",
"type": "type is the kind of build strategy.",
"dockerStrategy": "dockerStrategy holds the parameters to the Docker build strategy.",
"sourceStrategy": "sourceStrategy holds the parameters to the Source build strategy.",
"customStrategy": "customStrategy holds the parameters to the Custom build strategy",
"jenkinsPipelineStrategy": "JenkinsPipelineStrategy holds the parameters to the Jenkins Pipeline build strategy. This strategy is in tech preview.",
}
func (BuildStrategy) SwaggerDoc() map[string]string {
return map_BuildStrategy
}
var map_BuildTriggerCause = map[string]string{
"": "BuildTriggerCause holds information about a triggered build. It is used for displaying build trigger data for each build and build configuration in oc describe. It is also used to describe which triggers led to the most recent update in the build configuration.",
"message": "message is used to store a human readable message for why the build was triggered. E.g.: \"Manually triggered by user\", \"Configuration change\",etc.",
"genericWebHook": "genericWebHook holds data about a builds generic webhook trigger.",
"githubWebHook": "gitHubWebHook represents data for a GitHub webhook that fired a specific build.",
"imageChangeBuild": "imageChangeBuild stores information about an imagechange event that triggered a new build.",
}
func (BuildTriggerCause) SwaggerDoc() map[string]string {
return map_BuildTriggerCause
}
var map_BuildTriggerPolicy = map[string]string{
"": "BuildTriggerPolicy describes a policy for a single trigger that results in a new Build.",
"type": "type is the type of build trigger",
"github": "github contains the parameters for a GitHub webhook type of trigger",
"generic": "generic contains the parameters for a Generic webhook type of trigger",
"imageChange": "imageChange contains parameters for an ImageChange type of trigger",
}
func (BuildTriggerPolicy) SwaggerDoc() map[string]string {
return map_BuildTriggerPolicy
}
var map_CommonSpec = map[string]string{
"": "CommonSpec encapsulates all the inputs necessary to represent a build.",
"serviceAccount": "serviceAccount is the name of the ServiceAccount to use to run the pod created by this build. The pod will be allowed to use secrets referenced by the ServiceAccount",
"source": "source describes the SCM in use.",
"revision": "revision is the information from the source for a specific repo snapshot. This is optional.",
"strategy": "strategy defines how to perform a build.",
"output": "output describes the Docker image the Strategy should produce.",
"resources": "resources computes resource requirements to execute the build.",
"postCommit": "postCommit is a build hook executed after the build output image is committed, before it is pushed to a registry.",
"completionDeadlineSeconds": "completionDeadlineSeconds is an optional duration in seconds, counted from the time when a build pod gets scheduled in the system, that the build may be active on a node before the system actively tries to terminate the build; value must be positive integer",
}
func (CommonSpec) SwaggerDoc() map[string]string {
return map_CommonSpec
}
var map_CustomBuildStrategy = map[string]string{
"": "CustomBuildStrategy defines input parameters specific to Custom build.",
"from": "from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which the docker image should be pulled",
"pullSecret": "pullSecret is the name of a Secret that would be used for setting up the authentication for pulling the Docker images from the private Docker registries",
"env": "env contains additional environment variables you want to pass into a builder container",
"exposeDockerSocket": "exposeDockerSocket will allow running Docker commands (and build Docker images) from inside the Docker container.",
"forcePull": "forcePull describes if the controller should configure the build pod to always pull the images for the builder or only pull if it is not present locally",
"secrets": "secrets is a list of additional secrets that will be included in the build pod",
"buildAPIVersion": "buildAPIVersion is the requested API version for the Build object serialized and passed to the custom builder",
}
func (CustomBuildStrategy) SwaggerDoc() map[string]string {
return map_CustomBuildStrategy
}
var map_DockerBuildStrategy = map[string]string{
"": "DockerBuildStrategy defines input parameters specific to Docker build.",
"from": "from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which the docker image should be pulled the resulting image will be used in the FROM line of the Dockerfile for this build.",
"pullSecret": "pullSecret is the name of a Secret that would be used for setting up the authentication for pulling the Docker images from the private Docker registries",
"noCache": "noCache if set to true indicates that the docker build must be executed with the --no-cache=true flag",
"env": "env contains additional environment variables you want to pass into a builder container",
"forcePull": "forcePull describes if the builder should pull the images from registry prior to building.",
"dockerfilePath": "dockerfilePath is the path of the Dockerfile that will be used to build the Docker image, relative to the root of the context (contextDir).",
}
func (DockerBuildStrategy) SwaggerDoc() map[string]string {
return map_DockerBuildStrategy
}
var map_GenericWebHookCause = map[string]string{
"": "GenericWebHookCause holds information about a generic WebHook that triggered a build.",
"revision": "revision is an optional field that stores the git source revision information of the generic webhook trigger when it is available.",
"secret": "secret is the obfuscated webhook secret that triggered a build.",
}
func (GenericWebHookCause) SwaggerDoc() map[string]string {
return map_GenericWebHookCause
}
var map_GenericWebHookEvent = map[string]string{
"": "GenericWebHookEvent is the payload expected for a generic webhook post",
"type": "type is the type of source repository",
"git": "git is the git information if the Type is BuildSourceGit",
"env": "env contains additional environment variables you want to pass into a builder container",
}
func (GenericWebHookEvent) SwaggerDoc() map[string]string {
return map_GenericWebHookEvent
}
var map_GitBuildSource = map[string]string{
"": "GitBuildSource defines the parameters of a Git SCM",
"uri": "uri points to the source that will be built. The structure of the source will depend on the type of build to run",
"ref": "ref is the branch/tag/ref to build.",
"httpProxy": "httpProxy is a proxy used to reach the git repository over http",
"httpsProxy": "httpsProxy is a proxy used to reach the git repository over https",
}
func (GitBuildSource) SwaggerDoc() map[string]string {
return map_GitBuildSource
}
var map_GitHubWebHookCause = map[string]string{
"": "GitHubWebHookCause has information about a GitHub webhook that triggered a build.",
"revision": "revision is the git revision information of the trigger.",
"secret": "secret is the obfuscated webhook secret that triggered a build.",
}
func (GitHubWebHookCause) SwaggerDoc() map[string]string {
return map_GitHubWebHookCause
}
var map_GitInfo = map[string]string{
"": "GitInfo is the aggregated git information for a generic webhook post",
}
func (GitInfo) SwaggerDoc() map[string]string {
return map_GitInfo
}
var map_GitSourceRevision = map[string]string{
"": "GitSourceRevision is the commit information from a git source for a build",
"commit": "commit is the commit hash identifying a specific commit",
"author": "author is the author of a specific commit",
"committer": "committer is the committer of a specific commit",
"message": "message is the description of a specific commit",
}
func (GitSourceRevision) SwaggerDoc() map[string]string {
return map_GitSourceRevision
}
var map_ImageChangeCause = map[string]string{
"": "ImageChangeCause contains information about the image that triggered a build",
"imageID": "imageID is the ID of the image that triggered a a new build.",
"fromRef": "fromRef contains detailed information about an image that triggered a build.",
}
func (ImageChangeCause) SwaggerDoc() map[string]string {
return map_ImageChangeCause
}
var map_ImageChangeTrigger = map[string]string{
"": "ImageChangeTrigger allows builds to be triggered when an ImageStream changes",
"lastTriggeredImageID": "lastTriggeredImageID is used internally by the ImageChangeController to save last used image ID for build",
"from": "from is a reference to an ImageStreamTag that will trigger a build when updated It is optional. If no From is specified, the From image from the build strategy will be used. Only one ImageChangeTrigger with an empty From reference is allowed in a build configuration.",
}
func (ImageChangeTrigger) SwaggerDoc() map[string]string {
return map_ImageChangeTrigger
}
var map_ImageSource = map[string]string{
"": "ImageSource describes an image that is used as source for the build",
"from": "from is a reference to an ImageStreamTag, ImageStreamImage, or DockerImage to copy source from.",
"paths": "paths is a list of source and destination paths to copy from the image.",
"pullSecret": "pullSecret is a reference to a secret to be used to pull the image from a registry If the image is pulled from the OpenShift registry, this field does not need to be set.",
}
func (ImageSource) SwaggerDoc() map[string]string {
return map_ImageSource
}
var map_ImageSourcePath = map[string]string{
"": "ImageSourcePath describes a path to be copied from a source image and its destination within the build directory.",
"sourcePath": "sourcePath is the absolute path of the file or directory inside the image to copy to the build directory.",
"destinationDir": "destinationDir is the relative directory within the build directory where files copied from the image are placed.",
}
func (ImageSourcePath) SwaggerDoc() map[string]string {
return map_ImageSourcePath
}
var map_JenkinsPipelineBuildStrategy = map[string]string{
"": "JenkinsPipelineBuildStrategy holds parameters specific to a Jenkins Pipeline build. This strategy is in tech preview.",
"jenkinsfilePath": "JenkinsfilePath is the optional path of the Jenkinsfile that will be used to configure the pipeline relative to the root of the context (contextDir). If both JenkinsfilePath & Jenkinsfile are both not specified, this defaults to Jenkinsfile in the root of the specified contextDir.",
"jenkinsfile": "Jenkinsfile defines the optional raw contents of a Jenkinsfile which defines a Jenkins pipeline build.",
}
func (JenkinsPipelineBuildStrategy) SwaggerDoc() map[string]string {
return map_JenkinsPipelineBuildStrategy
}
var map_SecretBuildSource = map[string]string{
"": "SecretBuildSource describes a secret and its destination directory that will be used only at the build time. The content of the secret referenced here will be copied into the destination directory instead of mounting.",
"secret": "secret is a reference to an existing secret that you want to use in your build.",
"destinationDir": "destinationDir is the directory where the files from the secret should be available for the build time. For the Source build strategy, these will be injected into a container where the assemble script runs. Later, when the script finishes, all files injected will be truncated to zero length. For the Docker build strategy, these will be copied into the build directory, where the Dockerfile is located, so users can ADD or COPY them during docker build.",
}
func (SecretBuildSource) SwaggerDoc() map[string]string {
return map_SecretBuildSource
}
var map_SecretSpec = map[string]string{
"": "SecretSpec specifies a secret to be included in a build pod and its corresponding mount point",
"secretSource": "secretSource is a reference to the secret",
"mountPath": "mountPath is the path at which to mount the secret",
}
func (SecretSpec) SwaggerDoc() map[string]string {
return map_SecretSpec
}
var map_SourceBuildStrategy = map[string]string{
"": "SourceBuildStrategy defines input parameters specific to an Source build.",
"from": "from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which the docker image should be pulled",
"pullSecret": "pullSecret is the name of a Secret that would be used for setting up the authentication for pulling the Docker images from the private Docker registries",
"env": "env contains additional environment variables you want to pass into a builder container",
"scripts": "scripts is the location of Source scripts",
"incremental": "incremental flag forces the Source build to do incremental builds if true.",
"forcePull": "forcePull describes if the builder should pull the images from registry prior to building.",
"runtimeImage": "runtimeImage is an optional image that is used to run an application without unneeded dependencies installed. The building of the application is still done in the builder image but, post build, you can copy the needed artifacts in the runtime image for use. This field and the feature it enables are in tech preview.",
"runtimeArtifacts": "runtimeArtifacts specifies a list of source/destination pairs that will be copied from the builder to the runtime image. sourcePath can be a file or directory. destinationDir must be a directory. destinationDir can also be empty or equal to \".\", in this case it just refers to the root of WORKDIR. This field and the feature it enables are in tech preview.",
}
func (SourceBuildStrategy) SwaggerDoc() map[string]string {
return map_SourceBuildStrategy
}
var map_SourceControlUser = map[string]string{
"": "SourceControlUser defines the identity of a user of source control",
"name": "name of the source control user",
"email": "email of the source control user",
}
func (SourceControlUser) SwaggerDoc() map[string]string {
return map_SourceControlUser
}
var map_SourceRevision = map[string]string{
"": "SourceRevision is the revision or commit information from the source for the build",
"type": "type of the build source, may be one of 'Source', 'Dockerfile', 'Binary', or 'Images'",
"git": "Git contains information about git-based build source",
}
func (SourceRevision) SwaggerDoc() map[string]string {
return map_SourceRevision
}
var map_WebHookTrigger = map[string]string{
"": "WebHookTrigger is a trigger that gets invoked using a webhook type of post",
"secret": "secret used to validate requests.",
"allowEnv": "allowEnv determines whether the webhook can set environment variables; can only be set to true for GenericWebHook.",
}
func (WebHookTrigger) SwaggerDoc() map[string]string {
return map_WebHookTrigger
}

View File

@ -0,0 +1,884 @@
package v1
import (
"time"
"k8s.io/kubernetes/pkg/api/unversioned"
kapi "k8s.io/kubernetes/pkg/api/v1"
)
// +genclient=true
// Build encapsulates the inputs needed to produce a new deployable image, as well as
// the status of the execution and a reference to the Pod which executed the build.
type Build struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
kapi.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// spec is all the inputs used to execute the build.
Spec BuildSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// status is the current status of the build.
Status BuildStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
// BuildSpec has the information to represent a build and also additional
// information about a build
type BuildSpec struct {
// CommonSpec is the information that represents a build
CommonSpec `json:",inline" protobuf:"bytes,1,opt,name=commonSpec"`
// triggeredBy describes which triggers started the most recent update to the
// build configuration and contains information about those triggers.
TriggeredBy []BuildTriggerCause `json:"triggeredBy" protobuf:"bytes,2,rep,name=triggeredBy"`
}
// CommonSpec encapsulates all the inputs necessary to represent a build.
type CommonSpec struct {
// serviceAccount is the name of the ServiceAccount to use to run the pod
// created by this build.
// The pod will be allowed to use secrets referenced by the ServiceAccount
ServiceAccount string `json:"serviceAccount,omitempty" protobuf:"bytes,1,opt,name=serviceAccount"`
// source describes the SCM in use.
Source BuildSource `json:"source,omitempty" protobuf:"bytes,2,opt,name=source"`
// revision is the information from the source for a specific repo snapshot.
// This is optional.
Revision *SourceRevision `json:"revision,omitempty" protobuf:"bytes,3,opt,name=revision"`
// strategy defines how to perform a build.
Strategy BuildStrategy `json:"strategy" protobuf:"bytes,4,opt,name=strategy"`
// output describes the Docker image the Strategy should produce.
Output BuildOutput `json:"output,omitempty" protobuf:"bytes,5,opt,name=output"`
// resources computes resource requirements to execute the build.
Resources kapi.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,6,opt,name=resources"`
// postCommit is a build hook executed after the build output image is
// committed, before it is pushed to a registry.
PostCommit BuildPostCommitSpec `json:"postCommit,omitempty" protobuf:"bytes,7,opt,name=postCommit"`
// completionDeadlineSeconds is an optional duration in seconds, counted from
// the time when a build pod gets scheduled in the system, that the build may
// be active on a node before the system actively tries to terminate the
// build; value must be positive integer
CompletionDeadlineSeconds *int64 `json:"completionDeadlineSeconds,omitempty" protobuf:"varint,8,opt,name=completionDeadlineSeconds"`
}
// BuildTriggerCause holds information about a triggered build. It is used for
// displaying build trigger data for each build and build configuration in oc
// describe. It is also used to describe which triggers led to the most recent
// update in the build configuration.
type BuildTriggerCause struct {
// message is used to store a human readable message for why the build was
// triggered. E.g.: "Manually triggered by user", "Configuration change",etc.
Message string `json:"message,omitempty" protobuf:"bytes,1,opt,name=message"`
// genericWebHook holds data about a builds generic webhook trigger.
GenericWebHook *GenericWebHookCause `json:"genericWebHook,omitempty" protobuf:"bytes,2,opt,name=genericWebHook"`
// gitHubWebHook represents data for a GitHub webhook that fired a
//specific build.
GitHubWebHook *GitHubWebHookCause `json:"githubWebHook,omitempty" protobuf:"bytes,3,opt,name=githubWebHook"`
// imageChangeBuild stores information about an imagechange event
// that triggered a new build.
ImageChangeBuild *ImageChangeCause `json:"imageChangeBuild,omitempty" protobuf:"bytes,4,opt,name=imageChangeBuild"`
}
// GenericWebHookCause holds information about a generic WebHook that
// triggered a build.
type GenericWebHookCause struct {
// revision is an optional field that stores the git source revision
// information of the generic webhook trigger when it is available.
Revision *SourceRevision `json:"revision,omitempty" protobuf:"bytes,1,opt,name=revision"`
// secret is the obfuscated webhook secret that triggered a build.
Secret string `json:"secret,omitempty" protobuf:"bytes,2,opt,name=secret"`
}
// GitHubWebHookCause has information about a GitHub webhook that triggered a
// build.
type GitHubWebHookCause struct {
// revision is the git revision information of the trigger.
Revision *SourceRevision `json:"revision,omitempty" protobuf:"bytes,1,opt,name=revision"`
// secret is the obfuscated webhook secret that triggered a build.
Secret string `json:"secret,omitempty" protobuf:"bytes,2,opt,name=secret"`
}
// ImageChangeCause contains information about the image that triggered a
// build
type ImageChangeCause struct {
// imageID is the ID of the image that triggered a a new build.
ImageID string `json:"imageID,omitempty" protobuf:"bytes,1,opt,name=imageID"`
// fromRef contains detailed information about an image that triggered a
// build.
FromRef *kapi.ObjectReference `json:"fromRef,omitempty" protobuf:"bytes,2,opt,name=fromRef"`
}
// BuildStatus contains the status of a build
type BuildStatus struct {
// phase is the point in the build lifecycle.
Phase BuildPhase `json:"phase" protobuf:"bytes,1,opt,name=phase,casttype=BuildPhase"`
// cancelled describes if a cancel event was triggered for the build.
Cancelled bool `json:"cancelled,omitempty" protobuf:"varint,2,opt,name=cancelled"`
// reason is a brief CamelCase string that describes any failure and is meant for machine parsing and tidy display in the CLI.
Reason StatusReason `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason,casttype=StatusReason"`
// message is a human-readable message indicating details about why the build has this status.
Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"`
// startTimestamp is a timestamp representing the server time when this Build started
// running in a Pod.
// It is represented in RFC3339 form and is in UTC.
StartTimestamp *unversioned.Time `json:"startTimestamp,omitempty" protobuf:"bytes,5,opt,name=startTimestamp"`
// completionTimestamp is a timestamp representing the server time when this Build was
// finished, whether that build failed or succeeded. It reflects the time at which
// the Pod running the Build terminated.
// It is represented in RFC3339 form and is in UTC.
CompletionTimestamp *unversioned.Time `json:"completionTimestamp,omitempty" protobuf:"bytes,6,opt,name=completionTimestamp"`
// duration contains time.Duration object describing build time.
Duration time.Duration `json:"duration,omitempty" protobuf:"varint,7,opt,name=duration,casttype=time.Duration"`
// outputDockerImageReference contains a reference to the Docker image that
// will be built by this build. Its value is computed from
// Build.Spec.Output.To, and should include the registry address, so that
// it can be used to push and pull the image.
OutputDockerImageReference string `json:"outputDockerImageReference,omitempty" protobuf:"bytes,8,opt,name=outputDockerImageReference"`
// config is an ObjectReference to the BuildConfig this Build is based on.
Config *kapi.ObjectReference `json:"config,omitempty" protobuf:"bytes,9,opt,name=config"`
}
// BuildPhase represents the status of a build at a point in time.
type BuildPhase string
// Valid values for BuildPhase.
const (
// BuildPhaseNew is automatically assigned to a newly created build.
BuildPhaseNew BuildPhase = "New"
// BuildPhasePending indicates that a pod name has been assigned and a build is
// about to start running.
BuildPhasePending BuildPhase = "Pending"
// BuildPhaseRunning indicates that a pod has been created and a build is running.
BuildPhaseRunning BuildPhase = "Running"
// BuildPhaseComplete indicates that a build has been successful.
BuildPhaseComplete BuildPhase = "Complete"
// BuildPhaseFailed indicates that a build has executed and failed.
BuildPhaseFailed BuildPhase = "Failed"
// BuildPhaseError indicates that an error prevented the build from executing.
BuildPhaseError BuildPhase = "Error"
// BuildPhaseCancelled indicates that a running/pending build was stopped from executing.
BuildPhaseCancelled BuildPhase = "Cancelled"
)
// StatusReason is a brief CamelCase string that describes a temporary or
// permanent build error condition, meant for machine parsing and tidy display
// in the CLI.
type StatusReason string
// BuildSourceType is the type of SCM used.
type BuildSourceType string
// Valid values for BuildSourceType.
const (
//BuildSourceGit instructs a build to use a Git source control repository as the build input.
BuildSourceGit BuildSourceType = "Git"
// BuildSourceDockerfile uses a Dockerfile as the start of a build
BuildSourceDockerfile BuildSourceType = "Dockerfile"
// BuildSourceBinary indicates the build will accept a Binary file as input.
BuildSourceBinary BuildSourceType = "Binary"
// BuildSourceImage indicates the build will accept an image as input
BuildSourceImage BuildSourceType = "Image"
// BuildSourceNone indicates the build has no predefined input (only valid for Source and Custom Strategies)
BuildSourceNone BuildSourceType = "None"
)
// BuildSource is the SCM used for the build.
type BuildSource struct {
// type of build input to accept
// +k8s:conversion-gen=false
Type BuildSourceType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=BuildSourceType"`
// binary builds accept a binary as their input. The binary is generally assumed to be a tar,
// gzipped tar, or zip file depending on the strategy. For Docker builds, this is the build
// context and an optional Dockerfile may be specified to override any Dockerfile in the
// build context. For Source builds, this is assumed to be an archive as described above. For
// Source and Docker builds, if binary.asFile is set the build will receive a directory with
// a single file. contextDir may be used when an archive is provided. Custom builds will
// receive this binary as input on STDIN.
Binary *BinaryBuildSource `json:"binary,omitempty" protobuf:"bytes,2,opt,name=binary"`
// dockerfile is the raw contents of a Dockerfile which should be built. When this option is
// specified, the FROM may be modified based on your strategy base image and additional ENV
// stanzas from your strategy environment will be added after the FROM, but before the rest
// of your Dockerfile stanzas. The Dockerfile source type may be used with other options like
// git - in those cases the Git repo will have any innate Dockerfile replaced in the context
// dir.
Dockerfile *string `json:"dockerfile,omitempty" protobuf:"bytes,3,opt,name=dockerfile"`
// git contains optional information about git build source
Git *GitBuildSource `json:"git,omitempty" protobuf:"bytes,4,opt,name=git"`
// images describes a set of images to be used to provide source for the build
Images []ImageSource `json:"images,omitempty" protobuf:"bytes,5,rep,name=images"`
// contextDir specifies the sub-directory where the source code for the application exists.
// This allows to have buildable sources in directory other than root of
// repository.
ContextDir string `json:"contextDir,omitempty" protobuf:"bytes,6,opt,name=contextDir"`
// sourceSecret is the name of a Secret that would be used for setting
// up the authentication for cloning private repository.
// The secret contains valid credentials for remote repository, where the
// data's key represent the authentication method to be used and value is
// the base64 encoded credentials. Supported auth methods are: ssh-privatekey.
SourceSecret *kapi.LocalObjectReference `json:"sourceSecret,omitempty" protobuf:"bytes,7,opt,name=sourceSecret"`
// secrets represents a list of secrets and their destinations that will
// be used only for the build.
Secrets []SecretBuildSource `json:"secrets,omitempty" protobuf:"bytes,8,rep,name=secrets"`
}
// ImageSource describes an image that is used as source for the build
type ImageSource struct {
// from is a reference to an ImageStreamTag, ImageStreamImage, or DockerImage to
// copy source from.
From kapi.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"`
// paths is a list of source and destination paths to copy from the image.
Paths []ImageSourcePath `json:"paths" protobuf:"bytes,2,rep,name=paths"`
// pullSecret is a reference to a secret to be used to pull the image from a registry
// If the image is pulled from the OpenShift registry, this field does not need to be set.
PullSecret *kapi.LocalObjectReference `json:"pullSecret,omitempty" protobuf:"bytes,3,opt,name=pullSecret"`
}
// ImageSourcePath describes a path to be copied from a source image and its destination within the build directory.
type ImageSourcePath struct {
// sourcePath is the absolute path of the file or directory inside the image to
// copy to the build directory.
SourcePath string `json:"sourcePath" protobuf:"bytes,1,opt,name=sourcePath"`
// destinationDir is the relative directory within the build directory
// where files copied from the image are placed.
DestinationDir string `json:"destinationDir" protobuf:"bytes,2,opt,name=destinationDir"`
}
// SecretBuildSource describes a secret and its destination directory that will be
// used only at the build time. The content of the secret referenced here will
// be copied into the destination directory instead of mounting.
type SecretBuildSource struct {
// secret is a reference to an existing secret that you want to use in your
// build.
Secret kapi.LocalObjectReference `json:"secret" protobuf:"bytes,1,opt,name=secret"`
// destinationDir is the directory where the files from the secret should be
// available for the build time.
// For the Source build strategy, these will be injected into a container
// where the assemble script runs. Later, when the script finishes, all files
// injected will be truncated to zero length.
// For the Docker build strategy, these will be copied into the build
// directory, where the Dockerfile is located, so users can ADD or COPY them
// during docker build.
DestinationDir string `json:"destinationDir,omitempty" protobuf:"bytes,2,opt,name=destinationDir"`
}
// BinaryBuildSource describes a binary file to be used for the Docker and Source build strategies,
// where the file will be extracted and used as the build source.
type BinaryBuildSource struct {
// asFile indicates that the provided binary input should be considered a single file
// within the build input. For example, specifying "webapp.war" would place the provided
// binary as `/webapp.war` for the builder. If left empty, the Docker and Source build
// strategies assume this file is a zip, tar, or tar.gz file and extract it as the source.
// The custom strategy receives this binary as standard input. This filename may not
// contain slashes or be '..' or '.'.
AsFile string `json:"asFile,omitempty" protobuf:"bytes,1,opt,name=asFile"`
}
// SourceRevision is the revision or commit information from the source for the build
type SourceRevision struct {
// type of the build source, may be one of 'Source', 'Dockerfile', 'Binary', or 'Images'
// +k8s:conversion-gen=false
Type BuildSourceType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=BuildSourceType"`
// Git contains information about git-based build source
Git *GitSourceRevision `json:"git,omitempty" protobuf:"bytes,2,opt,name=git"`
}
// GitSourceRevision is the commit information from a git source for a build
type GitSourceRevision struct {
// commit is the commit hash identifying a specific commit
Commit string `json:"commit,omitempty" protobuf:"bytes,1,opt,name=commit"`
// author is the author of a specific commit
Author SourceControlUser `json:"author,omitempty" protobuf:"bytes,2,opt,name=author"`
// committer is the committer of a specific commit
Committer SourceControlUser `json:"committer,omitempty" protobuf:"bytes,3,opt,name=committer"`
// message is the description of a specific commit
Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"`
}
// GitBuildSource defines the parameters of a Git SCM
type GitBuildSource struct {
// uri points to the source that will be built. The structure of the source
// will depend on the type of build to run
URI string `json:"uri" protobuf:"bytes,1,opt,name=uri"`
// ref is the branch/tag/ref to build.
Ref string `json:"ref,omitempty" protobuf:"bytes,2,opt,name=ref"`
// httpProxy is a proxy used to reach the git repository over http
HTTPProxy *string `json:"httpProxy,omitempty" protobuf:"bytes,3,opt,name=httpProxy"`
// httpsProxy is a proxy used to reach the git repository over https
HTTPSProxy *string `json:"httpsProxy,omitempty" protobuf:"bytes,4,opt,name=httpsProxy"`
}
// SourceControlUser defines the identity of a user of source control
type SourceControlUser struct {
// name of the source control user
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
// email of the source control user
Email string `json:"email,omitempty" protobuf:"bytes,2,opt,name=email"`
}
// BuildStrategy contains the details of how to perform a build.
type BuildStrategy struct {
// type is the kind of build strategy.
// +k8s:conversion-gen=false
Type BuildStrategyType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=BuildStrategyType"`
// dockerStrategy holds the parameters to the Docker build strategy.
DockerStrategy *DockerBuildStrategy `json:"dockerStrategy,omitempty" protobuf:"bytes,2,opt,name=dockerStrategy"`
// sourceStrategy holds the parameters to the Source build strategy.
SourceStrategy *SourceBuildStrategy `json:"sourceStrategy,omitempty" protobuf:"bytes,3,opt,name=sourceStrategy"`
// customStrategy holds the parameters to the Custom build strategy
CustomStrategy *CustomBuildStrategy `json:"customStrategy,omitempty" protobuf:"bytes,4,opt,name=customStrategy"`
// JenkinsPipelineStrategy holds the parameters to the Jenkins Pipeline build strategy.
// This strategy is in tech preview.
JenkinsPipelineStrategy *JenkinsPipelineBuildStrategy `json:"jenkinsPipelineStrategy,omitempty" protobuf:"bytes,5,opt,name=jenkinsPipelineStrategy"`
}
// BuildStrategyType describes a particular way of performing a build.
type BuildStrategyType string
// Valid values for BuildStrategyType.
const (
// DockerBuildStrategyType performs builds using a Dockerfile.
DockerBuildStrategyType BuildStrategyType = "Docker"
// SourceBuildStrategyType performs builds build using Source To Images with a Git repository
// and a builder image.
SourceBuildStrategyType BuildStrategyType = "Source"
// CustomBuildStrategyType performs builds using custom builder Docker image.
CustomBuildStrategyType BuildStrategyType = "Custom"
// JenkinsPipelineBuildStrategyType indicates the build will run via Jenkine Pipeline.
JenkinsPipelineBuildStrategyType BuildStrategyType = "JenkinsPipeline"
)
// CustomBuildStrategy defines input parameters specific to Custom build.
type CustomBuildStrategy struct {
// from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which
// the docker image should be pulled
From kapi.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"`
// pullSecret is the name of a Secret that would be used for setting up
// the authentication for pulling the Docker images from the private Docker
// registries
PullSecret *kapi.LocalObjectReference `json:"pullSecret,omitempty" protobuf:"bytes,2,opt,name=pullSecret"`
// env contains additional environment variables you want to pass into a builder container
Env []kapi.EnvVar `json:"env,omitempty" protobuf:"bytes,3,rep,name=env"`
// exposeDockerSocket will allow running Docker commands (and build Docker images) from
// inside the Docker container.
// TODO: Allow admins to enforce 'false' for this option
ExposeDockerSocket bool `json:"exposeDockerSocket,omitempty" protobuf:"varint,4,opt,name=exposeDockerSocket"`
// forcePull describes if the controller should configure the build pod to always pull the images
// for the builder or only pull if it is not present locally
ForcePull bool `json:"forcePull,omitempty" protobuf:"varint,5,opt,name=forcePull"`
// secrets is a list of additional secrets that will be included in the build pod
Secrets []SecretSpec `json:"secrets,omitempty" protobuf:"bytes,6,rep,name=secrets"`
// buildAPIVersion is the requested API version for the Build object serialized and passed to the custom builder
BuildAPIVersion string `json:"buildAPIVersion,omitempty" protobuf:"bytes,7,opt,name=buildAPIVersion"`
}
// DockerBuildStrategy defines input parameters specific to Docker build.
type DockerBuildStrategy struct {
// from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which
// the docker image should be pulled
// the resulting image will be used in the FROM line of the Dockerfile for this build.
From *kapi.ObjectReference `json:"from,omitempty" protobuf:"bytes,1,opt,name=from"`
// pullSecret is the name of a Secret that would be used for setting up
// the authentication for pulling the Docker images from the private Docker
// registries
PullSecret *kapi.LocalObjectReference `json:"pullSecret,omitempty" protobuf:"bytes,2,opt,name=pullSecret"`
// noCache if set to true indicates that the docker build must be executed with the
// --no-cache=true flag
NoCache bool `json:"noCache,omitempty" protobuf:"varint,3,opt,name=noCache"`
// env contains additional environment variables you want to pass into a builder container
Env []kapi.EnvVar `json:"env,omitempty" protobuf:"bytes,4,rep,name=env"`
// forcePull describes if the builder should pull the images from registry prior to building.
ForcePull bool `json:"forcePull,omitempty" protobuf:"varint,5,opt,name=forcePull"`
// dockerfilePath is the path of the Dockerfile that will be used to build the Docker image,
// relative to the root of the context (contextDir).
DockerfilePath string `json:"dockerfilePath,omitempty" protobuf:"bytes,6,opt,name=dockerfilePath"`
}
// SourceBuildStrategy defines input parameters specific to an Source build.
type SourceBuildStrategy struct {
// from is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which
// the docker image should be pulled
From kapi.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"`
// pullSecret is the name of a Secret that would be used for setting up
// the authentication for pulling the Docker images from the private Docker
// registries
PullSecret *kapi.LocalObjectReference `json:"pullSecret,omitempty" protobuf:"bytes,2,opt,name=pullSecret"`
// env contains additional environment variables you want to pass into a builder container
Env []kapi.EnvVar `json:"env,omitempty" protobuf:"bytes,3,rep,name=env"`
// scripts is the location of Source scripts
Scripts string `json:"scripts,omitempty" protobuf:"bytes,4,opt,name=scripts"`
// incremental flag forces the Source build to do incremental builds if true.
Incremental *bool `json:"incremental,omitempty" protobuf:"varint,5,opt,name=incremental"`
// forcePull describes if the builder should pull the images from registry prior to building.
ForcePull bool `json:"forcePull,omitempty" protobuf:"varint,6,opt,name=forcePull"`
// runtimeImage is an optional image that is used to run an application
// without unneeded dependencies installed. The building of the application
// is still done in the builder image but, post build, you can copy the
// needed artifacts in the runtime image for use.
// This field and the feature it enables are in tech preview.
RuntimeImage *kapi.ObjectReference `json:"runtimeImage,omitempty" protobuf:"bytes,7,opt,name=runtimeImage"`
// runtimeArtifacts specifies a list of source/destination pairs that will be
// copied from the builder to the runtime image. sourcePath can be a file or
// directory. destinationDir must be a directory. destinationDir can also be
// empty or equal to ".", in this case it just refers to the root of WORKDIR.
// This field and the feature it enables are in tech preview.
RuntimeArtifacts []ImageSourcePath `json:"runtimeArtifacts,omitempty" protobuf:"bytes,8,rep,name=runtimeArtifacts"`
}
// JenkinsPipelineBuildStrategy holds parameters specific to a Jenkins Pipeline build.
// This strategy is in tech preview.
type JenkinsPipelineBuildStrategy struct {
// JenkinsfilePath is the optional path of the Jenkinsfile that will be used to configure the pipeline
// relative to the root of the context (contextDir). If both JenkinsfilePath & Jenkinsfile are
// both not specified, this defaults to Jenkinsfile in the root of the specified contextDir.
JenkinsfilePath string `json:"jenkinsfilePath,omitempty" protobuf:"bytes,1,opt,name=jenkinsfilePath"`
// Jenkinsfile defines the optional raw contents of a Jenkinsfile which defines a Jenkins pipeline build.
Jenkinsfile string `json:"jenkinsfile,omitempty" protobuf:"bytes,2,opt,name=jenkinsfile"`
}
// A BuildPostCommitSpec holds a build post commit hook specification. The hook
// executes a command in a temporary container running the build output image,
// immediately after the last layer of the image is committed and before the
// image is pushed to a registry. The command is executed with the current
// working directory ($PWD) set to the image's WORKDIR.
//
// The build will be marked as failed if the hook execution fails. It will fail
// if the script or command return a non-zero exit code, or if there is any
// other error related to starting the temporary container.
//
// There are five different ways to configure the hook. As an example, all forms
// below are equivalent and will execute `rake test --verbose`.
//
// 1. Shell script:
//
// "postCommit": {
// "script": "rake test --verbose",
// }
//
// The above is a convenient form which is equivalent to:
//
// "postCommit": {
// "command": ["/bin/sh", "-ic"],
// "args": ["rake test --verbose"]
// }
//
// 2. A command as the image entrypoint:
//
// "postCommit": {
// "commit": ["rake", "test", "--verbose"]
// }
//
// Command overrides the image entrypoint in the exec form, as documented in
// Docker: https://docs.docker.com/engine/reference/builder/#entrypoint.
//
// 3. Pass arguments to the default entrypoint:
//
// "postCommit": {
// "args": ["rake", "test", "--verbose"]
// }
//
// This form is only useful if the image entrypoint can handle arguments.
//
// 4. Shell script with arguments:
//
// "postCommit": {
// "script": "rake test $1",
// "args": ["--verbose"]
// }
//
// This form is useful if you need to pass arguments that would otherwise be
// hard to quote properly in the shell script. In the script, $0 will be
// "/bin/sh" and $1, $2, etc, are the positional arguments from Args.
//
// 5. Command with arguments:
//
// "postCommit": {
// "command": ["rake", "test"],
// "args": ["--verbose"]
// }
//
// This form is equivalent to appending the arguments to the Command slice.
//
// It is invalid to provide both Script and Command simultaneously. If none of
// the fields are specified, the hook is not executed.
type BuildPostCommitSpec struct {
// command is the command to run. It may not be specified with Script.
// This might be needed if the image doesn't have `/bin/sh`, or if you
// do not want to use a shell. In all other cases, using Script might be
// more convenient.
Command []string `json:"command,omitempty" protobuf:"bytes,1,rep,name=command"`
// args is a list of arguments that are provided to either Command,
// Script or the Docker image's default entrypoint. The arguments are
// placed immediately after the command to be run.
Args []string `json:"args,omitempty" protobuf:"bytes,2,rep,name=args"`
// script is a shell script to be run with `/bin/sh -ic`. It may not be
// specified with Command. Use Script when a shell script is appropriate
// to execute the post build hook, for example for running unit tests
// with `rake test`. If you need control over the image entrypoint, or
// if the image does not have `/bin/sh`, use Command and/or Args.
// The `-i` flag is needed to support CentOS and RHEL images that use
// Software Collections (SCL), in order to have the appropriate
// collections enabled in the shell. E.g., in the Ruby image, this is
// necessary to make `ruby`, `bundle` and other binaries available in
// the PATH.
Script string `json:"script,omitempty" protobuf:"bytes,3,opt,name=script"`
}
// BuildOutput is input to a build strategy and describes the Docker image that the strategy
// should produce.
type BuildOutput struct {
// to defines an optional location to push the output of this build to.
// Kind must be one of 'ImageStreamTag' or 'DockerImage'.
// This value will be used to look up a Docker image repository to push to.
// In the case of an ImageStreamTag, the ImageStreamTag will be looked for in the namespace of
// the build unless Namespace is specified.
To *kapi.ObjectReference `json:"to,omitempty" protobuf:"bytes,1,opt,name=to"`
// PushSecret is the name of a Secret that would be used for setting
// up the authentication for executing the Docker push to authentication
// enabled Docker Registry (or Docker Hub).
PushSecret *kapi.LocalObjectReference `json:"pushSecret,omitempty" protobuf:"bytes,2,opt,name=pushSecret"`
}
// BuildConfig is a template which can be used to create new builds.
type BuildConfig struct {
unversioned.TypeMeta `json:",inline"`
// metadata for BuildConfig.
kapi.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// spec holds all the input necessary to produce a new build, and the conditions when
// to trigger them.
Spec BuildConfigSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"`
// status holds any relevant information about a build config
Status BuildConfigStatus `json:"status" protobuf:"bytes,3,opt,name=status"`
}
// BuildConfigSpec describes when and how builds are created
type BuildConfigSpec struct {
//triggers determine how new Builds can be launched from a BuildConfig. If
//no triggers are defined, a new build can only occur as a result of an
//explicit client build creation.
Triggers []BuildTriggerPolicy `json:"triggers" protobuf:"bytes,1,rep,name=triggers"`
// RunPolicy describes how the new build created from this build
// configuration will be scheduled for execution.
// This is optional, if not specified we default to "Serial".
RunPolicy BuildRunPolicy `json:"runPolicy,omitempty" protobuf:"bytes,2,opt,name=runPolicy,casttype=BuildRunPolicy"`
// CommonSpec is the desired build specification
CommonSpec `json:",inline" protobuf:"bytes,3,opt,name=commonSpec"`
}
// BuildRunPolicy defines the behaviour of how the new builds are executed
// from the existing build configuration.
type BuildRunPolicy string
const (
// BuildRunPolicyParallel schedules new builds immediately after they are
// created. Builds will be executed in parallel.
BuildRunPolicyParallel BuildRunPolicy = "Parallel"
// BuildRunPolicySerial schedules new builds to execute in a sequence as
// they are created. Every build gets queued up and will execute when the
// previous build completes. This is the default policy.
BuildRunPolicySerial BuildRunPolicy = "Serial"
// BuildRunPolicySerialLatestOnly schedules only the latest build to execute,
// cancelling all the previously queued build.
BuildRunPolicySerialLatestOnly BuildRunPolicy = "SerialLatestOnly"
)
// BuildConfigStatus contains current state of the build config object.
type BuildConfigStatus struct {
// lastVersion is used to inform about number of last triggered build.
LastVersion int64 `json:"lastVersion" protobuf:"varint,1,opt,name=lastVersion"`
}
// WebHookTrigger is a trigger that gets invoked using a webhook type of post
type WebHookTrigger struct {
// secret used to validate requests.
Secret string `json:"secret,omitempty" protobuf:"bytes,1,opt,name=secret"`
// allowEnv determines whether the webhook can set environment variables; can only
// be set to true for GenericWebHook.
AllowEnv bool `json:"allowEnv,omitempty" protobuf:"varint,2,opt,name=allowEnv"`
}
// ImageChangeTrigger allows builds to be triggered when an ImageStream changes
type ImageChangeTrigger struct {
// lastTriggeredImageID is used internally by the ImageChangeController to save last
// used image ID for build
LastTriggeredImageID string `json:"lastTriggeredImageID,omitempty" protobuf:"bytes,1,opt,name=lastTriggeredImageID"`
// from is a reference to an ImageStreamTag that will trigger a build when updated
// It is optional. If no From is specified, the From image from the build strategy
// will be used. Only one ImageChangeTrigger with an empty From reference is allowed in
// a build configuration.
From *kapi.ObjectReference `json:"from,omitempty" protobuf:"bytes,2,opt,name=from"`
}
// BuildTriggerPolicy describes a policy for a single trigger that results in a new Build.
type BuildTriggerPolicy struct {
// type is the type of build trigger
Type BuildTriggerType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=BuildTriggerType"`
// github contains the parameters for a GitHub webhook type of trigger
GitHubWebHook *WebHookTrigger `json:"github,omitempty" protobuf:"bytes,2,opt,name=github"`
// generic contains the parameters for a Generic webhook type of trigger
GenericWebHook *WebHookTrigger `json:"generic,omitempty" protobuf:"bytes,3,opt,name=generic"`
// imageChange contains parameters for an ImageChange type of trigger
ImageChange *ImageChangeTrigger `json:"imageChange,omitempty" protobuf:"bytes,4,opt,name=imageChange"`
}
// BuildTriggerType refers to a specific BuildTriggerPolicy implementation.
type BuildTriggerType string
const (
// GitHubWebHookBuildTriggerType represents a trigger that launches builds on
// GitHub webhook invocations
GitHubWebHookBuildTriggerType BuildTriggerType = "GitHub"
GitHubWebHookBuildTriggerTypeDeprecated BuildTriggerType = "github"
// GenericWebHookBuildTriggerType represents a trigger that launches builds on
// generic webhook invocations
GenericWebHookBuildTriggerType BuildTriggerType = "Generic"
GenericWebHookBuildTriggerTypeDeprecated BuildTriggerType = "generic"
// ImageChangeBuildTriggerType represents a trigger that launches builds on
// availability of a new version of an image
ImageChangeBuildTriggerType BuildTriggerType = "ImageChange"
ImageChangeBuildTriggerTypeDeprecated BuildTriggerType = "imageChange"
// ConfigChangeBuildTriggerType will trigger a build on an initial build config creation
// WARNING: In the future the behavior will change to trigger a build on any config change
ConfigChangeBuildTriggerType BuildTriggerType = "ConfigChange"
)
// BuildList is a collection of Builds.
type BuildList struct {
unversioned.TypeMeta `json:",inline"`
// metadata for BuildList.
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// items is a list of builds
Items []Build `json:"items" protobuf:"bytes,2,rep,name=items"`
}
// BuildConfigList is a collection of BuildConfigs.
type BuildConfigList struct {
unversioned.TypeMeta `json:",inline"`
// metadata for BuildConfigList.
unversioned.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// items is a list of build configs
Items []BuildConfig `json:"items" protobuf:"bytes,2,rep,name=items"`
}
// GenericWebHookEvent is the payload expected for a generic webhook post
type GenericWebHookEvent struct {
// type is the type of source repository
// +k8s:conversion-gen=false
Type BuildSourceType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type,casttype=BuildSourceType"`
// git is the git information if the Type is BuildSourceGit
Git *GitInfo `json:"git,omitempty" protobuf:"bytes,2,opt,name=git"`
// env contains additional environment variables you want to pass into a builder container
Env []kapi.EnvVar `json:"env,omitempty" protobuf:"bytes,3,rep,name=env"`
}
// GitInfo is the aggregated git information for a generic webhook post
type GitInfo struct {
GitBuildSource `json:",inline" protobuf:"bytes,1,opt,name=gitBuildSource"`
GitSourceRevision `json:",inline" protobuf:"bytes,2,opt,name=gitSourceRevision"`
}
// BuildLog is the (unused) resource associated with the build log redirector
type BuildLog struct {
unversioned.TypeMeta `json:",inline"`
}
// BuildRequest is the resource used to pass parameters to build generator
type BuildRequest struct {
unversioned.TypeMeta `json:",inline"`
// metadata for BuildRequest.
kapi.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// revision is the information from the source for a specific repo snapshot.
Revision *SourceRevision `json:"revision,omitempty" protobuf:"bytes,2,opt,name=revision"`
// triggeredByImage is the Image that triggered this build.
TriggeredByImage *kapi.ObjectReference `json:"triggeredByImage,omitempty" protobuf:"bytes,3,opt,name=triggeredByImage"`
// from is the reference to the ImageStreamTag that triggered the build.
From *kapi.ObjectReference `json:"from,omitempty" protobuf:"bytes,4,opt,name=from"`
// binary indicates a request to build from a binary provided to the builder
Binary *BinaryBuildSource `json:"binary,omitempty" protobuf:"bytes,5,opt,name=binary"`
// lastVersion (optional) is the LastVersion of the BuildConfig that was used
// to generate the build. If the BuildConfig in the generator doesn't match, a build will
// not be generated.
LastVersion *int64 `json:"lastVersion,omitempty" protobuf:"varint,6,opt,name=lastVersion"`
// env contains additional environment variables you want to pass into a builder container
Env []kapi.EnvVar `json:"env,omitempty" protobuf:"bytes,7,rep,name=env"`
// triggeredBy describes which triggers started the most recent update to the
// build configuration and contains information about those triggers.
TriggeredBy []BuildTriggerCause `json:"triggeredBy" protobuf:"bytes,8,rep,name=triggeredBy"`
}
// BinaryBuildRequestOptions are the options required to fully speficy a binary build request
type BinaryBuildRequestOptions struct {
unversioned.TypeMeta `json:",inline"`
// metadata for BinaryBuildRequestOptions.
kapi.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// asFile determines if the binary should be created as a file within the source rather than extracted as an archive
AsFile string `json:"asFile,omitempty" protobuf:"bytes,2,opt,name=asFile"`
// TODO: Improve map[string][]string conversion so we can handled nested objects
// revision.commit is the value identifying a specific commit
Commit string `json:"revision.commit,omitempty" protobuf:"bytes,3,opt,name=revisionCommit"`
// revision.message is the description of a specific commit
Message string `json:"revision.message,omitempty" protobuf:"bytes,4,opt,name=revisionMessage"`
// revision.authorName of the source control user
AuthorName string `json:"revision.authorName,omitempty" protobuf:"bytes,5,opt,name=revisionAuthorName"`
// revision.authorEmail of the source control user
AuthorEmail string `json:"revision.authorEmail,omitempty" protobuf:"bytes,6,opt,name=revisionAuthorEmail"`
// revision.committerName of the source control user
CommitterName string `json:"revision.committerName,omitempty" protobuf:"bytes,7,opt,name=revisionCommitterName"`
// revision.committerEmail of the source control user
CommitterEmail string `json:"revision.committerEmail,omitempty" protobuf:"bytes,8,opt,name=revisionCommitterEmail"`
}
// BuildLogOptions is the REST options for a build log
type BuildLogOptions struct {
unversioned.TypeMeta `json:",inline"`
// cointainer for which to stream logs. Defaults to only container if there is one container in the pod.
Container string `json:"container,omitempty" protobuf:"bytes,1,opt,name=container"`
// follow if true indicates that the build log should be streamed until
// the build terminates.
Follow bool `json:"follow,omitempty" protobuf:"varint,2,opt,name=follow"`
// previous returns previous build logs. Defaults to false.
Previous bool `json:"previous,omitempty" protobuf:"varint,3,opt,name=previous"`
// sinceSeconds is a relative time in seconds before the current time from which to show logs. If this value
// precedes the time a pod was started, only logs since the pod start will be returned.
// If this value is in the future, no logs will be returned.
// Only one of sinceSeconds or sinceTime may be specified.
SinceSeconds *int64 `json:"sinceSeconds,omitempty" protobuf:"varint,4,opt,name=sinceSeconds"`
// sinceTime is an RFC3339 timestamp from which to show logs. If this value
// precedes the time a pod was started, only logs since the pod start will be returned.
// If this value is in the future, no logs will be returned.
// Only one of sinceSeconds or sinceTime may be specified.
SinceTime *unversioned.Time `json:"sinceTime,omitempty" protobuf:"bytes,5,opt,name=sinceTime"`
// timestamps, If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line
// of log output. Defaults to false.
Timestamps bool `json:"timestamps,omitempty" protobuf:"varint,6,opt,name=timestamps"`
// tailLines, If set, is the number of lines from the end of the logs to show. If not specified,
// logs are shown from the creation of the container or sinceSeconds or sinceTime
TailLines *int64 `json:"tailLines,omitempty" protobuf:"varint,7,opt,name=tailLines"`
// limitBytes, If set, is the number of bytes to read from the server before terminating the
// log output. This may not display a complete final line of logging, and may return
// slightly more or slightly less than the specified limit.
LimitBytes *int64 `json:"limitBytes,omitempty" protobuf:"varint,8,opt,name=limitBytes"`
// noWait if true causes the call to return immediately even if the build
// is not available yet. Otherwise the server will wait until the build has started.
// TODO: Fix the tag to 'noWait' in v2
NoWait bool `json:"nowait,omitempty" protobuf:"varint,9,opt,name=nowait"`
// version of the build for which to view logs.
Version *int64 `json:"version,omitempty" protobuf:"varint,10,opt,name=version"`
}
// SecretSpec specifies a secret to be included in a build pod and its corresponding mount point
type SecretSpec struct {
// secretSource is a reference to the secret
SecretSource kapi.LocalObjectReference `json:"secretSource" protobuf:"bytes,1,opt,name=secretSource"`
// mountPath is the path at which to mount the secret
MountPath string `json:"mountPath" protobuf:"bytes,2,opt,name=mountPath"`
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff