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

          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

          niv keidan added a comment -

          Fixed in anka-build-plugin 2.9.0

          niv keidan added a comment - Fixed in anka-build-plugin 2.9.0

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

              Created:
              Updated:
              Resolved: