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: add support for git sources #5438

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

danishprakash
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

adds support for git sources with the ADD directive

How to verify it

Which issue(s) this PR fixes:

Fixes #4974

Special notes for your reviewer:

Does this PR introduce a user-facing change?

adds support for git sources with the ADD directive

Copy link
Contributor

openshift-ci bot commented Mar 27, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: danishprakash
Once this PR has been reviewed and has the lgtm label, please assign lsm5 for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@danishprakash danishprakash force-pushed the add-git-ref branch 4 times, most recently from 3a3abfc to 3d0f34a Compare April 5, 2024 07:15
Signed-off-by: danishprakash <danish.prakash@suse.com>
@danishprakash danishprakash force-pushed the add-git-ref branch 2 times, most recently from aba9551 to 3a83d68 Compare April 22, 2024 14:24
Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

@danishprakash danishprakash force-pushed the add-git-ref branch 2 times, most recently from 1236851 to da7f372 Compare April 23, 2024 07:53
Signed-off-by: danishprakash <danish.prakash@suse.com>
@TomSweeneyRedHat
Copy link
Member

Quick fly by review looks OK to me, but you have test issues and a rebase is needed.

@danishprakash
Copy link
Contributor Author

Quick fly by review looks OK to me, but you have test issues and a rebase is needed.

You meant packit issues? Because tests seems to be fine afaict

// github.com/containers/buildah.git
// github.com/containers/buildah.git#main
// github.com/containers/buildah.git#v1.35.0
var gitURLFragmentSuffix = regexp.MustCompile(`\.git(?:#.+)?$`)
Copy link
Member

Choose a reason for hiding this comment

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

Not sure this is necessary, and MustCompile on init variables slows things down on startup.

Copy link
Member

Choose a reason for hiding this comment

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

can we use Delayed() from the containers/storage/pkg/regexp package?

@rhatdan
Copy link
Member

rhatdan commented May 13, 2024

LGTM other then remove the MustCompile.

@flouthoc @nalind @giuseppe PTAL

}
getErr = copier.Get(cloneDir, cloneDir, getOptions, []string{"."}, writer)
closeErr = writer.Close()
if renameTarget != "" && renamedItems > 1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Line 456:

renamedItems := 0

Line 476:

if renameTarget != "" && renamedItems > 1 {

Is renamedItems == 0 when evaluating the if statment in line 476? (It doesn't look like anything is modifying renamedItems)

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.

Support for ADD <git ref> in Containerfile
5 participants