Bug 2034839 - Jenkins sync plugin does not synchronize ConfigMap having label role=jenkins-agent [NEEDINFO]
Summary: Jenkins sync plugin does not synchronize ConfigMap having label role=jenkins-...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Jenkins
Version: 4.10
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.10.0
Assignee: Akram Ben Aissi
QA Contact: Priti Kumari
URL:
Whiteboard:
Depends On:
Blocks: 2038961
TreeView+ depends on / blocked
 
Reported: 2021-12-22 10:20 UTC by Priti Kumari
Modified: 2022-03-12 04:40 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
* Before this update, performance improvements in version 1.0.48 of the OpenShift Sync Jenkins plug-in incorrectly specified the labels accepted for `ConfigMap` and `ImageStream` objects intended to map into the Jenkins Kubernetes plug-in pod templates. As a result, the plug-in no longer imported pod templates from `ConfigMap` and `ImageStream` objects with the 'jenkins-agent' label. + This update corrects accepted label specification so that the plug-in imports pod templates from `ConfigMap` and `ImageStream` objects that have the 'jenkins-agent' label. (link:https://bugzilla.redhat.com/show_bug.cgi?id=2034839[2034839])
Clone Of:
Environment:
Last Closed: 2022-03-12 04:39:45 UTC
Target Upstream Version:
Embargoed:
rdlugyhe: needinfo? (abenaiss)


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift jenkins-sync-plugin pull 410 0 None open Bug 2034839: Watch ConfigMap and ImageStream also with the legacy label 2021-12-22 12:13:02 UTC
Github openshift jenkins pull 1361 0 None open Bug 2034839: bump sync plugin to 1.0.52 2022-01-10 16:09:24 UTC
Red Hat Product Errata RHSA-2022:0056 0 None None None 2022-03-12 04:40:00 UTC

Description Priti Kumari 2021-12-22 10:20:54 UTC
Description of problem:

Jenkins sync plugin does not synchronize ConfigMap having label role=jenkins-agent but only role=jenkins-slave on 4.x 

Version-Release number of selected component (if applicable): 1.0.51 


How reproducible: Always


Steps to Reproduce:

1. create a project. Just say testing
2. Create ConfigMap as suggested in https://docs.openshift.com/container-platform/4.9/openshift_images/using_images/images-other-jenkins.html#images-other-jenkins-config-kubernetes_images-other-jenkins with PodTemplate

e.g.

```
kind: ConfigMap
apiVersion: v1
metadata:
  name: my-pod-template
  labels:
    role: jenkins-agent
data:
  template1: |-
    <org.csanchez.jenkins.plugins.kubernetes.PodTemplate>
      <inheritFrom></inheritFrom>
      <name>template1</name>
      <instanceCap>2147483647</instanceCap>
      <idleMinutes>0</idleMinutes>
      <label>template1</label>
      <serviceAccount>jenkins</serviceAccount>
      <nodeSelector></nodeSelector>
      <volumes/>
      <containers>
        <org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate>
          <name>jnlp</name>
          <image>openshift/jenkins-agent-maven-35-centos7:v3.10</image>
          <privileged>false</privileged>
          <alwaysPullImage>true</alwaysPullImage>
          <workingDir>/tmp</workingDir>
          <command></command>
          <args>${computer.jnlpmac} ${computer.name}</args>
          <ttyEnabled>false</ttyEnabled>
          <resourceRequestCpu></resourceRequestCpu>
          <resourceRequestMemory></resourceRequestMemory>
          <resourceLimitCpu></resourceLimitCpu>
          <resourceLimitMemory></resourceLimitMemory>
          <envVars/>
        </org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate>
      </containers>
      <envVars/>
      <annotations/>
      <imagePullSecrets/>
      <nodeProperties/>
    </org.csanchez.jenkins.plugins.kubernetes.PodTemplate>
```

3. Restart Jenkins (ex - delete the Jenkins pod)
4. 

Actual results:

Can not find the configmap in the logs. However once changed the configmap label to `role=jenkins-slave` sync works properly.

Logs with role=jenkins-agent

```
2021-12-22 07:56:21 INFO    io.fabric8.jenkins.openshiftsync.ConfigMapInformer start Starting configMap informer for {} !!testing
2021-12-22 07:56:21 INFO    io.fabric8.jenkins.openshiftsync.ConfigMapInformer start ConfigMap informer started for namespace: {}testing
2021-12-22 07:56:21 INFO    io.fabric8.jenkins.openshiftsync.ImageStreamInformer start Starting ImageStream informer for {} !!testing
2021-12-22 07:56:21 INFO    io.fabric8.jenkins.openshiftsync.ImageStreamInformer start ImageStream informer started for namespace: {}testing
2021-12-22 07:56:21 INFO    io.fabric8.jenkins.openshiftsync.SecretInformer start Starting secret informer {} !!testing
```

Logs with role=jenkins-slave

```
2021-12-22 10:14:09 INFO    org.openshift.jenkins.plugins.openshiftlogin.OpenShiftOAuth2SecurityRealm initializeHttpsProxyAuthenticator Checking if HTTPS proxy initialization is required ... 
2021-12-22 10:14:09 INFO    io.fabric8.jenkins.openshiftsync.ConfigMapInformer onAdd ConfigMap informer received add event for: {}my-pod-template
2021-12-22 10:14:09 INFO    io.fabric8.jenkins.openshiftsync.BuildInformer onAdd Build informer received add event for: {}openshift-jee-sample-1
2021-12-22 10:14:09 INFO    io.fabric8.jenkins.openshiftsync.PodTemplateUtils addAgents Adding PodTemplate(s) for testing
```


Expected results:

configmap wit label role=jenkins-agent should sync with jenkins plugin.

Additional info:

Comment 2 Gabe Montero 2022-01-10 16:08:46 UTC
Need to do Jenkins image plugin bump ... moving back to Post

Comment 11 errata-xmlrpc 2022-03-12 04:39:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.10.3 security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:0056


Note You need to log in before you can comment on or make changes to this bug.