-
Notifications
You must be signed in to change notification settings - Fork 203
gogit: Add new ForceGoGitImplementation FeatureGate #945
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
Conversation
if enabled, _ := r.features[features.ForceGoGitImplementation]; enabled { | ||
gitImplementation = sourcev1.GoGitImplementation | ||
} |
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.
As this is done multiple times, I am wondering if it might be better to factor this out into a helper function which takes the object and string map and returns the correct implementation?
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.
@darkowlzz gave a similar feedback on this and suggested the output of the feature gate to be passed as parameter to gitCheckout
, which aligns with the current implementation for optimized clones. PTAL
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
ForceGoGitImplementation ignores the value set for gitImplementation and ensures that go-git is used for all GitRepository objects. This can be used to confirm that Flux instances won't break if/when the libgit2 implementation was to be deprecated. When enabled, libgit2 won't be initialized, nor will any git2go cgo code be called. Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
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!
ForceGoGitImplementation
ignores the value set forgitImplementation
and ensures that go-git is used for allGitRepository
objects. When enabled, libgit2 won't be initialized, nor will any git2go cgo code be called.This is a soft-decommissioning of
libgit2
, to confirm that Flux instances won't break when that implementation is deprecated.