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

Add username/password parameter for Docker Registry authentication #246

Merged
merged 15 commits into from
Jul 7, 2021

Conversation

olblak
Copy link
Member

@olblak olblak commented Jul 3, 2021

Fix #245

For some reason, the previous authentication mechanism using Token doesn't work anymore and changing to bearer like other registry works

This pull request refactor docker registry authentication, we should now specific a username and password parameter when we need to authenticate with a docker registry such as

dockerImage:
    kind: dockerImage
    postfix: "-jdk11"
    spec:
        image: jenkins/jenkins
        username: bob
        password: xxx

Remark
Credentials required for the new test are not available from Github Action triggered by pull request from fork repository so I am introducing short test and long test to only execute short tests in such cases

Signed-off-by: Olivier Vernin olivier@vernin.me

Signed-off-by: Olivier Vernin <olivier@vernin.me>
@olblak olblak added the bug Something isn't working label Jul 3, 2021
@olblak
Copy link
Member Author

olblak commented Jul 4, 2021

GITHUB_TOKEN doesn't work with bearer token which is a serious regression, I need to investigate other options

Signed-off-by: Olivier Vernin <olivier@vernin.me>
Signed-off-by: Olivier Vernin <olivier@vernin.me>
Improve validation function

Signed-off-by: Olivier Vernin <olivier@vernin.me>
Improve validation function

Signed-off-by: Olivier Vernin <olivier@vernin.me>
Correctly return when needed

Signed-off-by: Olivier Vernin <olivier@vernin.me>
Signed-off-by: Olivier Vernin <olivier@vernin.me>
Signed-off-by: Olivier Vernin <olivier@vernin.me>
Signed-off-by: Olivier Vernin <olivier@vernin.me>
@olblak olblak changed the title Switch ghcr.io auth from token to bearer Fix Docker Registry authentication Jul 6, 2021
Signed-off-by: Olivier Vernin <olivier@vernin.me>
@olblak
Copy link
Member Author

olblak commented Jul 7, 2021

It seems that secrets are not available from the runner

Run quick test in pull request

Signed-off-by: Olivier Vernin <olivier@vernin.me>
Signed-off-by: Olivier Vernin <olivier@vernin.me>
Signed-off-by: Olivier Vernin <olivier@vernin.me>
@olblak olblak changed the title Fix Docker Registry authentication Add username/password parameter for Docker Registry authentication Jul 7, 2021
@olblak olblak added the enhancement New feature or request label Jul 7, 2021
@olblak
Copy link
Member Author

olblak commented Jul 7, 2021

Credentials required for the test are not available from github action running for pull request so I am introduce short test and long test to only execute short tests from PR runner

@olblak
Copy link
Member Author

olblak commented Jul 7, 2021

@olblak olblak merged commit 0ee6c9c into updatecli:main Jul 7, 2021
@olblak olblak removed the bug Something isn't working label Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unauthorized ghcr.io access
1 participant