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

Support regex for "Image name" parameter

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      jenkins master: LTS 1.121.1
      gce plugin: 1.0.4
      packer: 1.2.4
    • Similar Issues:

      Description

      Hi! 

      I'm follow this guide for plugin: [https://cloud.google.com/solutions/using-jenkins-for-distributed-builds-on-compute-engine

      We have some automation for creating new google images with packer.

      We use packer json template parameter: "image_name": "<static-prefix>-timestamp".

      But we still need choose "Image name" from the list manually. 

      Could you please to add regex form for gce plugin "Image name" parameter?
      We can use pattern "^<some-prefix>-.*" and get the latest google image for slaves every time without manual operations.

       

        Attachments

          Issue Links

            Activity

            ramzol dmitrii dudin created issue -
            Hide
            ingwar Karol Lassak added a comment - - edited

            Better option would be to allow usage of families of images..

             

            Then you could just add family name for your image and it would choose last on for you..

            Show
            ingwar Karol Lassak added a comment - - edited Better option would be to allow usage of families of images..   Then you could just add family name for your image and it would choose last on for you..
            evanbrown Evan Brown made changes -
            Field Original Value New Value
            Assignee Evan Brown [ evanbrown ] Rachel Yen [ zombiemoose ]
            Hide
            ingwar Karol Lassak added a comment -

            Family is better option..

            Show
            ingwar Karol Lassak added a comment - Family is better option..
            ingwar Karol Lassak made changes -
            Link This issue duplicates JENKINS-54418 [ JENKINS-54418 ]
            Hide
            zombiemoose Rachel Yen added a comment -

            We have that now with templates. Will that suffice?

            Show
            zombiemoose Rachel Yen added a comment - We have that now with templates. Will that suffice?
            Hide
            ramzol dmitrii dudin added a comment -

            I can't check because i got an error after update GCE plugin 1.0.7 -> 1.0.8
            ```
            WARNING: Error provisioning node
            com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
            {
            "code" : 400,
            "errors" : [

            { "domain" : "global", "message" : "Invalid value for field 'sourceInstanceTemplate': ''. The URL is malformed.", "reason" : "invalid" }

            ],
            "message" : "Invalid value for field 'sourceInstanceTemplate': ''. The URL is malformed."
            }
            at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:146)
            at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
            at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
            at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321)
            at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1065)
            at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
            at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
            at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
            at com.google.jenkins.plugins.computeengine.client.ComputeClient.insertInstance(ComputeClient.java:345)
            at com.google.jenkins.plugins.computeengine.InstanceConfiguration.provision(InstanceConfiguration.java:287)
            at com.google.jenkins.plugins.computeengine.ComputeEngineCloud.provision(ComputeEngineCloud.java:159)
            at hudson.slaves.NodeProvisioner$StandardStrategyImpl.apply(NodeProvisioner.java:715)
            at hudson.slaves.NodeProvisioner.update(NodeProvisioner.java:320)
            at hudson.slaves.NodeProvisioner.access$000(NodeProvisioner.java:61)
            at hudson.slaves.NodeProvisioner$NodeProvisionerInvoker.doRun(NodeProvisioner.java:809)
            at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:72)
            at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
            at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
            at java.lang.Thread.run(Thread.java:748)
            ```

            Show
            ramzol dmitrii dudin added a comment - I can't check because i got an error after update GCE plugin 1.0.7 -> 1.0.8 ``` WARNING: Error provisioning node com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request { "code" : 400, "errors" : [ { "domain" : "global", "message" : "Invalid value for field 'sourceInstanceTemplate': ''. The URL is malformed.", "reason" : "invalid" } ], "message" : "Invalid value for field 'sourceInstanceTemplate': ''. The URL is malformed." } at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:146) at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113) at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321) at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1065) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469) at com.google.jenkins.plugins.computeengine.client.ComputeClient.insertInstance(ComputeClient.java:345) at com.google.jenkins.plugins.computeengine.InstanceConfiguration.provision(InstanceConfiguration.java:287) at com.google.jenkins.plugins.computeengine.ComputeEngineCloud.provision(ComputeEngineCloud.java:159) at hudson.slaves.NodeProvisioner$StandardStrategyImpl.apply(NodeProvisioner.java:715) at hudson.slaves.NodeProvisioner.update(NodeProvisioner.java:320) at hudson.slaves.NodeProvisioner.access$000(NodeProvisioner.java:61) at hudson.slaves.NodeProvisioner$NodeProvisionerInvoker.doRun(NodeProvisioner.java:809) at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:72) at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ```
            Hide
            zombiemoose Rachel Yen added a comment -

            Were you trying to use a template? What exactly were you trying to do that created this error?

            Show
            zombiemoose Rachel Yen added a comment - Were you trying to use a template? What exactly were you trying to do that created this error?
            Hide
            zombiemoose Rachel Yen added a comment -

            Closing as templates are fixed now and will address your issues.

             

            If you need to re-open, please see the following as we are migrating off JIRA:

            https://github.com/jenkinsci/google-compute-engine-plugin/issues

            Show
            zombiemoose Rachel Yen added a comment - Closing as templates are fixed now and will address your issues.   If you need to re-open, please see the following as we are migrating off JIRA: https://github.com/jenkinsci/google-compute-engine-plugin/issues
            zombiemoose Rachel Yen made changes -
            Status Open [ 1 ] Closed [ 6 ]
            Resolution Fixed [ 1 ]

              People

              • Assignee:
                zombiemoose Rachel Yen
                Reporter:
                ramzol dmitrii dudin
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: