Skip to content

Commit 6d7bfc5

Browse files
authored
Merge pull request #892 from car-roll/remove-cloudname
[JENKINS-71737] rename cloudName to name
2 parents bd26db0 + c79f38e commit 6d7bfc5

18 files changed

+23
-22
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def slaveTemplateUsEast1Parameters = [
353353
]
354354
355355
def AmazonEC2CloudParameters = [
356-
cloudName: 'MyCompany',
356+
name: 'MyCompany',
357357
credentialsId: 'jenkins-aws-key',
358358
instanceCapStr: '2',
359359
privateKey: '''-----BEGIN RSA PRIVATE KEY-----
@@ -453,7 +453,7 @@ SlaveTemplate slaveTemplateUsEast1 = new SlaveTemplate(
453453
454454
// https://javadoc.jenkins.io/plugin/ec2/index.html?hudson/plugins/ec2/AmazonEC2Cloud.html
455455
AmazonEC2Cloud amazonEC2Cloud = new AmazonEC2Cloud(
456-
AmazonEC2CloudParameters.cloudName,
456+
AmazonEC2CloudParameters.name,
457457
AmazonEC2CloudParameters.useInstanceProfileForCredentials,
458458
AmazonEC2CloudParameters.credentialsId,
459459
AmazonEC2CloudParameters.region,

pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ THE SOFTWARE.
7979
<changelist>999999-SNAPSHOT</changelist>
8080
<jenkins.version>2.414</jenkins.version>
8181
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
82+
<hpi.compatibleSinceVersion>1626</hpi.compatibleSinceVersion>
8283
</properties>
8384

8485
<dependencies>

src/main/java/hudson/plugins/ec2/AmazonEC2Cloud.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ public class AmazonEC2Cloud extends EC2Cloud {
7474
private boolean noDelayProvisioning;
7575

7676
@DataBoundConstructor
77-
public AmazonEC2Cloud(String cloudName, boolean useInstanceProfileForCredentials, String credentialsId, String region, String privateKey, String sshKeysCredentialsId, String instanceCapStr, List<? extends SlaveTemplate> templates, String roleArn, String roleSessionName) {
78-
super(cloudName, useInstanceProfileForCredentials, credentialsId, privateKey, sshKeysCredentialsId, instanceCapStr, templates, roleArn, roleSessionName);
77+
public AmazonEC2Cloud(String name, boolean useInstanceProfileForCredentials, String credentialsId, String region, String privateKey, String sshKeysCredentialsId, String instanceCapStr, List<? extends SlaveTemplate> templates, String roleArn, String roleSessionName) {
78+
super(name, useInstanceProfileForCredentials, credentialsId, privateKey, sshKeysCredentialsId, instanceCapStr, templates, roleArn, roleSessionName);
7979
this.region = region;
8080
}
8181

8282
@Deprecated
83-
public AmazonEC2Cloud(String cloudName, boolean useInstanceProfileForCredentials, String credentialsId, String region, String privateKey, String instanceCapStr, List<? extends SlaveTemplate> templates, String roleArn, String roleSessionName) {
84-
super(cloudName, useInstanceProfileForCredentials, credentialsId, privateKey, instanceCapStr, templates, roleArn, roleSessionName);
83+
public AmazonEC2Cloud(String name, boolean useInstanceProfileForCredentials, String credentialsId, String region, String privateKey, String instanceCapStr, List<? extends SlaveTemplate> templates, String roleArn, String roleSessionName) {
84+
super(name, useInstanceProfileForCredentials, credentialsId, privateKey, instanceCapStr, templates, roleArn, roleSessionName);
8585
this.region = region;
8686
}
8787

src/main/resources/hudson/plugins/ec2/AmazonEC2Cloud/config-entries.jelly

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ THE SOFTWARE.
1919
-->
2020
<?jelly escape-by-default='true'?>
2121
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:c="/lib/credentials">
22-
<f:entry title="${%Name}" field="cloudName">
22+
<f:entry title="${%Name}" field="name">
2323
<f:textbox />
2424
</f:entry>
2525
<f:entry field="credentialsId" title="${%Amazon EC2 Credentials}" description="AWS IAM Access Key used to connect to EC2. If not specified, implicit authentication mechanisms are used (IAM roles...)">

src/test/java/hudson/plugins/ec2/AmazonEC2CloudTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void setUp() throws Exception {
7474
@Test
7575
public void testConfigRoundtrip() throws Exception {
7676
r.submit(getConfigForm());
77-
r.assertEqualBeans(cloud, r.jenkins.clouds.get(AmazonEC2Cloud.class), "cloudName,region,useInstanceProfileForCredentials,privateKey,instanceCap,roleArn,roleSessionName");
77+
r.assertEqualBeans(cloud, r.jenkins.clouds.get(AmazonEC2Cloud.class), "name,region,useInstanceProfileForCredentials,privateKey,instanceCap,roleArn,roleSessionName");
7878
}
7979

8080
@Test
@@ -94,7 +94,7 @@ public void testSshKeysCredentialsIdRemainsUnchangedAfterUpdatingOtherFields() t
9494
r.submit(form);
9595
AmazonEC2Cloud actual = r.jenkins.clouds.get(AmazonEC2Cloud.class);
9696
assertEquals("updatedSessionName", actual.getRoleSessionName());
97-
r.assertEqualBeans(cloud, actual, "cloudName,region,useInstanceProfileForCredentials,sshKeysCredentialsId,instanceCap,roleArn");
97+
r.assertEqualBeans(cloud, actual, "name,region,useInstanceProfileForCredentials,sshKeysCredentialsId,instanceCap,roleArn");
9898
}
9999

100100
@Test

src/test/resources/hudson/plugins/ec2/Ami.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ configuration-as-code:
44
jenkins:
55
clouds:
66
- amazonEC2:
7-
cloudName: "test"
7+
name: "test"
88
privateKey: "${PRIVATE_KEY}"
99
templates:
1010
- ami: ami-0123456789abcdefg

src/test/resources/hudson/plugins/ec2/BackwardsCompatibleConnectionStrategy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ configuration-as-code:
44
jenkins:
55
clouds:
66
- amazonEC2:
7-
cloudName: "us-east-1"
7+
name: "us-east-1"
88
privateKey: "${PRIVATE_KEY}"
99
templates:
1010
- associatePublicIp: false

src/test/resources/hudson/plugins/ec2/EC2CloudEmpty.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
jenkins:
33
clouds:
44
- amazonEC2:
5-
cloudName: "empty"
5+
name: "empty"
66
privateKey: "${PRIVATE_KEY}"

src/test/resources/hudson/plugins/ec2/Mac.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
jenkins:
33
clouds:
44
- amazonEC2:
5-
cloudName: "staging"
5+
name: "staging"
66
useInstanceProfileForCredentials: true
77
privateKey: "${PRIVATE_KEY}"
88
templates:

src/test/resources/hudson/plugins/ec2/MacData.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
jenkins:
33
clouds:
44
- amazonEC2:
5-
cloudName: "production"
5+
name: "production"
66
useInstanceProfileForCredentials: true
77
sshKeysCredentialsId: "random credentials id"
88
templates:

src/test/resources/hudson/plugins/ec2/MacDataExport.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
- amazonEC2:
2-
cloudName: "production"
2+
name: "production"
33
region: "us-east-1"
44
sshKeysCredentialsId: "random credentials id"
55
templates:

src/test/resources/hudson/plugins/ec2/Unix-withMinimumInstancesTimeRange.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
jenkins:
33
clouds:
44
- amazonEC2:
5-
cloudName: "timed"
5+
name: "timed"
66
useInstanceProfileForCredentials: true
77
sshKeysCredentialsId: "random credentials id"
88
templates:

src/test/resources/hudson/plugins/ec2/Unix.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
jenkins:
33
clouds:
44
- amazonEC2:
5-
cloudName: "staging"
5+
name: "staging"
66
useInstanceProfileForCredentials: true
77
privateKey: "${PRIVATE_KEY}"
88
templates:

src/test/resources/hudson/plugins/ec2/UnixData-withAltEndpointAndJavaPath.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ jenkins:
33
clouds:
44
- amazonEC2:
55
altEC2Endpoint: "https.//ec2.us-east-1.amazonaws.com"
6-
cloudName: "production"
6+
name: "production"
77
region: "eu-central-1"
88
useInstanceProfileForCredentials: true
99
sshKeysCredentialsId: "random credentials id"

src/test/resources/hudson/plugins/ec2/UnixData.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
jenkins:
33
clouds:
44
- amazonEC2:
5-
cloudName: "production"
5+
name: "production"
66
useInstanceProfileForCredentials: true
77
sshKeysCredentialsId: "random credentials id"
88
templates:

src/test/resources/hudson/plugins/ec2/UnixDataExport-withAltEndpointAndJavaPath.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- amazonEC2:
22
altEC2Endpoint: "https.//ec2.us-east-1.amazonaws.com"
3-
cloudName: "production"
3+
name: "production"
44
region: "eu-central-1"
55
sshKeysCredentialsId: "random credentials id"
66
templates:

src/test/resources/hudson/plugins/ec2/UnixDataExport.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
- amazonEC2:
2-
cloudName: "production"
2+
name: "production"
33
region: "us-east-1"
44
sshKeysCredentialsId: "random credentials id"
55
templates:

src/test/resources/hudson/plugins/ec2/WindowsData.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
jenkins:
33
clouds:
44
- amazonEC2:
5-
cloudName: "development"
5+
name: "development"
66
useInstanceProfileForCredentials: true
77
privateKey: "${PRIVATE_KEY}"
88
templates:

0 commit comments

Comments
 (0)