-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Local Git Repos #4244
Comments
@criztovyl: This issue is currently awaiting triage. SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Just out of curiosity, why not just refer to them as a standard path instead of using a git url? Is the |
Yes, the For example while in one project we distribute the project's base via git, the customer should not use our git repo in live systems to reduce the number of (moving) parts that can fail. thus, the simplest way to just have a defined location on local system where the (base) repo is and can be referenced by customer in it's overlays. (having multiple versions / different |
@KnVerey you self-assigned but did not update triage status, what does that mean process-wise? :) |
In this case it means I claimed the issue to read carefully and comment during a bug scrub, then lost track of it for a bit. Sorry for the confusion. 😅 I empathize with the desire to remove dependencies from the mix, and indeed I'd say the best practice is to commit the hydrated build results themselves to git, in cases where that is an option, eliminating the entire build from the release process. If that's not an option, two alternatives come to mind based on what I understand of your situation so far:
Generally speaking, Kustomize intends for configuration to be entirely declarative, encapsulated by the root Kustomization directory, and not subject to side-effects based on the state of the machine on which the build is run (same Kustomization directory = same result). It's true that there are ways to bypass this, most notably by disabling the load restrictor with a flag. The remote git source feature itself also contradicts this to some extent. But I would like to promote those best practices to the extent possible, which makes me very hesitant about a new feature that would add another way to bypass the intended structure. I hope that explanation makes sense, and please let me know what you think of the above alternatives. /unassign |
Thank you for the explanation, it does make sense to me. For me the question comes up how far the same-dir-same-result goes. Alternative 1 assumes users quite familiar and comfortable with Git: It will mean you need different branches for prod and staging if you have different versions on them. That will get quite hairy with users only knowing git basics. We are not willing to assume experienced git users, thus this does not fit us. What I have grasped from alternative 2 it does not to really change the status quo we're having trouble with. Thinking around lead me to a third alternative. Normally I would be happy with kustomize just fetching out-of-dir resources from anywhere, me, the overlay author ensuring same-dir-same-result is meaningfully respected by using static refs, e.g. tags or commit hashes. This works fine for git via https and ssh, but not for file scheme. While you can already shoot yourself in the foot if you use "dynamic" refs (branches), you don't want an additional options for foot-shooting, so you don't want to add git file scheme, agreed. Thinking further, and speaking strictly, the git loader would need to be dropped completely to prevent foot-shooting. It's kept because you can ensure same-dir-same-result using static refs, but it's still quite easy to shoot yourself in the foot using dynamic refs. (Also dropping it without an alternative would disallow even static refs that do work towards same-dir-same-result.) Even stricter you would need to drop bases and components as they can change independently of the kustomization root. BUT most users will have base, overlays and components together in one SCM repo. Thus, to shoot yourself in the foot you'll need to be quite deliberate about that. So, not being overly strict, they are kept. My thoughts now went into the direction of how to be strict, but still ensure users already using static refs will not be disgruntled. I thought out a The field will contain resource URLs that do not need to adhere to same-dir-same-result -- but they are not automatically downloaded or updated. Instead kustomize downloads the remote bases only when the user runs I'll open a dedicated feature request for * for |
I understand it's not indended to be implement as suggested by me, closing :) |
I'd like to build kustomizations that refer to refs in local git repositories
from my understanding git natively supports
file://
URLs and I would also be happy withThe expected outcome would be that Kustomize accepts I passed in absolute path to a .git repository and uses the git loader for it.
The current way I am using involves (ab-)using the special handling of
_git
in URLs and git'surl.*.insteadOf
:URLs tried so far (path to repo is
/absolute/path/to/repo/.git
, path in repo ispath/in/repo
, ref isa-ref
):git::/absolute/path/to/repo/.git/path/in/repo?ref=a-ref
file:///absolute/path/to/repo/.git/path/in/repo?ref=a-ref
file://localhost/absolute/path/to/repo/.git/path/in/repo?ref=a-ref
git::file:///absolute/path/to/repo/.git/path/in/repo?ref=a-ref
git::file://localhost/absolute/path/to/repo/.git/path/in/repo?ref=a-ref
The text was updated successfully, but these errors were encountered: