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

Feature/set environment variable for cred helper #3093

Conversation

vinod-tahelyani
Copy link
Contributor

Fixes #2814

@google-cla google-cla bot added the cla: yes label Feb 27, 2021
Copy link
Member

@chanseokoh chanseokoh left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

I have some high-level comments. And be sure to run ./gradlew googleJavaFormat (or simply, ./gradlew goJF) to auto-format the code.

@@ -225,4 +221,22 @@ public Path getImageJsonOutputPath() {
public List<? extends PlatformConfiguration> getPlatforms() {
return jibExtension.getFrom().getPlatforms().get();
}

@Override
public Map<String, String> getFromEnvironment() {
Copy link
Member

Choose a reason for hiding this comment

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

getFromCredHelperEnvironment

Comment on lines +101 to +110
@Input
@Nullable
@Optional
public Map<String, String> getEnvironment() {
return environment;
}

public void setEnvironment(Map<String, String> environment) {
this.environment = environment;
}
Copy link
Member

Choose a reason for hiding this comment

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

The way we want is to set this through jib.from.credHelper.environment as I showed in #2814 (comment), not through jib.from.environment as you did here.

An important thing is to maintain backward compatibility. That is, all of these should work:

jib.from {
    image = ...
    credHelper = 'ecr-login`
}
jib.from {
    image = ...
    credHelper.helper = 'ecr-login'
}
jib.from {
    image = ...
    credHelper {
        helper = 'ecr-login'
        environment = ...
    }
}

Comment on lines +120 to +129
@Input
@Nullable
@Optional
public Map<String, String> getEnvironment() {
return environment;
}

public void setEnvironment(Map<String, String> environment) {
this.environment = environment;
}
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@chanseokoh
Copy link
Member

@vinod-tahelyani just checking in, do you still plan to complete this PR?

@chanseokoh
Copy link
Member

Closing (#2814 (comment)).

@chanseokoh chanseokoh closed this Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set environment variables for credHelper
2 participants