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

Features/issue24 turning on iam role cannot be disabled #28

Conversation

haimizrael
Copy link
Contributor

This PR is for Issue #24. Note this is a breaking change for the use of environment variable AWS_USE_IAM_ROLE to turn on the use of IAM role. The value of the variable now has to be a valid Boolean truthful value ('True', 'On', or 'Yes') for the use of IAM role to be enabled. A value of 'False','Off', or 'No' will disable the use of IAM role, which can be a requirement for certain agents that are either not in AWS or for whatever reason do not have the appropriate role and you have to use access keys instead.

We've also added unit tests to cover this usage (and the use of AWS_USE_IAM_ROLE variable in general). To enable executing of such tests in our environment, we've also mocked out the system environment variables in tests by parameterizing the environment hashmap in GoEnvironment.java (originally it was hard-coded to System.getenv(), so system environment variables could be polluting the tests).

Finally, the build.bat file was added to support CI in a Windows environment.

@@ -72,4 +72,7 @@ public AmazonS3Client s3Client(FetchConfig config) {
return client;
}

public FetchConfig getFetchConfig(TaskConfig config, TaskExecutionContext context) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have getFetchConfig which doesn't seem to be doing anything as a separate function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is used in one place - FetchExecutor.java:84. The reason that was needed is to mock out system environment variables in GoEnvironment (otherwise environment variable on the build server end up in your test and one may get inconsistent results from test to test).

@ashwanthkumar
Copy link
Member

@manojlds Can you please help review the build.bat? Rest LGTM, except for minor comments here and there.

public FetchConfig(TaskConfig config, TaskExecutionContext context) {
this.env = new GoEnvironment();
public FetchConfig(TaskConfig config, TaskExecutionContext context)
{
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick - Can we please push this { to previous line? 😄

Remove redundant tests in GoEnvironmentTest
Fix formatting of brace in FetchConfig.java
@haimizrael
Copy link
Contributor Author

@manojlds @ashwanthkumar
The original PR was submitted when Java source was still 1.6, but that was since changed to 1.7 with commit fbfd1aa, which seems to be the cause for the build check to fail. Not sure what's the best way to proceed. Should I close this and create a new PR, or is there another way to resolve?

Thanks

@ashwanthkumar
Copy link
Member

@haimizrael I changed our CI's configuration for this PR. It's all green now :)

@haimizrael
Copy link
Contributor Author

@ashwanthkumar Thank you!

@haimizrael
Copy link
Contributor Author

@ashwanthkumar do you guys need me to do anything else on this PR?

@ashwanthkumar
Copy link
Member

LGTM 👍

Approved with PullApprove

1 similar comment
@brewkode
Copy link
Contributor

LGTM 👍

Approved with PullApprove

@ashwanthkumar
Copy link
Member

Merging this.

ashwanthkumar added a commit that referenced this pull request Mar 9, 2016
…MRoleCannotBeDisabled

Features/issue24 turning on iam role cannot be disabled
@ashwanthkumar ashwanthkumar merged commit b5db401 into indix:master Mar 9, 2016
@ashwanthkumar
Copy link
Member

Thanks @haimizrael.

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

Successfully merging this pull request may close these issues.

4 participants