Skip to content

Commit

Permalink
Store built image digest in the build status
Browse files Browse the repository at this point in the history
  • Loading branch information
mmilata committed Jan 12, 2017
1 parent 38831af commit 4460c7d
Show file tree
Hide file tree
Showing 29 changed files with 1,701 additions and 366 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions api/swagger-spec/oapi-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -23995,6 +23995,30 @@
"config": {
"$ref": "v1.ObjectReference",
"description": "config is an ObjectReference to the BuildConfig this Build is based on."
},
"output": {
"$ref": "v1.BuildStatusOutput",
"description": "output describes the Docker image the build has produced."
}
}
},
"v1.BuildStatusOutput": {
"id": "v1.BuildStatusOutput",
"description": "BuildStatusOutput contains the status of the built image.",
"properties": {
"to": {
"$ref": "v1.BuildStatusOutputTo",
"description": "to describes the status of the built image being pushed to a registry."
}
}
},
"v1.BuildStatusOutputTo": {
"id": "v1.BuildStatusOutputTo",
"description": "BuildStatusOutputTo describes the status of the built image with regards to image registry to which it was supposed to be pushed.",
"properties": {
"imageDigest": {
"type": "string",
"description": "imageDigest is the digest of the built Docker image. The digest uniquely identifies the image in the registry to which it was pushed. Please note that this field may not always set even if the push completes successfully."
}
}
},
Expand Down
22 changes: 22 additions & 0 deletions api/swagger-spec/openshift-openapi-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -47817,6 +47817,10 @@
"description": "message is a human-readable message indicating details about why the build has this status.",
"type": "string"
},
"output": {
"description": "output describes the Docker image the build has produced.",
"$ref": "#/definitions/v1.BuildStatusOutput"
},
"outputDockerImageReference": {
"description": "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.",
"type": "string"
Expand All @@ -47835,6 +47839,24 @@
}
}
},
"v1.BuildStatusOutput": {
"description": "BuildStatusOutput contains the status of the built image.",
"properties": {
"to": {
"description": "to describes the status of the built image being pushed to a registry.",
"$ref": "#/definitions/v1.BuildStatusOutputTo"
}
}
},
"v1.BuildStatusOutputTo": {
"description": "BuildStatusOutputTo describes the status of the built image with regards to image registry to which it was supposed to be pushed.",
"properties": {
"imageDigest": {
"description": "imageDigest is the digest of the built Docker image. The digest uniquely identifies the image in the registry to which it was pushed. Please note that this field may not always set even if the push completes successfully.",
"type": "string"
}
}
},
"v1.BuildTriggerCause": {
"description": "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.",
"properties": {
Expand Down
19 changes: 19 additions & 0 deletions pkg/build/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ type BuildStatus struct {

// Config is an ObjectReference to the BuildConfig this Build is based on.
Config *kapi.ObjectReference

// Output describes the Docker image the build has produced.
Output BuildStatusOutput
}

// BuildPhase represents the status of a build at a point in time.
Expand Down Expand Up @@ -335,6 +338,22 @@ const (
StatusMessageBuildPodExists = "The pod for this build already exists and is older than the build."
)

// BuildStatusOutput contains the status of the built image.
type BuildStatusOutput struct {
// To describes the status of the built image being pushed to a registry.
To *BuildStatusOutputTo `json:"to,omitempty" protobuf:"bytes,1,opt,name=to"`
}

// BuildStatusOutputTo describes the status of the built image with regards to
// image registry to which it was supposed to be pushed.
type BuildStatusOutputTo struct {
// ImageDigest is the digest of the built Docker image. The digest uniquely
// identifies the image in the registry to which it was pushed. Please note
// that this field may not always set even if the push completes
// successfully.
ImageDigest string `json:"imageDigest,omitempty" protobuf:"bytes,1,opt,name=imageDigest"`
}

// BuildSource is the input used for the build.
type BuildSource struct {
// Binary builds accept a binary as their input. The binary is generally assumed to be a tar,
Expand Down

0 comments on commit 4460c7d

Please sign in to comment.