Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-60355

Updating openshift-sync-configuration from jenkins-cli does not result in watching newly assigned namespaces

XMLWordPrintable

      Hi Support Team,

      we are currently trying to set up a containerized Jenkins-Soulution in our company based n OpenShift.

      For this, we want to onboard new OpenShuft-Projects via self-service and needed a solution to update the monitored namespaces without human intervention.

      On our research we found, that it is possible to update the OpenShift-Synch values by jenkins-cli and developed a solution. The update does result in the values being visible by the Configuration-Screen, but created BuildConfigurations do not appear in the Project-Dashboard.

      Configuration on a freshly deployed Jenkins in namespace dhorn-jenkins-test

      Content of newConfig.yaml - after reading the whole configuration, we have seen, that the menitored namespaces are listed under unclassified -> globalPluginConfiguration -> namespace

       

      ---
      unclassified:
        globalPluginConfiguration:
          namespace: dhorn-jenkins-test dhorn-automated
      
      

       

       

      $> java -jar jenkins-cli.jar -s https://my-server.url -auth name:password apply-configuration < newConfig.yaml

      This results in a update of the configuration-page, but no additional builds are visible in the Dashboard

      Container-Logs after the cli-command do not state OpenShift at all:

      2019-12-03 16:45:37.240+0000 [id=88]	WARNING	i.j.p.casc.BaseConfigurator#createAttribute: Can't handle class org.sonatype.nexus.ci.config.GlobalNexusConfiguration#metaClass: type is abstract but not Describable.
      2019-12-03 16:45:37.460+0000 [id=88]	INFO	o.s.c.s.AbstractApplicationContext#prepareRefresh: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@3d7a3392: display name [Root WebApplicationContext]; startup date [Tue Dec 03 16:45:37 UTC 2019]; root of context hierarchy
      2019-12-03 16:45:37.460+0000 [id=88]	INFO	o.s.c.s.AbstractApplicationContext#obtainFreshBeanFactory: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@3d7a3392]: org.springframework.beans.factory.support.DefaultListableBeanFactory@385aa5af
      2019-12-03 16:45:37.461+0000 [id=88]	INFO	o.s.b.f.s.DefaultListableBeanFactory#preInstantiateSingletons: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@385aa5af: defining beans [authenticationManager,activeDirectory]; root of factory hierarchy
      2019-12-03 16:45:37.565+0000 [id=88]	INFO	o.s.c.s.AbstractApplicationContext#prepareRefresh: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@174899b2: display name [Root WebApplicationContext]; startup date [Tue Dec 03 16:45:37 UTC 2019]; root of context hierarchy
      2019-12-03 16:45:37.565+0000 [id=88]	INFO	o.s.c.s.AbstractApplicationContext#obtainFreshBeanFactory: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@174899b2]: org.springframework.beans.factory.support.DefaultListableBeanFactory@710b350d
      2019-12-03 16:45:37.566+0000 [id=88]	INFO	o.s.b.f.s.DefaultListableBeanFactory#preInstantiateSingletons: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@710b350d: defining beans [filter,legacy]; root of factory hierarchy
      2019-12-03 16:45:37.571+0000 [id=88]	INFO	o.c.j.p.k.KubernetesClientProvider$SaveableListenerImpl#onChange: Invalidating Kubernetes client: kubernetes null
      Processing provided DSL script
      2019-12-03 16:45:37.910+0000 [id=88]	INFO	j.j.plugin.JenkinsJobManagement#createOrUpdateConfig: createOrUpdateConfig for scrummaster nightly
      2019-12-03 16:45:38.456+0000 [id=88]	WARNING	i.j.p.casc.BaseConfigurator#createAttribute: Can't handle class org.sonatype.nexus.ci.config.GlobalNexusConfiguration#metaClass: type is abstract but not Describable.
      

      As soon as the save- or apply-button in the configuration screen is pressed (without changing anything after the cli-command) the builds will be visible in the Dashboard. Logs after Save-Button do mention a update on the SopenShift Synch Plugin:

      2019-12-03 16:46:19.642+0000 [id=494]	INFO	i.f.j.o.GlobalPluginConfiguration#configChange: OpenShift Sync Plugin processing a newly supplied configuration
      2019-12-03 16:46:19.642+0000 [id=494]	INFO	i.f.j.openshiftsync.BaseWatcher#onClose: Watch for type io.fabric8.jenkins.openshiftsync.BuildConfigWatcher closed for one of the following namespaces: [dhorn-jenkins-test]
      2019-12-03 16:46:19.642+0000 [id=494]	INFO	i.f.j.openshiftsync.BaseWatcher#onClose: Watch for type io.fabric8.jenkins.openshiftsync.BuildWatcher closed for one of the following namespaces: [dhorn-jenkins-test]
      2019-12-03 16:46:19.642+0000 [id=494]	INFO	i.f.j.openshiftsync.BaseWatcher#onClose: Watch for type io.fabric8.jenkins.openshiftsync.ConfigMapWatcher closed for one of the following namespaces: [dhorn-jenkins-test]
      2019-12-03 16:46:19.643+0000 [id=494]	INFO	i.f.j.openshiftsync.BaseWatcher#onClose: Watch for type io.fabric8.jenkins.openshiftsync.ImageStreamWatcher closed for one of the following namespaces: [dhorn-jenkins-test]
      2019-12-03 16:46:19.643+0000 [id=494]	INFO	i.f.j.openshiftsync.BaseWatcher#onClose: Watch for type io.fabric8.jenkins.openshiftsync.SecretWatcher closed for one of the following namespaces: [dhorn-jenkins-test]
      URL can't be empty
      2019-12-03 16:46:19.716+0000 [id=494]	INFO	o.c.j.p.k.KubernetesClientProvider$SaveableListenerImpl#onChange: Invalidating Kubernetes client: kubernetes null
      2019-12-03 16:46:20.651+0000 [id=35]	INFO	i.f.j.o.GlobalPluginConfigurationTimerTask#doRun: Confirming Jenkins is started
      2019-12-03 16:46:20.651+0000 [id=35]	INFO	i.f.j.o.BuildConfigWatcher#start: Now handling startup build configs!!
      2019-12-03 16:46:20.651+0000 [id=35]	INFO	i.f.j.o.PodTemplateUtils#propogateProxyConfigToReservedPodTemplates: Propogate proxy config to Reserved PodTemplates
      2019-12-03 16:46:20.652+0000 [id=35]	INFO	i.f.j.o.PodTemplateUtils#propogateProxyConfigToReservedPodTemplates: Propogate proxy config to Reserved PodTemplates
      2019-12-03 16:46:20.652+0000 [id=35]	INFO	i.f.j.o.PodTemplateUtils#propogateProxyConfigToReservedPodTemplates: Propogate proxy config to Reserved PodTemplates
      2019-12-03 16:46:20.652+0000 [id=35]	INFO	i.f.j.o.ConfigMapWatcher#start: Now handling startup config maps!!
      2019-12-03 16:46:20.652+0000 [id=35]	INFO	i.f.j.o.ImageStreamWatcher#start: Now handling startup image streams!!
      2019-12-03 16:46:20.652+0000 [id=35]	INFO	i.f.j.o.PodTemplateUtils#propogateProxyConfigToReservedPodTemplates: Propogate proxy config to Reserved PodTemplates
      2019-12-03 16:46:20.652+0000 [id=35]	INFO	i.f.j.o.PodTemplateUtils#propogateProxyConfigToReservedPodTemplates: Propogate proxy config to Reserved PodTemplates
      2019-12-03 16:46:20.652+0000 [id=35]	INFO	i.f.j.o.SecretWatcher#start: Now handling startup secrets!!
      

      Is there a way, to update the monitored namespaces of the plugin by other means?

      Could it be possible to run a ConfigurationUpdate as done by the Save-Button in the cli or other APIs?

       

       

      Thank you for your support.

      Daniel

            gmontero Gabe Montero
            dhorn Daniel Horn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: