-
Notifications
You must be signed in to change notification settings - Fork 113
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
Introduce Git step command #751
Introduce Git step command #751
Conversation
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.
Which make
target can be used to build the image?
isSSHGitURL := sshGitURLRegEx.MatchString(flagValues.url) | ||
switch { | ||
case hasPrivateKey && !isSSHGitURL: | ||
return typeUndef, &ExitError{Code: 110, Message: "Credential/URL inconsistency: SSH credentials provided, but URL is not a SSH Git URL"} |
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.
This is different to the current behavior where there is "only" a warning. Our current e2e tests - when running with private repo support - also adds the credential to all Builds ignoring if it is to test a private repo or not if I remember correctly. On the other hand, it is not a bad idea to do this.
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.
Maybe we can have a call about this. I took the liberty to change the behavior a bit and that we then can discuss the pros and cons.
Related to #696 |
Is coming up next. I wanted to code to be out already for some feedback. |
There's a huge amount of overlap here with what we've done in OpenShift builds. We have a lot of battle-tested code to manage the cloning of git source. It is currently spread across several repos - I can do a deep dive to see where these bits are and if they can be repackaged for Shipwright. |
We eventually decided against a Makefile target as ideally it will be magically done by the build through a |
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.
From my quick overview today, it looks good 👍🏾. I would like to go over the credentials part tomorrow. Leaving you some open q´s from my side for now.
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 tested the different auth methods locally. All of the seems to be running smoothly, pretty nice behaviour, thanks for this!
In order to replace Tekton Git resource, a replacement container image is required that performs a Git clone. Add Git step command which wraps `git` CLI to clone user repositories with different authentication options.
Since the key provided via a secret can have undesirable file permissions, it will end up failing due to SSH sanity checks. Create temporary SSH private key using `0400` file permissions.
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.
/lgtm
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: SaschaSchwarze0 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
In order to replace Tekton Git resource, a replacement container image
is required that performs a Git clone.
Add Git step command which wraps
git
CLI to clone user repositorieswith different authentication options.
Submitter Checklist
See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.
Release Notes