-
Notifications
You must be signed in to change notification settings - Fork 187
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 support for checking out to Git refs #1026
Conversation
// Name of the reference to check out; takes precedence over Branch, Tag and SemVer. | ||
// | ||
// It must be a valid Git reference: https://git-scm.com/docs/git-check-ref-format#_description | ||
// Examples: "refs/heads/main", "refs/tags/v0.1.0", "refs/pull/420/head", "refs/merge-requests/1/head" |
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.
Let's add here a kubebuilder regex that matches refs/<any>/<any>
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.
The validation is much more complex than just refs/...
: https://git-scm.com/docs/git-check-ref-format#_description
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 would rather just let the Git implementation figure out if the arbitrary reference is correct.
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.
we include the ref name in the error message: https://github.com/fluxcd/pkg/blob/main/git/gogit/clone.go#L372 and we have some basic validation: https://github.com/fluxcd/pkg/blob/main/git/gogit/clone.go#L402-L404. given these, i don't think we have a pressing need to validate the ref name at the API level
Artifact description when we specify
vs when we specify
|
I think we should use the ref name in the |
Think while we initially discussed this, we opted not to? Changing this would require changing |
7299ad7
to
146262f
Compare
Add a new field `.spec.ref.name` which points to a Git reference which enables checking out to a particular commit pointed to by the specified reference. Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
146262f
to
c3511cc
Compare
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.
Absolutely splendid @aryan9600, minimal change that opens up the world and brings our support for (automating) things up to a next level. 🥇
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
Thanks @aryan9600 🏅
Add a new field
.spec.ref.name
which points to a Git reference which enables checking out to a particular commit pointed to by the specified reference.Fixes: #1017