Skip to content

Commit

Permalink
rename cloudName to name
Browse files Browse the repository at this point in the history
  • Loading branch information
car-roll committed Sep 13, 2023
1 parent bd26db0 commit 601e0a3
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def slaveTemplateUsEast1Parameters = [
]
def AmazonEC2CloudParameters = [
cloudName: 'MyCompany',
name: 'MyCompany',
credentialsId: 'jenkins-aws-key',
instanceCapStr: '2',
privateKey: '''-----BEGIN RSA PRIVATE KEY-----
Expand Down Expand Up @@ -453,7 +453,7 @@ SlaveTemplate slaveTemplateUsEast1 = new SlaveTemplate(
// https://javadoc.jenkins.io/plugin/ec2/index.html?hudson/plugins/ec2/AmazonEC2Cloud.html
AmazonEC2Cloud amazonEC2Cloud = new AmazonEC2Cloud(
AmazonEC2CloudParameters.cloudName,
AmazonEC2CloudParameters.name,
AmazonEC2CloudParameters.useInstanceProfileForCredentials,
AmazonEC2CloudParameters.credentialsId,
AmazonEC2CloudParameters.region,
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/hudson/plugins/ec2/AmazonEC2Cloud.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ public class AmazonEC2Cloud extends EC2Cloud {
private boolean noDelayProvisioning;

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:c="/lib/credentials">
<f:entry title="${%Name}" field="cloudName">
<f:entry title="${%Name}" field="name">
<f:textbox />
</f:entry>
<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...)">
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/hudson/plugins/ec2/AmazonEC2CloudTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void setUp() throws Exception {
@Test
public void testConfigRoundtrip() throws Exception {
r.submit(getConfigForm());
r.assertEqualBeans(cloud, r.jenkins.clouds.get(AmazonEC2Cloud.class), "cloudName,region,useInstanceProfileForCredentials,privateKey,instanceCap,roleArn,roleSessionName");
r.assertEqualBeans(cloud, r.jenkins.clouds.get(AmazonEC2Cloud.class), "name,region,useInstanceProfileForCredentials,privateKey,instanceCap,roleArn,roleSessionName");
}

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

@Test
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/hudson/plugins/ec2/Ami.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ configuration-as-code:
jenkins:
clouds:
- amazonEC2:
cloudName: "test"
name: "test"
privateKey: "${PRIVATE_KEY}"
templates:
- ami: ami-0123456789abcdefg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ configuration-as-code:
jenkins:
clouds:
- amazonEC2:
cloudName: "us-east-1"
name: "us-east-1"
privateKey: "${PRIVATE_KEY}"
templates:
- associatePublicIp: false
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/hudson/plugins/ec2/EC2CloudEmpty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
jenkins:
clouds:
- amazonEC2:
cloudName: "empty"
name: "empty"
privateKey: "${PRIVATE_KEY}"
2 changes: 1 addition & 1 deletion src/test/resources/hudson/plugins/ec2/Mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
jenkins:
clouds:
- amazonEC2:
cloudName: "staging"
name: "staging"
useInstanceProfileForCredentials: true
privateKey: "${PRIVATE_KEY}"
templates:
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/hudson/plugins/ec2/MacData.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
jenkins:
clouds:
- amazonEC2:
cloudName: "production"
name: "production"
useInstanceProfileForCredentials: true
sshKeysCredentialsId: "random credentials id"
templates:
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/hudson/plugins/ec2/MacDataExport.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- amazonEC2:
cloudName: "production"
name: "production"
region: "us-east-1"
sshKeysCredentialsId: "random credentials id"
templates:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
jenkins:
clouds:
- amazonEC2:
cloudName: "timed"
name: "timed"
useInstanceProfileForCredentials: true
sshKeysCredentialsId: "random credentials id"
templates:
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/hudson/plugins/ec2/Unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
jenkins:
clouds:
- amazonEC2:
cloudName: "staging"
name: "staging"
useInstanceProfileForCredentials: true
privateKey: "${PRIVATE_KEY}"
templates:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jenkins:
clouds:
- amazonEC2:
altEC2Endpoint: "https.//ec2.us-east-1.amazonaws.com"
cloudName: "production"
name: "production"
region: "eu-central-1"
useInstanceProfileForCredentials: true
sshKeysCredentialsId: "random credentials id"
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/hudson/plugins/ec2/UnixData.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
jenkins:
clouds:
- amazonEC2:
cloudName: "production"
name: "production"
useInstanceProfileForCredentials: true
sshKeysCredentialsId: "random credentials id"
templates:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- amazonEC2:
altEC2Endpoint: "https.//ec2.us-east-1.amazonaws.com"
cloudName: "production"
name: "production"
region: "eu-central-1"
sshKeysCredentialsId: "random credentials id"
templates:
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/hudson/plugins/ec2/UnixDataExport.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- amazonEC2:
cloudName: "production"
name: "production"
region: "us-east-1"
sshKeysCredentialsId: "random credentials id"
templates:
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/hudson/plugins/ec2/WindowsData.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
jenkins:
clouds:
- amazonEC2:
cloudName: "development"
name: "development"
useInstanceProfileForCredentials: true
privateKey: "${PRIVATE_KEY}"
templates:
Expand Down

0 comments on commit 601e0a3

Please sign in to comment.