-
Notifications
You must be signed in to change notification settings - Fork 696
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
Conversation
57ed44e
to
8cb7ad2
Compare
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added annotation
Any update on this PR? @res0nance Can this be merged? |
556fb89
to
7460bfd
Compare
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. |
What is the status of this PR? It is quite a pain going into the configuration settings. |
@troymohl what is the status on this? |
@GaToRAiD |
@res0nance Can we get a code review on this? It would be great to get it merged. Thanks. |
@troymohl can you have a look at the merge conflict? Thanks. |
7460bfd
to
5a996b8
Compare
Disregard, looks like it was already fixed in master. |
@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? |
Could you tell us where it was fixed please @GaToRAiD? Thanks |
@MRamonLeon / @rsandell - I think @GaToRAiD might have been referring to an edit in the original comment on this PR from @troymohl :
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! |
@mrmateo This is unfortunately impossible to review due to the conflicts |
5a996b8
to
3af4126
Compare
I have rebased this against the latest master. |
@mrmateo please do not hesitate to help review this, we welcome any help! :-) |
There was a problem hiding this 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)
…-60482-alt-endpoint
@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. |
@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 |
#537 merged. Closing this one. |
@troymohl thank you for filing this PR and leveraging the fix of this issue. I look forward to seeing more contributions from you. 👏 |
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.