Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pkg/api/graph/graphview/image_pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ func NewImagePipelineFromBuildConfigNode(g osgraph.Graph, bcNode *buildgraph.Bui
flow.Build = bcNode
flow.LastSuccessfulBuild, flow.LastUnsuccessfulBuild, flow.ActiveBuilds = buildedges.RelevantBuilds(g, flow.Build)

// we should have at most one
for _, buildOutputNode := range g.SuccessorNodesByEdgeKind(bcNode, buildedges.BuildOutputEdgeKind) {
// this will handle the imagestream tag case
for _, input := range g.SuccessorNodesByEdgeKind(buildOutputNode, imageedges.ReferencedImageStreamGraphEdgeKind) {
imageStreamNode := input.(*imagegraph.ImageStreamNode)

flow.DestinationResolved = (len(imageStreamNode.Status.DockerImageRepository) != 0)
}

// TODO handle the DockerImage case
}

return flow, covered
}

Expand Down
149 changes: 149 additions & 0 deletions pkg/api/graph/test/bare-bc-can-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
apiVersion: v1
items:
- apiVersion: v1
kind: BuildConfig
metadata:
creationTimestamp: 2015-12-16T01:01:33Z
labels:
app: repo-base
name: repo-base
resourceVersion: "1154628"
selfLink: /oapi/v1/namespaces/repo/buildconfigs/repo-base
uid: 8c7335e2-a390-11e5-94ad-74d43587d03d
spec:
output:
to:
kind: ImageStreamTag
name: repo-base:latest
resources: {}
source:
contextDir: base
git:
uri: https://github.com/redacted/repo-docker
type: Git
strategy:
dockerStrategy:
from:
kind: ImageStreamTag
name: fedora:23
type: Docker
triggers:
- github:
secret: F2DrKO5Qh18YHLXGeMi6
type: GitHub
- generic:
secret: F825qjppaFbaH5C5wg1A
type: Generic
- type: ConfigChange
- imageChange:
lastTriggeredImageID: library/fedora@sha256:1ff6a16a751bff06dc5043c6e7a54c02a41f69c53ab1158fe6e379a3cc67439f
type: ImageChange
status:
lastVersion: 8
- apiVersion: v1
kind: Build
metadata:
annotations:
openshift.io/build.number: "7"
openshift.io/build.pod-name: repo-base-7-build
creationTimestamp: 2015-12-17T01:58:20Z
labels:
app: repo-base
buildconfig: repo-base
openshift.io/build-config.name: repo-base
name: repo-base-7
resourceVersion: "1149556"
selfLink: /oapi/v1/namespaces/repo/builds/repo-base-7
uid: a5ac0818-a461-11e5-9268-74d43587d03d
spec:
output:
pushSecret:
name: builder-dockercfg-jmiml
to:
kind: ImageStreamTag
name: repo-base:latest
resources: {}
serviceAccount: builder
source:
contextDir: base
git:
uri: https://github.com/redacted/repo-docker
type: Git
strategy:
dockerStrategy:
env:
- name: BUILD_LOGLEVEL
value: "8"
from:
kind: DockerImage
name: library/fedora@sha256:1ff6a16a751bff06dc5043c6e7a54c02a41f69c53ab1158fe6e379a3cc67439f
type: Docker
status:
completionTimestamp: 2015-12-17T02:00:03Z
config:
kind: BuildConfig
name: repo-base
duration: 96000000000
outputDockerImageReference: 172.30.201.81:5000/repo/repo-base:latest
phase: Failed
startTimestamp: 2015-12-17T01:58:27Z
- apiVersion: v1
kind: Build
metadata:
annotations:
openshift.io/build.number: "8"
openshift.io/build.pod-name: repo-base-8-build
creationTimestamp: 2015-12-17T14:36:15Z
labels:
app: repo-base
buildconfig: repo-base
openshift.io/build-config.name: repo-base
name: repo-base-8
resourceVersion: "1154645"
selfLink: /oapi/v1/namespaces/repo/builds/repo-base-8
uid: 8704b83b-a4cb-11e5-9268-74d43587d03d
spec:
output:
pushSecret:
name: builder-dockercfg-jmiml
to:
kind: ImageStreamTag
name: repo-base:latest
resources: {}
serviceAccount: builder
source:
contextDir: base
git:
uri: https://github.com/redacted/repo-docker
type: Git
strategy:
dockerStrategy:
from:
kind: DockerImage
name: library/fedora@sha256:1ff6a16a751bff06dc5043c6e7a54c02a41f69c53ab1158fe6e379a3cc67439f
type: Docker
status:
config:
kind: BuildConfig
name: repo-base
duration: 1000000000
outputDockerImageReference: 172.30.201.81:5000/repo/repo-base:latest
phase: Running
startTimestamp: 2015-12-17T14:36:24Z
- apiVersion: v1
kind: ImageStream
metadata:
annotations:
openshift.io/image.dockerRepositoryCheck: 2015-12-16T01:04:08Z
creationTimestamp: 2015-12-16T01:04:08Z
labels:
app: repo-base
name: repo-base
resourceVersion: "1139441"
selfLink: /oapi/v1/namespaces/repo/imagestreams/repo-base
uid: e8fde4ab-a390-11e5-94ad-74d43587d03d
spec: {}
status:
dockerImageRepository: 172.30.201.81:5000/repo/repo-base
kind: List
metadata: {}
5 changes: 3 additions & 2 deletions pkg/cmd/cli/describe/projectstatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ func (d *ProjectStatusDescriber) Describe(namespace, name string) (string, error

for _, standaloneImage := range standaloneImages {
fmt.Fprintln(out)
printLines(out, indent, 0, describeStandaloneBuildGroup(standaloneImage, namespace)...)
printLines(out, indent, 1, describeAdditionalBuildDetail(standaloneImage.Build, standaloneImage.LastSuccessfulBuild, standaloneImage.LastUnsuccessfulBuild, standaloneImage.ActiveBuilds, standaloneImage.DestinationResolved, true)...)
lines := describeStandaloneBuildGroup(standaloneImage, namespace)
lines = append(lines, describeAdditionalBuildDetail(standaloneImage.Build, standaloneImage.LastSuccessfulBuild, standaloneImage.LastUnsuccessfulBuild, standaloneImage.ActiveBuilds, standaloneImage.DestinationResolved, true)...)
printLines(out, indent, 0, lines...)
}

for _, standaloneRC := range standaloneRCs {
Expand Down
13 changes: 13 additions & 0 deletions pkg/cmd/cli/describe/projectstatus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,19 @@ func TestProjectStatus(t *testing.T) {
"bc/ruby-hello-world is pushing to imagestreamtag/ruby-hello-world:latest that is using is/ruby-hello-world, but the administrator has not configured the integrated Docker registry.",
},
},
"bare-bc-can-push": {
Path: "../../../../pkg/api/graph/test/bare-bc-can-push.yaml",
Extra: []runtime.Object{
&projectapi.Project{
ObjectMeta: kapi.ObjectMeta{Name: "example", Namespace: ""},
},
},
ErrFn: func(err error) bool { return err == nil },
Contains: []string{
// this makes sure that status knows this can push. If it fails, there's a "(can't push image)" next to like #8
" hours\n #7",
},
},
"cyclical build": {
Path: "../../../../pkg/api/graph/test/circular.yaml",
Extra: []runtime.Object{
Expand Down