Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-71737] rename cloudName to name #462

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<gitHubRepo>jenkinsci/azure-vm-agents-plugin</gitHubRepo>
<jenkins.version>2.387.3</jenkins.version>
<maven.javadoc.skip>true</maven.javadoc.skip>
<hpi.compatibleSinceVersion>846</hpi.compatibleSinceVersion>
<hpi.compatibleSinceVersion>883</hpi.compatibleSinceVersion>
</properties>

<dependencyManagement>
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/microsoft/azure/vmagent/AzureVMCloud.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public class AzureVMCloud extends Cloud {

@DataBoundConstructor
public AzureVMCloud(
String cloudName,
String name,
String azureCredentialsId,
String maxVirtualMachinesLimit,
String deploymentTimeout,
Expand All @@ -145,7 +145,7 @@ public AzureVMCloud(
List<AzureVMAgentTemplate> vmTemplates) {
super(
getOrGenerateCloudName(
cloudName,
name,
azureCredentialsId,
getResourceGroupName(
resourceGroupReferenceType,
Expand Down Expand Up @@ -268,10 +268,10 @@ public String getCloudName() {
return this.name;
}

public static String getOrGenerateCloudName(String cloudName, String credentialId, String resourceGroupName) {
return StringUtils.isBlank(cloudName)
public static String getOrGenerateCloudName(String name, String credentialId, String resourceGroupName) {
return StringUtils.isBlank(name)
? AzureUtil.getCloudName(credentialId, resourceGroupName)
: cloudName;
: name;
}

public String getNewResourceGroupName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<f:block>
<a href="${rootURL}/log/${descriptor.logRecorderName}/" target="_blank">${%Azure_VM_Agent_Log_Link}</a>
</f:block>
<f:entry title="${%Cloud_Name}" field="cloudName"
<f:entry title="${%Cloud_Name}" field="name"
help="/plugin/azure-vm-agents/help-cloudName.html">
<f:textbox/>
</f:entry>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jenkins:
clouds:
- azureVM:
azureCredentialsId: "azure-cred"
cloudName: "azure"
name: "azure"
cloudTags:
- name: "author"
value: "gavin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jenkins:
clouds:
- azureVM:
azureCredentialsId: "azure-cred"
cloudName: "azure"
name: "azure"
deploymentTimeout: 1200
maxVirtualMachinesLimit: 10
newResourceGroupName: "vm-agent"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
- azureVM:
azureCredentialsId: "azure-cred"
cloudName: "azure"
cloudTags:
- name: "author"
value: "gavin"
deploymentTimeout: 1200
existingResourceGroupName: "vm-agents"
maxVirtualMachinesLimit: 10
name: "azure"
resourceGroupReferenceType: "existing"
vmTemplates:
- agentWorkspace: "/opt/jenkins"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
- azureVM:
azureCredentialsId: "azure-cred"
cloudName: "azure"
deploymentTimeout: 1200
maxVirtualMachinesLimit: 10
name: "azure"
newResourceGroupName: "vm-agent"
resourceGroupReferenceType: "new"
vmTemplates:
Expand Down