Skip to content

Commit

Permalink
[JENKINS-71737] fix redirect when submitting cloud changes (#8505)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Brandes <[email protected]>
(cherry picked from commit ec27a07)
  • Loading branch information
car-roll authored and krisstern committed Jan 8, 2024
1 parent 2bc5292 commit 8908239
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion core/src/main/java/hudson/slaves/Cloud.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ public HttpResponse doConfigSubmit(StaplerRequest req, StaplerResponse rsp) thro
j.clouds.replace(this, result);
j.save();
// take the user back to the cloud top page.
return FormApply.success(".");
return FormApply.success("../" + result.name + '/');

}

public Cloud reconfigure(@NonNull final StaplerRequest req, JSONObject form) throws Descriptor.FormException {
Expand Down
1 change: 0 additions & 1 deletion core/src/main/java/jenkins/agents/CloudSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ private void handleNewCloudPage(Descriptor<Cloud> descriptor, String name, Stapl
checkName(name);
JSONObject formData = req.getSubmittedForm();
formData.put("name", name);
formData.put("cloudName", name); // ec2 uses that field name
formData.remove("mode"); // Cloud descriptors won't have this field.
req.setAttribute("instance", formData);
req.setAttribute("descriptor", descriptor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ THE SOFTWARE.
<l:isAdmin>
<f:bottomButtonBar>
<f:submit value="${%Save}"/>
<f:apply />
</f:bottomButtonBar>
</l:isAdmin>
</f:form>
Expand Down

0 comments on commit 8908239

Please sign in to comment.