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

Docker logins don't work on forks #338

Closed
2 tasks
dikhan opened this issue Apr 9, 2022 · 0 comments · Fixed by #337 or #339
Closed
2 tasks

Docker logins don't work on forks #338

dikhan opened this issue Apr 9, 2022 · 0 comments · Fixed by #337 or #339

Comments

@dikhan
Copy link
Owner

dikhan commented Apr 9, 2022

Describe the bug

Due to how Travis exposes secrets to builds and these not being available on forks the docker login command perform before executing the integration tests fails due to the following error:

[INFO] Logging into Docker Hub Enabled=true
echo  | docker login -u  --password-stdin
Error: Cannot perform an interactive login from a non TTY device
make: *** [dockerhub-login] Error 1

This works if the build is triggered by the repo maintainer as Travis CI trusts the source, however forks don't have the secrets available to them and this is causing all the PRs opened from forks to fail.

The reason why the docker login was added in the first place was to avoid getting quota rate limits from docker when pulling images and this does work for PRs opened by the repo maintainers but not for forks. Unfortunately, Travis CI does not provide a solution for the aforementioned issue and the preferable solution until a solution is available is to not perform the docker login. This means that PRs from forks will rely on whether the rate limit has already been reached or not but that is preferable over always failing.

Screenshot from Travis CI stating that secrets are not avail in forks:

Screen Shot 2022-04-09 at 4 28 27 PM

Source: https://docs.travis-ci.com/user/environment-variables/

Increase limits from docker: https://www.docker.com/increase-rate-limits/

To Reproduce

A clear and concise description on how does it work now and what's the current behaviour.

Steps to reproduce the behavior:

  1. Fork the repo
  2. Create a PR
  3. The build will fail due to the following error:
[INFO] Logging into Docker Hub Enabled=true
echo  | docker login -u  --password-stdin
Error: Cannot perform an interactive login from a non TTY device
make: *** [dockerhub-login] Error 1
The command "make test-all" exited with 2.

Example build failing from a fork: https://app.travis-ci.com/github/dikhan/terraform-provider-openapi/builds/249184166

Expected behaviour

Builds should work regardless of whether the build is trigger from maintainers or external contributors. Due to Travis CI limitations though this is not possible at the moment and might need to consider other CI services.

Additional context

Add any other context about the problem here.

Checklist (for admin only)

Don't forget to go through the checklist to make sure the issue is created properly:

  • I have added a corresponding label (bug) to the issue (right side menu)
  • I have added this issue to the 'API Terraform Provider' GitHub project (right side menu)
dikhan added a commit that referenced this issue Apr 10, 2022
[BugFix: Issue #338] Skip docker login from forks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant