Skip to content

Commit

Permalink
boring: legacy scheme moved
Browse files Browse the repository at this point in the history
  • Loading branch information
deads2k committed Dec 5, 2017
1 parent 6daf94b commit 8b12ec9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkg/build/controller/jenkins/jenkins.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (t *PipelineTemplate) Process() (*kapi.List, []error) {
func (t *PipelineTemplate) HasJenkinsService(items *kapi.List) bool {
accessor := meta.NewAccessor()
for _, item := range items.Items {
kind, _, err := legacyscheme.Scheme.ObjectKind(item)
kinds, _, err := legacyscheme.Scheme.ObjectKinds(item)
if err != nil {
glog.Infof("Error checking Jenkins service kind: %v", err)
return false
Expand All @@ -85,9 +85,12 @@ func (t *PipelineTemplate) HasJenkinsService(items *kapi.List) bool {
glog.Infof("Error checking Jenkins service name: %v", err)
return false
}
glog.Infof("Jenkins Pipeline template object %q with name %q", name, kind.Kind)
if name == t.Config.ServiceName && kind.Kind == "Service" {
return true
glog.Infof("Jenkins Pipeline template object %q with name %q", name, kinds[0].Kind)

for _, kind := range kinds {
if name == t.Config.ServiceName && kind.GroupKind() == kapi.Kind("Service") {
return true
}
}
}
return false
Expand Down

0 comments on commit 8b12ec9

Please sign in to comment.