Skip to content

Cloud returns wrong url for itself when more than 1 cloud with same name is configured #26174

@mawinter69

Description

@mawinter69

Jenkins and plugins versions report

This is a follow up for #26002 (fixed with #26004)

Environment
Jenkins 2.547
agent-maintenance plugin from https://github.com/jenkinsci/agent-maintenance-plugin/pull/320 Though this is work in progress it also has currently problem with the indexed clouds and thus is not returning the proper cloud at the moment.
Requires https://github.com/jenkinsci/agent-maintenance-plugin/pull/320

What Operating System are you using (both controller, and any agents involved in the problem)?

not relevant

Reproduction steps

  1. Install one of the cloud plugins google-compute-engine, jclouds or openstack-cloud (there are some others as well)
  2. Create 2 clouds, e.g. with google compute, choose google as name on the config page (after pressing Create on the new cloud page. This creates 2 clouds with name `gce-google
  3. Go to Maintenance Windows on the second cloud (the one that has cloudByIndex in it's url)
  4. Click on Configure in the sidepabel

Expected Results

I get to this clouds configure page with cloudByIndex in the url

Actual Results

I get the cloud with the the cloud name in the url (gce-google)

Anything else?

The root cause is that action are included via the actions.jelly which uses Cloud#getUrl() that uses the cloud name and not the indexed url.

Are you interested in contributing a fix?

yes
The fix is that the cloud should properly return it's own url and when there is a collision in the name it automatically uses the indexed url.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lts-candidateWhen fixed, this issue should be considered for backporting to the LTS line

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions