Updated glide dependencies

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-12-22 23:58:10 +05:30
parent a753f35d42
commit d4561c6f51
11 changed files with 1466 additions and 1113 deletions

8
glide.lock generated
View File

@ -1,5 +1,5 @@
hash: ce7cedb6d1c0e23f02afdd8bc7d1dabb047ca846cacd597e436cf93549c9ac79
updated: 2016-12-22T09:07:17.203828556-05:00
hash: c7cb14f4249738a47020f9dc1964832921c3f5b8bf5a1c50f5b2fa15eaebb6fe
updated: 2016-12-26T10:22:49.439519344+05:30
imports:
- name: cloud.google.com/go
version: 3b1ae45394a234c385be014e9a488f2bb6eef821
@ -369,6 +369,10 @@ imports:
- pkg/auth/authenticator/request/x509request
- pkg/authorization/api
- pkg/build/api
- pkg/build/api/install
- pkg/build/api/v1
- pkg/build/client
- pkg/build/util
- pkg/client
- pkg/cmd/cli/config
- pkg/cmd/util

View File

@ -20,6 +20,8 @@ import:
- package: github.com/openshift/origin
version: v1.4.0-rc1
subpackages:
- pkg/build/api/install
- pkg/build/api/v1
- pkg/client
- pkg/cmd/cli/config
- pkg/deploy/api

File diff suppressed because it is too large Load Diff

View File

@ -1,776 +0,0 @@
// 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

@ -42,7 +42,7 @@ func (Build) SwaggerDoc() map[string]string {
}
var map_BuildConfig = map[string]string{
"": "BuildConfig is a template which can be used to create new builds.",
"": "Build configurations define a build process for new Docker images. There are three types of builds possible - a Docker build using a Dockerfile, a Source-to-Image build that uses a specially prepared base image that accepts source code that it can make runnable, and a custom build that can run // arbitrary Docker images as a base and accept the build parameters. Builds run on the cluster and on completion are pushed to the Docker registry specified in the \"output\" section. A build can be triggered via a webhook, when the base image changes, or when a user manually requests a new build be // created.\n\nEach build created by a build configuration is numbered and refers back to its parent configuration. Multiple builds can be triggered at once. Builds that do not have \"output\" set can be used to test code or run a verification build.",
"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",
@ -118,9 +118,10 @@ func (BuildLogOptions) SwaggerDoc() map[string]string {
}
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).",
"": "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).",
"imageLabels": "imageLabels define a list of labels that are applied to the resulting image. If there are multiple labels with the same name then the last one in the list is used.",
}
func (BuildOutput) SwaggerDoc() map[string]string {
@ -243,6 +244,7 @@ var map_CommonSpec = map[string]string{
"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",
"nodeSelector": "nodeSelector is a selector which must be true for the build pod to fit on a node If nil, it can be overridden by default build nodeselector values for the cluster. If set to an empty map or a map with any values, default build nodeselector values are ignored.",
}
func (CommonSpec) SwaggerDoc() map[string]string {
@ -300,11 +302,9 @@ func (GenericWebHookEvent) SwaggerDoc() map[string]string {
}
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",
"": "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.",
}
func (GitBuildSource) SwaggerDoc() map[string]string {
@ -361,8 +361,18 @@ func (ImageChangeTrigger) SwaggerDoc() map[string]string {
return map_ImageChangeTrigger
}
var map_ImageLabel = map[string]string{
"": "ImageLabel represents a label applied to the resulting image.",
"name": "name defines the name of the label. It must have non-zero length.",
"value": "value defines the literal value of the label.",
}
func (ImageLabel) SwaggerDoc() map[string]string {
return map_ImageLabel
}
var map_ImageSource = map[string]string{
"": "ImageSource describes an image that is used as source for the build",
"": "ImageSource is used to describe build source that will be extracted from an image. A reference of type ImageStreamTag, ImageStreamImage or DockerImage may be used. A pull secret can be specified to pull the image from an external registry or override the default service account secret if pulling from the internal registry. A list of paths to copy from the image and their respective destination within the build directory must be specified in the paths array.",
"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.",
@ -392,6 +402,17 @@ func (JenkinsPipelineBuildStrategy) SwaggerDoc() map[string]string {
return map_JenkinsPipelineBuildStrategy
}
var map_ProxyConfig = map[string]string{
"": "ProxyConfig defines what proxies to use for an operation",
"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",
"noProxy": "noProxy is the list of domains for which the proxy should not be used",
}
func (ProxyConfig) SwaggerDoc() map[string]string {
return map_ProxyConfig
}
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.",

View File

@ -1,6 +1,7 @@
package v1
import (
"fmt"
"time"
"k8s.io/kubernetes/pkg/api/unversioned"
@ -34,6 +35,15 @@ type BuildSpec struct {
TriggeredBy []BuildTriggerCause `json:"triggeredBy" protobuf:"bytes,2,rep,name=triggeredBy"`
}
// OptionalNodeSelector is a map that may also be left nil to distinguish between set and unset.
// +protobuf.nullable=true
// +protobuf.options.(gogoproto.goproto_stringer)=false
type OptionalNodeSelector map[string]string
func (t OptionalNodeSelector) String() string {
return fmt.Sprintf("%v", map[string]string(t))
}
// 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
@ -66,6 +76,12 @@ type CommonSpec struct {
// 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"`
// nodeSelector is a selector which must be true for the build pod to fit on a node
// If nil, it can be overridden by default build nodeselector values for the cluster.
// If set to an empty map or a map with any values, default build nodeselector values
// are ignored.
NodeSelector OptionalNodeSelector `json:"nodeSelector" protobuf:"bytes,9,name=nodeSelector"`
}
// BuildTriggerCause holds information about a triggered build. It is used for
@ -255,7 +271,11 @@ type BuildSource struct {
Secrets []SecretBuildSource `json:"secrets,omitempty" protobuf:"bytes,8,rep,name=secrets"`
}
// ImageSource describes an image that is used as source for the build
// ImageSource is used to describe build source that will be extracted from an image. A reference of
// type ImageStreamTag, ImageStreamImage or DockerImage may be used. A pull secret can be specified
// to pull the image from an external registry or override the default service account secret if pulling
// from the internal registry. A list of paths to copy from the image and their respective destination
// within the build directory must be specified in the paths array.
type ImageSource struct {
// from is a reference to an ImageStreamTag, ImageStreamImage, or DockerImage to
// copy source from.
@ -336,6 +356,18 @@ type GitSourceRevision struct {
Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"`
}
// ProxyConfig defines what proxies to use for an operation
type ProxyConfig struct {
// 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"`
// noProxy is the list of domains for which the proxy should not be used
NoProxy *string `json:"noProxy,omitempty" protobuf:"bytes,5,opt,name=noProxy"`
}
// 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
@ -345,11 +377,8 @@ type GitBuildSource struct {
// 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"`
// proxyConfig defines the proxies to use for the git clone operation
ProxyConfig `json:",inline" protobuf:"bytes,3,opt,name=proxyConfig"`
}
// SourceControlUser defines the identity of a user of source control
@ -609,9 +638,24 @@ type BuildOutput struct {
// 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"`
// imageLabels define a list of labels that are applied to the resulting image. If there
// are multiple labels with the same name then the last one in the list is used.
ImageLabels []ImageLabel `json:"imageLabels,omitempty" protobuf:"bytes,3,rep,name=imageLabels"`
}
// BuildConfig is a template which can be used to create new builds.
// ImageLabel represents a label applied to the resulting image.
type ImageLabel struct {
// name defines the name of the label. It must have non-zero length.
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
// value defines the literal value of the label.
Value string `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"`
}
// Build configurations define a build process for new Docker images. There are three types of builds possible - a Docker build using a Dockerfile, a Source-to-Image build that uses a specially prepared base image that accepts source code that it can make runnable, and a custom build that can run // arbitrary Docker images as a base and accept the build parameters. Builds run on the cluster and on completion are pushed to the Docker registry specified in the "output" section. A build can be triggered via a webhook, when the base image changes, or when a user manually requests a new build be // created.
//
// Each build created by a build configuration is numbered and refers back to its parent configuration. Multiple builds can be triggered at once. Builds that do not have "output" set can be used to test code or run a verification build.
type BuildConfig struct {
unversioned.TypeMeta `json:",inline"`
// metadata for BuildConfig.

View File

@ -81,12 +81,16 @@ func RegisterConversions(scheme *runtime.Scheme) error {
Convert_api_ImageChangeCause_To_v1_ImageChangeCause,
Convert_v1_ImageChangeTrigger_To_api_ImageChangeTrigger,
Convert_api_ImageChangeTrigger_To_v1_ImageChangeTrigger,
Convert_v1_ImageLabel_To_api_ImageLabel,
Convert_api_ImageLabel_To_v1_ImageLabel,
Convert_v1_ImageSource_To_api_ImageSource,
Convert_api_ImageSource_To_v1_ImageSource,
Convert_v1_ImageSourcePath_To_api_ImageSourcePath,
Convert_api_ImageSourcePath_To_v1_ImageSourcePath,
Convert_v1_JenkinsPipelineBuildStrategy_To_api_JenkinsPipelineBuildStrategy,
Convert_api_JenkinsPipelineBuildStrategy_To_v1_JenkinsPipelineBuildStrategy,
Convert_v1_ProxyConfig_To_api_ProxyConfig,
Convert_api_ProxyConfig_To_v1_ProxyConfig,
Convert_v1_SecretBuildSource_To_api_SecretBuildSource,
Convert_api_SecretBuildSource_To_v1_SecretBuildSource,
Convert_v1_SecretSpec_To_api_SecretSpec,
@ -486,6 +490,17 @@ func autoConvert_v1_BuildOutput_To_api_BuildOutput(in *BuildOutput, out *api.Bui
} else {
out.PushSecret = nil
}
if in.ImageLabels != nil {
in, out := &in.ImageLabels, &out.ImageLabels
*out = make([]api.ImageLabel, len(*in))
for i := range *in {
if err := Convert_v1_ImageLabel_To_api_ImageLabel(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.ImageLabels = nil
}
return nil
}
@ -508,6 +523,17 @@ func autoConvert_api_BuildOutput_To_v1_BuildOutput(in *api.BuildOutput, out *Bui
} else {
out.PushSecret = nil
}
if in.ImageLabels != nil {
in, out := &in.ImageLabels, &out.ImageLabels
*out = make([]ImageLabel, len(*in))
for i := range *in {
if err := Convert_api_ImageLabel_To_v1_ImageLabel(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.ImageLabels = nil
}
return nil
}
@ -1145,6 +1171,15 @@ func autoConvert_v1_CommonSpec_To_api_CommonSpec(in *CommonSpec, out *api.Common
return err
}
out.CompletionDeadlineSeconds = in.CompletionDeadlineSeconds
if in.NodeSelector != nil {
in, out := &in.NodeSelector, &out.NodeSelector
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
} else {
out.NodeSelector = nil
}
return nil
}
@ -1179,6 +1214,15 @@ func autoConvert_api_CommonSpec_To_v1_CommonSpec(in *api.CommonSpec, out *Common
return err
}
out.CompletionDeadlineSeconds = in.CompletionDeadlineSeconds
if in.NodeSelector != nil {
in, out := &in.NodeSelector, &out.NodeSelector
*out = make(OptionalNodeSelector, len(*in))
for key, val := range *in {
(*out)[key] = val
}
} else {
out.NodeSelector = nil
}
return nil
}
@ -1445,8 +1489,9 @@ func Convert_api_GenericWebHookEvent_To_v1_GenericWebHookEvent(in *api.GenericWe
func autoConvert_v1_GitBuildSource_To_api_GitBuildSource(in *GitBuildSource, out *api.GitBuildSource, s conversion.Scope) error {
out.URI = in.URI
out.Ref = in.Ref
out.HTTPProxy = in.HTTPProxy
out.HTTPSProxy = in.HTTPSProxy
if err := Convert_v1_ProxyConfig_To_api_ProxyConfig(&in.ProxyConfig, &out.ProxyConfig, s); err != nil {
return err
}
return nil
}
@ -1457,8 +1502,9 @@ func Convert_v1_GitBuildSource_To_api_GitBuildSource(in *GitBuildSource, out *ap
func autoConvert_api_GitBuildSource_To_v1_GitBuildSource(in *api.GitBuildSource, out *GitBuildSource, s conversion.Scope) error {
out.URI = in.URI
out.Ref = in.Ref
out.HTTPProxy = in.HTTPProxy
out.HTTPSProxy = in.HTTPSProxy
if err := Convert_api_ProxyConfig_To_v1_ProxyConfig(&in.ProxyConfig, &out.ProxyConfig, s); err != nil {
return err
}
return nil
}
@ -1634,6 +1680,26 @@ func Convert_api_ImageChangeTrigger_To_v1_ImageChangeTrigger(in *api.ImageChange
return autoConvert_api_ImageChangeTrigger_To_v1_ImageChangeTrigger(in, out, s)
}
func autoConvert_v1_ImageLabel_To_api_ImageLabel(in *ImageLabel, out *api.ImageLabel, s conversion.Scope) error {
out.Name = in.Name
out.Value = in.Value
return nil
}
func Convert_v1_ImageLabel_To_api_ImageLabel(in *ImageLabel, out *api.ImageLabel, s conversion.Scope) error {
return autoConvert_v1_ImageLabel_To_api_ImageLabel(in, out, s)
}
func autoConvert_api_ImageLabel_To_v1_ImageLabel(in *api.ImageLabel, out *ImageLabel, s conversion.Scope) error {
out.Name = in.Name
out.Value = in.Value
return nil
}
func Convert_api_ImageLabel_To_v1_ImageLabel(in *api.ImageLabel, out *ImageLabel, s conversion.Scope) error {
return autoConvert_api_ImageLabel_To_v1_ImageLabel(in, out, s)
}
func autoConvert_v1_ImageSource_To_api_ImageSource(in *ImageSource, out *api.ImageSource, s conversion.Scope) error {
if err := api_v1.Convert_v1_ObjectReference_To_api_ObjectReference(&in.From, &out.From, s); err != nil {
return err
@ -1736,6 +1802,28 @@ func Convert_api_JenkinsPipelineBuildStrategy_To_v1_JenkinsPipelineBuildStrategy
return autoConvert_api_JenkinsPipelineBuildStrategy_To_v1_JenkinsPipelineBuildStrategy(in, out, s)
}
func autoConvert_v1_ProxyConfig_To_api_ProxyConfig(in *ProxyConfig, out *api.ProxyConfig, s conversion.Scope) error {
out.HTTPProxy = in.HTTPProxy
out.HTTPSProxy = in.HTTPSProxy
out.NoProxy = in.NoProxy
return nil
}
func Convert_v1_ProxyConfig_To_api_ProxyConfig(in *ProxyConfig, out *api.ProxyConfig, s conversion.Scope) error {
return autoConvert_v1_ProxyConfig_To_api_ProxyConfig(in, out, s)
}
func autoConvert_api_ProxyConfig_To_v1_ProxyConfig(in *api.ProxyConfig, out *ProxyConfig, s conversion.Scope) error {
out.HTTPProxy = in.HTTPProxy
out.HTTPSProxy = in.HTTPSProxy
out.NoProxy = in.NoProxy
return nil
}
func Convert_api_ProxyConfig_To_v1_ProxyConfig(in *api.ProxyConfig, out *ProxyConfig, s conversion.Scope) error {
return autoConvert_api_ProxyConfig_To_v1_ProxyConfig(in, out, s)
}
func autoConvert_v1_SecretBuildSource_To_api_SecretBuildSource(in *SecretBuildSource, out *api.SecretBuildSource, s conversion.Scope) error {
if err := api_v1.Convert_v1_LocalObjectReference_To_api_LocalObjectReference(&in.Secret, &out.Secret, s); err != nil {
return err

View File

@ -50,9 +50,11 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_GitSourceRevision, InType: reflect.TypeOf(&GitSourceRevision{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ImageChangeCause, InType: reflect.TypeOf(&ImageChangeCause{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ImageChangeTrigger, InType: reflect.TypeOf(&ImageChangeTrigger{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ImageLabel, InType: reflect.TypeOf(&ImageLabel{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ImageSource, InType: reflect.TypeOf(&ImageSource{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ImageSourcePath, InType: reflect.TypeOf(&ImageSourcePath{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_JenkinsPipelineBuildStrategy, InType: reflect.TypeOf(&JenkinsPipelineBuildStrategy{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ProxyConfig, InType: reflect.TypeOf(&ProxyConfig{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_SecretBuildSource, InType: reflect.TypeOf(&SecretBuildSource{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_SecretSpec, InType: reflect.TypeOf(&SecretSpec{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_SourceBuildStrategy, InType: reflect.TypeOf(&SourceBuildStrategy{})},
@ -274,6 +276,15 @@ func DeepCopy_v1_BuildOutput(in interface{}, out interface{}, c *conversion.Clon
} else {
out.PushSecret = nil
}
if in.ImageLabels != nil {
in, out := &in.ImageLabels, &out.ImageLabels
*out = make([]ImageLabel, len(*in))
for i := range *in {
(*out)[i] = (*in)[i]
}
} else {
out.ImageLabels = nil
}
return nil
}
}
@ -636,6 +647,15 @@ func DeepCopy_v1_CommonSpec(in interface{}, out interface{}, c *conversion.Clone
} else {
out.CompletionDeadlineSeconds = nil
}
if in.NodeSelector != nil {
in, out := &in.NodeSelector, &out.NodeSelector
*out = make(OptionalNodeSelector)
for key, val := range *in {
(*out)[key] = val
}
} else {
out.NodeSelector = nil
}
return nil
}
}
@ -768,19 +788,8 @@ func DeepCopy_v1_GitBuildSource(in interface{}, out interface{}, c *conversion.C
out := out.(*GitBuildSource)
out.URI = in.URI
out.Ref = in.Ref
if in.HTTPProxy != nil {
in, out := &in.HTTPProxy, &out.HTTPProxy
*out = new(string)
**out = **in
} else {
out.HTTPProxy = nil
}
if in.HTTPSProxy != nil {
in, out := &in.HTTPSProxy, &out.HTTPSProxy
*out = new(string)
**out = **in
} else {
out.HTTPSProxy = nil
if err := DeepCopy_v1_ProxyConfig(&in.ProxyConfig, &out.ProxyConfig, c); err != nil {
return err
}
return nil
}
@ -860,6 +869,16 @@ func DeepCopy_v1_ImageChangeTrigger(in interface{}, out interface{}, c *conversi
}
}
func DeepCopy_v1_ImageLabel(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ImageLabel)
out := out.(*ImageLabel)
out.Name = in.Name
out.Value = in.Value
return nil
}
}
func DeepCopy_v1_ImageSource(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ImageSource)
@ -905,6 +924,35 @@ func DeepCopy_v1_JenkinsPipelineBuildStrategy(in interface{}, out interface{}, c
}
}
func DeepCopy_v1_ProxyConfig(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ProxyConfig)
out := out.(*ProxyConfig)
if in.HTTPProxy != nil {
in, out := &in.HTTPProxy, &out.HTTPProxy
*out = new(string)
**out = **in
} else {
out.HTTPProxy = nil
}
if in.HTTPSProxy != nil {
in, out := &in.HTTPSProxy, &out.HTTPSProxy
*out = new(string)
**out = **in
} else {
out.HTTPSProxy = nil
}
if in.NoProxy != nil {
in, out := &in.NoProxy, &out.NoProxy
*out = new(string)
**out = **in
} else {
out.NoProxy = nil
}
return nil
}
}
func DeepCopy_v1_SecretBuildSource(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*SecretBuildSource)

View File

@ -0,0 +1,109 @@
package client
import (
buildapi "github.com/openshift/origin/pkg/build/api"
osclient "github.com/openshift/origin/pkg/client"
kapi "k8s.io/kubernetes/pkg/api"
)
// BuildConfigGetter provides methods for getting BuildConfigs
type BuildConfigGetter interface {
Get(namespace, name string) (*buildapi.BuildConfig, error)
}
// BuildConfigUpdater provides methods for updating BuildConfigs
type BuildConfigUpdater interface {
Update(buildConfig *buildapi.BuildConfig) error
}
// OSClientBuildConfigClient delegates get and update operations to the OpenShift client interface
type OSClientBuildConfigClient struct {
Client osclient.Interface
}
// NewOSClientBuildConfigClient creates a new build config client that uses an openshift client to create and get BuildConfigs
func NewOSClientBuildConfigClient(client osclient.Interface) *OSClientBuildConfigClient {
return &OSClientBuildConfigClient{Client: client}
}
// Get returns a BuildConfig using the OpenShift client.
func (c OSClientBuildConfigClient) Get(namespace, name string) (*buildapi.BuildConfig, error) {
return c.Client.BuildConfigs(namespace).Get(name)
}
// Update updates a BuildConfig using the OpenShift client.
func (c OSClientBuildConfigClient) Update(buildConfig *buildapi.BuildConfig) error {
_, err := c.Client.BuildConfigs(buildConfig.Namespace).Update(buildConfig)
return err
}
// BuildUpdater provides methods for updating existing Builds.
type BuildUpdater interface {
Update(namespace string, build *buildapi.Build) error
}
// BuildLister provides methods for listing the Builds.
type BuildLister interface {
List(namespace string, opts kapi.ListOptions) (*buildapi.BuildList, error)
}
// OSClientBuildClient deletes build create and update operations to the OpenShift client interface
type OSClientBuildClient struct {
Client osclient.Interface
}
// NewOSClientBuildClient creates a new build client that uses an openshift client to update builds
func NewOSClientBuildClient(client osclient.Interface) *OSClientBuildClient {
return &OSClientBuildClient{Client: client}
}
// Update updates builds using the OpenShift client.
func (c OSClientBuildClient) Update(namespace string, build *buildapi.Build) error {
_, e := c.Client.Builds(namespace).Update(build)
return e
}
// List lists the builds using the OpenShift client.
func (c OSClientBuildClient) List(namespace string, opts kapi.ListOptions) (*buildapi.BuildList, error) {
return c.Client.Builds(namespace).List(opts)
}
// BuildCloner provides methods for cloning builds
type BuildCloner interface {
Clone(namespace string, request *buildapi.BuildRequest) (*buildapi.Build, error)
}
// OSClientBuildClonerClient creates a new build client that uses an openshift client to clone builds
type OSClientBuildClonerClient struct {
Client osclient.Interface
}
// NewOSClientBuildClonerClient creates a new build client that uses an openshift client to clone builds
func NewOSClientBuildClonerClient(client osclient.Interface) *OSClientBuildClonerClient {
return &OSClientBuildClonerClient{Client: client}
}
// Clone generates new build for given build name
func (c OSClientBuildClonerClient) Clone(namespace string, request *buildapi.BuildRequest) (*buildapi.Build, error) {
return c.Client.Builds(namespace).Clone(request)
}
// BuildConfigInstantiator provides methods for instantiating builds from build configs
type BuildConfigInstantiator interface {
Instantiate(namespace string, request *buildapi.BuildRequest) (*buildapi.Build, error)
}
// OSClientBuildConfigInstantiatorClient creates a new build client that uses an openshift client to create builds
type OSClientBuildConfigInstantiatorClient struct {
Client osclient.Interface
}
// NewOSClientBuildConfigInstantiatorClient creates a new build client that uses an openshift client to create builds
func NewOSClientBuildConfigInstantiatorClient(client osclient.Interface) *OSClientBuildConfigInstantiatorClient {
return &OSClientBuildConfigInstantiatorClient{Client: client}
}
// Instantiate generates new build for given buildConfig
func (c OSClientBuildConfigInstantiatorClient) Instantiate(namespace string, request *buildapi.BuildRequest) (*buildapi.Build, error) {
return c.Client.BuildConfigs(namespace).Instantiate(request)
}

View File

@ -0,0 +1,3 @@
// Package util contains common functions that are used
// by the rest of the OpenShift build system.
package util

View File

@ -0,0 +1,152 @@
package util
import (
"fmt"
"strconv"
"strings"
kapi "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/labels"
"github.com/golang/glog"
buildapi "github.com/openshift/origin/pkg/build/api"
buildclient "github.com/openshift/origin/pkg/build/client"
)
const (
// NoBuildLogsMessage reports that no build logs are available
NoBuildLogsMessage = "No logs are available."
)
// GetBuildName returns name of the build pod.
func GetBuildName(pod *kapi.Pod) string {
if pod == nil {
return ""
}
return pod.Annotations[buildapi.BuildAnnotation]
}
// GetInputReference returns the From ObjectReference associated with the
// BuildStrategy.
func GetInputReference(strategy buildapi.BuildStrategy) *kapi.ObjectReference {
switch {
case strategy.SourceStrategy != nil:
return &strategy.SourceStrategy.From
case strategy.DockerStrategy != nil:
return strategy.DockerStrategy.From
case strategy.CustomStrategy != nil:
return &strategy.CustomStrategy.From
default:
return nil
}
}
// IsBuildComplete returns whether the provided build is complete or not
func IsBuildComplete(build *buildapi.Build) bool {
return build.Status.Phase != buildapi.BuildPhaseRunning && build.Status.Phase != buildapi.BuildPhasePending && build.Status.Phase != buildapi.BuildPhaseNew
}
// IsPaused returns true if the provided BuildConfig is paused and cannot be used to create a new Build
func IsPaused(bc *buildapi.BuildConfig) bool {
return strings.ToLower(bc.Annotations[buildapi.BuildConfigPausedAnnotation]) == "true"
}
// BuildNumber returns the given build number.
func BuildNumber(build *buildapi.Build) (int64, error) {
annotations := build.GetAnnotations()
if stringNumber, ok := annotations[buildapi.BuildNumberAnnotation]; ok {
return strconv.ParseInt(stringNumber, 10, 64)
}
return 0, fmt.Errorf("build %s/%s does not have %s annotation", build.Namespace, build.Name, buildapi.BuildNumberAnnotation)
}
// BuildRunPolicy returns the scheduling policy for the build based on the
// "queued" label.
func BuildRunPolicy(build *buildapi.Build) buildapi.BuildRunPolicy {
labels := build.GetLabels()
if value, found := labels[buildapi.BuildRunPolicyLabel]; found {
switch value {
case "Parallel":
return buildapi.BuildRunPolicyParallel
case "Serial":
return buildapi.BuildRunPolicySerial
case "SerialLatestOnly":
return buildapi.BuildRunPolicySerialLatestOnly
}
}
glog.V(5).Infof("Build %s/%s does not have start policy label set, using default (Serial)")
return buildapi.BuildRunPolicySerial
}
// BuildNameForConfigVersion returns the name of the version-th build
// for the config that has the provided name.
func BuildNameForConfigVersion(name string, version int) string {
return fmt.Sprintf("%s-%d", name, version)
}
// BuildConfigSelector returns a label Selector which can be used to find all
// builds for a BuildConfig.
func BuildConfigSelector(name string) labels.Selector {
return labels.Set{buildapi.BuildConfigLabel: buildapi.LabelValue(name)}.AsSelector()
}
// BuildConfigSelectorDeprecated returns a label Selector which can be used to find
// all builds for a BuildConfig that use the deprecated labels.
func BuildConfigSelectorDeprecated(name string) labels.Selector {
return labels.Set{buildapi.BuildConfigLabelDeprecated: name}.AsSelector()
}
type buildFilter func(buildapi.Build) bool
// BuildConfigBuilds return a list of builds for the given build config.
// Optionally you can specify a filter function to select only builds that
// matches your criteria.
func BuildConfigBuilds(c buildclient.BuildLister, namespace, name string, filterFunc buildFilter) (*buildapi.BuildList, error) {
result, err := c.List(namespace, kapi.ListOptions{
LabelSelector: BuildConfigSelector(name),
})
if err != nil {
return nil, err
}
if filterFunc == nil {
return result, nil
}
filteredList := &buildapi.BuildList{TypeMeta: result.TypeMeta, ListMeta: result.ListMeta}
for _, b := range result.Items {
if filterFunc(b) {
filteredList.Items = append(filteredList.Items, b)
}
}
return filteredList, nil
}
// ConfigNameForBuild returns the name of the build config from a
// build name.
func ConfigNameForBuild(build *buildapi.Build) string {
if build == nil {
return ""
}
if build.Annotations != nil {
if _, exists := build.Annotations[buildapi.BuildConfigAnnotation]; exists {
return build.Annotations[buildapi.BuildConfigAnnotation]
}
}
if _, exists := build.Labels[buildapi.BuildConfigLabel]; exists {
return build.Labels[buildapi.BuildConfigLabel]
}
return build.Labels[buildapi.BuildConfigLabelDeprecated]
}
// VersionForBuild returns the version from the provided build name.
// If no version can be found, 0 is returned to indicate no version.
func VersionForBuild(build *buildapi.Build) int {
if build == nil {
return 0
}
versionString := build.Annotations[buildapi.BuildNumberAnnotation]
version, err := strconv.Atoi(versionString)
if err != nil {
return 0
}
return version
}