Bug 1390288

Summary: allow configuration of more than one namespace to sync
Product: OKD Reporter: Ben Parees <bparees>
Component: BuildAssignee: Ben Parees <bparees>
Status: CLOSED CURRENTRELEASE QA Contact: Dongbo Yan <dyan>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs, dyan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-10 21:34:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ben Parees 2016-10-31 15:50:40 UTC
Currently only a single namespace can be specified for the sync plugin to synchronize against.  It should be possible to specify any number of namespaces (comma or space separated) and they should all be synced (assuming the jenkins service account has appropriate permissions to access/edit all the namespaces).

This is a tracker bug for https://github.com/fabric8io/openshift-jenkins-sync-plugin/issues/63

Comment 1 Ben Parees 2016-11-16 20:38:34 UTC
*** Bug 1391209 has been marked as a duplicate of this bug. ***

Comment 2 Ben Parees 2016-11-16 20:43:45 UTC
*** Bug 1390294 has been marked as a duplicate of this bug. ***

Comment 3 Ben Parees 2017-02-03 14:56:40 UTC
This is more of a feature than a bug and too risky to include in 3.5 at this point, so moving to upcoming release.

in progress PR is here:
https://github.com/openshift/jenkins-sync-plugin/pull/115

Comment 4 Ben Parees 2017-03-09 12:52:38 UTC
PR has been merged and included in the jenkins centos image, but we haven't put it into the rhel image yet.  Will update this bug when we do.

Comment 6 Dongbo Yan 2017-04-18 08:46:38 UTC
Test with brew-pulp.../openshift3/jenkins-2-rhel7@sha256:19cbf5987b692ea7bea9be30c7e6ad4a149f77a063c563e746ff0f31e9a6bc53

openshift-login	0.12
openshift-pipeline 1.0.42
openshift-sync	0.1.12

Steps:
1.$ oc policy add-role-to-user admin system:serviceaccount:dyantest:jenkins -n dyan2
1.Go to "Manage Jenkins" -> "Configure System" -> "OpenShift Jenkins Sync", input namespace name which want to sync in "Namespace" box.

Actual result: could see pipeline build from other namespace sync into jenkins

But there is an issue, if I start a new pipeline build, it will execute action defined in pipeline build twice. 
For example:
I use https://raw.githubusercontent.com/openshift/origin/master/examples/jenkins/pipeline/samplepipeline.yaml to create pipeline build, if I execute
$ oc start-build sample-pipeline , then the build "sample-pipeline-2" will trigger "nodejs-mongodb-example-2" and "nodejs-mongodb-example-3"
# oc get build -n dyan2
NAME                       TYPE              FROM          STATUS     STARTED          DURATION
nodejs-mongodb-example-1   Source            Git@e81cacf   Complete   5 hours ago      38s
nodejs-mongodb-example-2   Source            Git@e81cacf   Complete   21 minutes ago   18s
nodejs-mongodb-example-3   Source            Git@e81cacf   Complete   21 minutes ago   17s
sample-pipeline-1          JenkinsPipeline                 Complete   5 hours ago      
sample-pipeline-2          JenkinsPipeline                 Complete   21 minutes ago

so is it normal, should I file a bug for it

Comment 7 Dongbo Yan 2017-04-18 09:42:33 UTC
have reported this https://bugzilla.redhat.com/show_bug.cgi?id=1443009