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-60482 Alternate Endpoint fix #439

Closed

Conversation

troymohl
Copy link

@troymohl troymohl commented Mar 9, 2020

This fixes a bug in the EC2 Alternate URL endpoint configuration reported in https://issues.jenkins-ci.org/browse/JENKINS-60482. Additionally, small bug fix to fix cases if an empty endpoint got passed to the AmazonEC2 client initialization.

This PR has #438 as a parent, as my configuration required that fix to be in place in order to make this fix.
This has been fixed in master, so that PR was no longer needed.

@five-iron
Copy link

Any update on this PR? This is a nice QOL fix. Looks like it's just pending review from @res0nance.

@@ -65,6 +60,8 @@
*/
private String region;

private String altEC2Endpoint;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the endpoint not required for the AmazonEC2 Client object? I don't see it specified for the object used when spinning up instances etc.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't change any of the existing code that checks for endpoint. I will look at switching the getEc2EndpointUrl logic to better handle where it's directly set and not use the region if the endpoint URL is configured. I think I did see a ticket where the region -> endpoint logic didn't work in C2S, but I won't have the ability to fully test that.

AmazonEC2 client = new AmazonEC2Client(credentialsProvider, EC2Cloud.createClientConfiguration(ec2Endpoint.getHost()));
client.setEndpoint(ec2Endpoint.toString());
return client;
if (ec2Endpoint != null && ec2Endpoint.toString().trim().length() > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method should be annotated with CheckForNull

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added annotation

@jkfernan
Copy link

jkfernan commented May 20, 2020

Any update on this PR? @res0nance Can this be merged?

@troymohl troymohl force-pushed the JENKINS-60482-alt-endpoint branch from 556fb89 to 7460bfd Compare May 21, 2020 14:23
@troymohl
Copy link
Author

Update this PR to use the Alternate EC2 Endpoint if configured. I believe this change would also fix using in C2S where the endpoint is not easily derived from the region. I am unable to test this though.

@GaToRAiD
Copy link

What is the status of this PR? It is quite a pain going into the configuration settings.

@GaToRAiD
Copy link

@troymohl what is the status on this?

@troymohl
Copy link
Author

@GaToRAiD
I have tested this on instances that I have access to, as well as rebasing against the master branch. I'm just an outside contributor that needed this bug fixed and wanted to contribute this back for others. I don't have any additional info on when/if this will be accepted into the main baseline.

@jkfernan
Copy link

jkfernan commented Jun 4, 2020

@res0nance Can we get a code review on this? It would be great to get it merged. Thanks.

@alecharp
Copy link
Member

@troymohl can you have a look at the merge conflict? Thanks.

@GaToRAiD
Copy link

GaToRAiD commented Aug 24, 2020

Disregard, looks like it was already fixed in master.

@rsandell
Copy link
Member

@res0nance @MRamonLeon I am confused about the status of this? @GaToRAiD mentions that it is already fixed in master, but I can't see the ticket mentioned in any release notes and I have users reporting it still being an issue?

@MRamonLeon
Copy link
Contributor

MRamonLeon commented Oct 1, 2020

@res0nance @MRamonLeon I am confused about the status of this? @GaToRAiD mentions that it is already fixed in master, but I can't see the ticket mentioned in any release notes and I have users reporting it still being an issue?

Maybe because of that @rsandell: #330 Did you mean this @GaToRAiD?

@MRamonLeon
Copy link
Contributor

Disregard, looks like it was already fixed in master.

Could you tell us where it was fixed please @GaToRAiD? Thanks

@mrmateo
Copy link

mrmateo commented Oct 28, 2020

@MRamonLeon / @rsandell - I think @GaToRAiD might have been referring to an edit in the original comment on this PR from @troymohl :

This has been fixed in master, so that PR was no longer needed.

If so, his comment there was only referring to a prerequisite fix that was needed for this and not the actual issue that this PR fixes. That prerequisite fix was merged and is in master.

@rsandell / @alecharp / @res0nance - Can one of you please take another look and either approve or deny this? It is impacting many users of this plugin so would be good to know if we can count on this fix being made soon or if we need to find other solutions.

Thanks!

@res0nance
Copy link
Contributor

@mrmateo This is unfortunately impossible to review due to the conflicts

@troymohl
Copy link
Author

troymohl commented Nov 9, 2020

I have rebased this against the latest master.

@batmat
Copy link
Member

batmat commented Nov 20, 2020

@mrmateo please do not hesitate to help review this, we welcome any help! :-)

Copy link
Contributor

@MRamonLeon MRamonLeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking into it, please don't merge yet (despite the conflicts)

@MRamonLeon
Copy link
Contributor

MRamonLeon commented Nov 23, 2020

@troymohl I've fixed the conflicts with master, but after reviewing the PR, I find we maybe go too far and an simpler approach can be used, if I understood your problem from your description in the Jira ticket. I've filed #537 with this approach where we just ensure the Alternate EC2 endpoint is persisted.

I've recorded a video to show how the behavior is, just in case you or someone else have some confusion about how the configuration page works (it's deserving a good refactoring, let's be honest 😉 )

Let me know if this approach fits your needs.

cc: @jkfernan @GaToRAiD

@troymohl
Copy link
Author

@MRamonLeon This actually started with a similar change: d200d11

Based on: #439 (comment) I made the additional changes. I'm good with whatever the team decides. We can close this PR if the approach in #537 is preferred.

@MRamonLeon
Copy link
Contributor

@MRamonLeon This actually started with a similar change: d200d11

Based on: #439 (comment) I made the additional changes. I'm good with whatever the team decides. We can close this PR if the approach in #537 is preferred.

@troymohl I'm happy merging this PR instead of mine if you come back to your original commit, d200d11

@MRamonLeon
Copy link
Contributor

#537 merged. Closing this one.

@MRamonLeon MRamonLeon closed this Nov 24, 2020
@MRamonLeon
Copy link
Contributor

@troymohl thank you for filing this PR and leveraging the fix of this issue. I look forward to seeing more contributions from you. 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
10 participants