nephio-project / nephio

Nephio is a Kubernetes-based automation platform for deploying and managing highly distributed, interconnected workloads such as 5G Network Functions, and the underlying infrastructure on which those workloads depend.
Apache License 2.0
93 stars 52 forks source link

Support using Gerrit as git repo with Porch #718

Open liamfallon opened 3 months ago

liamfallon commented 3 months ago

Original issue URL: https://github.com/kptdev/kpt/issues/3662 Original issue user: https://github.com/mortent Original issue created at: 2022-11-16T05:17:58Z Original issue last updated at: 2023-01-26T04:21:41Z Original issue body: We already have support for github and CSR, but we should also add support for Gerrit.

Original issue comments: Comment user: https://github.com/tylerreidwaze Comment created at: 2022-11-17T20:39:05Z Comment last updated at: 2022-11-17T20:39:05Z Comment body: Just adding some context from our attempt to set up a gerrit based repo with porch v0.0.12

We registered a repository with AuthType = None. Not surprisingly the repository failed to sync with the below error from the porch-server pod

"apiserver received an error that is not an metav1.Status: &fmt.wrapError{msg:"cannot fetch repository default/kpt-packages: authentication required", err:(*errors.errorString)(0xc000d2c5a0)}: cannot fetch repository default/kpt-packages: authentication required"

We wanted to try some hacks around this to see if we could manually get the credentials set up. We added a git config which referenced our git cookie for accessing gerrit.

root@porch-server-58dbcb4d59-6c6dl:/# cat .gitconfig 
[http]
    cookiefile = /root/.git-credential-cache/cookie

This allowed us to clone the repo on the pod using git clone, but the server itself was still not able to access the repository and the original error persisted

Comment user: https://github.com/tylerreidwaze Comment created at: 2022-11-17T20:54:54Z Comment last updated at: 2022-11-17T20:54:54Z Comment body: As far as an eventual desired workflow, the cookies file workflow for config sync works really well for us. We need to refresh that cookies file often, so mounting it as a kubernetes secret that we can update has been a decent solution for us