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

runOnceCloud symbol is not unique and break component CasC loading

    • anka-build-plugin 2.9.0

      The anka-build and vsphere-cloud plugins both have a CloudRetentionStrategy of the same name without using a unique idientifier.:

      This breaks casc loading with:

      Jul 18, 2022 3:44:20 PM io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator handleDuplicateSymbols
      WARNING: Found multiple implementations for symbol = runOnceCloud: [com.veertu.plugin.anka.RunOnceCloudRetentionStrategy$DescriptorImpl@539f8b17, org.jenkinsci.plugins.vsphere.RunOnceCloudRetentionStrategy$DescriptorImpl@115d690a]. Please report to plugin maintainer.
      

      And example like the following reproduce the problem:

      jenkins:
        agentProtocols:
        - "Diagnostic-Ping"
        - "JNLP4-connect"
        - "OperationsCenter2"
        - "Ping"
        clouds:
          - ankaMgmt:
              ankaMgmtUrl: "https://company-anka"
              cloudInstanceCap: -1
              cloudName: "anka"
              launchRetryWaitTime: 10
              maxLaunchRetries: 10
              skipTLSVerification: false
              sshLaunchDelaySeconds: 60
              templates:
              - cloudName: "anka"
                credentialsId: "anka-creds"
                deleteLatest: false
                dontAppendTimestamp: false
                keepAliveOnError: false
                label: "windows anka"
                launchDelay: 0
                launchMethod: "ssh"
                masterVmId: "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                nameTemplate: "windows-anka"
                numberOfExecutors: 1
                priority: 0
                remoteFS: "C:/jenkins"
                retentionStrategy:
                  runOnceCloud:
                    idleMinutes: 1
                saveImage: false
                saveImageParameters:
                  deleteLatest: false
                  dontAppendTimestamp: false
                  saveImage: false
                  suspend: false
                  templateID: "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                  waitForBuildToFinish: false
                schedulingTimeout: 1800
                suspend: false
                templateId: "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                waitForBuildToFinish: false
          - vSphere:
              instanceCap: 100
              maxOnlineSlaves: 0
              templates:
                - cloneNamePrefix: "windows-"
                  cluster: "Company"
                  datastore: "Company-FMD-01"
                  folder: "Company/Jenkins agents/Linked clones"
                  forceVMLaunch: true
                  guestInfoProperties:
                    # ^ escapes the secret
                    - name: "JENKINS_URL"
                      value: "^${JENKINS_URL}"
                  labelString: "windows vsphere"
                  launchDelay: 60
                  launcher:
                    jnlp:
                      tunnel: "jenkins:"
                  limitedRunCount: 1
                  linkedClone: true
                  masterImageName: "windows-server-2019"
                  mode: EXCLUSIVE
                  numberOfExecutors: 1
                  remoteFS: "C:/jenkins"
                  resourcePool: "Resources"
                  retentionStrategy:
                    runOnceCloud:
                      idleMinutes: 2
                  saveFailure: false
                  templateInstanceCap: 5
                  useSnapshot: true
                  waitForVMTools: true
              vsConnectionConfig:
                vsHost: "https://company-vsphere"
              vsDescription: "Company vSphere"
      

          [JENKINS-69035] runOnceCloud symbol is not unique and break component CasC loading

          Allan BURDAJEWICZ created issue -
          Allan BURDAJEWICZ made changes -
          Description Original: The anka-build and vsphere-cloud plugins both have a CloudRetentionStrategy of the same name without using a unique idientifier.:

          * https://github.com/jenkinsci/anka-build-plugin/blob/anka-build-2.8.0/src/main/java/com/veertu/plugin/anka/RunOnceCloudRetentionStrategy.java
          * https://github.com/jenkinsci/vsphere-cloud-plugin/blob/vsphere-cloud-2.27/src/main/java/org/jenkinsci/plugins/vsphere/RunOnceCloudRetentionStrategy.java

          This breaks casc loading with:

          {code}
          Jul 18, 2022 3:44:20 PM io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator handleDuplicateSymbols
          WARNING: Found multiple implementations for symbol = runOnceCloud: [com.veertu.plugin.anka.RunOnceCloudRetentionStrategy$DescriptorImpl@539f8b17, org.jenkinsci.plugins.vsphere.RunOnceCloudRetentionStrategy$DescriptorImpl@115d690a]. Please report to plugin maintainer.
          {code}

          And example like the following reproduce the problem:

          {code}
          jenkins:
            agentProtocols:
            - "Diagnostic-Ping"
            - "JNLP4-connect"
            - "OperationsCenter2"
            - "Ping"
            authorizationStrategy: "cloudBeesRoleBasedAccessControl"
            clouds:
              - ankaMgmt:
                  ankaMgmtUrl: "https://company-anka"
                  cloudInstanceCap: -1
                  cloudName: "anka"
                  launchRetryWaitTime: 10
                  maxLaunchRetries: 10
                  skipTLSVerification: false
                  sshLaunchDelaySeconds: 60
                  templates:
                  - cloudName: "anka"
                    credentialsId: "anka-creds"
                    deleteLatest: false
                    dontAppendTimestamp: false
                    keepAliveOnError: false
                    label: "windows anka"
                    launchDelay: 0
                    launchMethod: "ssh"
                    masterVmId: "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                    nameTemplate: "windows-anka"
                    numberOfExecutors: 1
                    priority: 0
                    remoteFS: "C:/jenkins"
                    retentionStrategy:
                      runOnceCloud:
                        idleMinutes: 1
                    saveImage: false
                    saveImageParameters:
                      deleteLatest: false
                      dontAppendTimestamp: false
                      saveImage: false
                      suspend: false
                      templateID: "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                      waitForBuildToFinish: false
                    schedulingTimeout: 1800
                    suspend: false
                    templateId: "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                    waitForBuildToFinish: false
              - vSphere:
                  instanceCap: 100
                  maxOnlineSlaves: 0
                  templates:
                    - cloneNamePrefix: "windows-"
                      cluster: "Company"
                      datastore: "Company-FMD-01"
                      folder: "Company/Jenkins agents/Linked clones"
                      forceVMLaunch: true
                      guestInfoProperties:
                        # ^ escapes the secret
                        - name: "JENKINS_URL"
                          value: "^${JENKINS_URL}"
                      labelString: "windows vsphere"
                      launchDelay: 60
                      launcher:
                        jnlp:
                          tunnel: "jenkins:"
                      limitedRunCount: 1
                      linkedClone: true
                      masterImageName: "windows-server-2019"
                      mode: EXCLUSIVE
                      numberOfExecutors: 1
                      remoteFS: "C:/jenkins"
                      resourcePool: "Resources"
                      retentionStrategy:
                        runOnceCloud:
                          idleMinutes: 2
                      saveFailure: false
                      templateInstanceCap: 5
                      useSnapshot: true
                      waitForVMTools: true
                  vsConnectionConfig:
                    vsHost: "https://company-vsphere"
                  vsDescription: "Company vSphere"
          {code}
          New: The anka-build and vsphere-cloud plugins both have a CloudRetentionStrategy of the same name without using a unique idientifier.:

          * https://github.com/jenkinsci/anka-build-plugin/blob/anka-build-2.8.0/src/main/java/com/veertu/plugin/anka/RunOnceCloudRetentionStrategy.java
          * https://github.com/jenkinsci/vsphere-cloud-plugin/blob/vsphere-cloud-2.27/src/main/java/org/jenkinsci/plugins/vsphere/RunOnceCloudRetentionStrategy.java

          This breaks casc loading with:

          {code}
          Jul 18, 2022 3:44:20 PM io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator handleDuplicateSymbols
          WARNING: Found multiple implementations for symbol = runOnceCloud: [com.veertu.plugin.anka.RunOnceCloudRetentionStrategy$DescriptorImpl@539f8b17, org.jenkinsci.plugins.vsphere.RunOnceCloudRetentionStrategy$DescriptorImpl@115d690a]. Please report to plugin maintainer.
          {code}

          And example like the following reproduce the problem:

          {code}
          jenkins:
            agentProtocols:
            - "Diagnostic-Ping"
            - "JNLP4-connect"
            - "OperationsCenter2"
            - "Ping"
            clouds:
              - ankaMgmt:
                  ankaMgmtUrl: "https://company-anka"
                  cloudInstanceCap: -1
                  cloudName: "anka"
                  launchRetryWaitTime: 10
                  maxLaunchRetries: 10
                  skipTLSVerification: false
                  sshLaunchDelaySeconds: 60
                  templates:
                  - cloudName: "anka"
                    credentialsId: "anka-creds"
                    deleteLatest: false
                    dontAppendTimestamp: false
                    keepAliveOnError: false
                    label: "windows anka"
                    launchDelay: 0
                    launchMethod: "ssh"
                    masterVmId: "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                    nameTemplate: "windows-anka"
                    numberOfExecutors: 1
                    priority: 0
                    remoteFS: "C:/jenkins"
                    retentionStrategy:
                      runOnceCloud:
                        idleMinutes: 1
                    saveImage: false
                    saveImageParameters:
                      deleteLatest: false
                      dontAppendTimestamp: false
                      saveImage: false
                      suspend: false
                      templateID: "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                      waitForBuildToFinish: false
                    schedulingTimeout: 1800
                    suspend: false
                    templateId: "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                    waitForBuildToFinish: false
              - vSphere:
                  instanceCap: 100
                  maxOnlineSlaves: 0
                  templates:
                    - cloneNamePrefix: "windows-"
                      cluster: "Company"
                      datastore: "Company-FMD-01"
                      folder: "Company/Jenkins agents/Linked clones"
                      forceVMLaunch: true
                      guestInfoProperties:
                        # ^ escapes the secret
                        - name: "JENKINS_URL"
                          value: "^${JENKINS_URL}"
                      labelString: "windows vsphere"
                      launchDelay: 60
                      launcher:
                        jnlp:
                          tunnel: "jenkins:"
                      limitedRunCount: 1
                      linkedClone: true
                      masterImageName: "windows-server-2019"
                      mode: EXCLUSIVE
                      numberOfExecutors: 1
                      remoteFS: "C:/jenkins"
                      resourcePool: "Resources"
                      retentionStrategy:
                        runOnceCloud:
                          idleMinutes: 2
                      saveFailure: false
                      templateInstanceCap: 5
                      useSnapshot: true
                      waitForVMTools: true
                  vsConnectionConfig:
                    vsHost: "https://company-vsphere"
                  vsDescription: "Company vSphere"
          {code}

          Proposed for https://github.com/jenkinsci/vsphere-cloud-plugin/pull/132 that already add a test in place. Something similar could be done to Anka.

          Allan BURDAJEWICZ added a comment - Proposed for https://github.com/jenkinsci/vsphere-cloud-plugin/pull/132 that already add a test in place. Something similar could be done to Anka.

          pjdarton added a comment -

          vSphere PR merged, but not released yet.

          While I realise that either plugin can resolve the clash, IMO both plugins should do so before we can flag this as "fixed" - the name RunOnceCloudRetentionStrategy is just way too generic if there's a uniqueness requirement.

          pjdarton added a comment - vSphere PR merged, but not released yet. While I realise that either plugin can resolve the clash, IMO both plugins should do so before we can flag this as "fixed" - the name RunOnceCloudRetentionStrategy is just way too generic if there's a uniqueness requirement.

          I agree. vSphere already tests in place so I did a quick fix there. I have just opened one for anka too: https://github.com/jenkinsci/anka-build-plugin/pull/11

          Allan BURDAJEWICZ added a comment - I agree. vSphere already tests in place so I did a quick fix there. I have just opened one for anka too: https://github.com/jenkinsci/anka-build-plugin/pull/11
          Allan BURDAJEWICZ made changes -
          Remote Link New: This issue links to "anka-build #11 (Web Link)" [ 27974 ]
          Allan BURDAJEWICZ made changes -
          Remote Link New: This issue links to "vsphere-cloud #132 (Web Link)" [ 27975 ]
          Allan BURDAJEWICZ made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Allan BURDAJEWICZ made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Allan BURDAJEWICZ made changes -
          Summary Original: runOnceCloud symbol is not unique and component CasC loading New: runOnceCloud symbol is not unique and break component CasC loading

            niv_keidan_veertu niv keidan
            allan_burdajewicz Allan BURDAJEWICZ
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: