-
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
kio.LocalPackageReadWriter should provide file system abstraction #3873
Comments
/triage accepted |
Thanks! Just to add some history, the impls of https://pkg.go.dev/sigs.k8s.io/kustomize/api/filesys#FileSystem are both in that package (same package as the ifc). The main ctors one would use at injection points are
The goal was to just meet kustomize's IO needs, so no chmod, chown, seeking, truncating, etc. Despite being in the same package, I think the two impls are independent. We could move them into subpackages to make that easier to prove, but it hasn't come up. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale The PRs implementing this are all complete; only one left to merge. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/close The implementation merged a while ago |
@KnVerey: Closing this issue. In response to this:
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. |
Is your feature request related to a problem? Please describe.
Testing any program using
kio.LocalPackageReadWriter
,kio.LocalPackageReader
, orkio.LocalPackageWriter
is quite cumbersome due to its lack of abstraction allowing to fake the file system it reads from. This leads to very complex test cases where temp directories need to be created and destroyed continuously.Describe the solution you'd like
I would like these types to include a
FileSystem
field in they would use in order to interact with the file system. By default, this would be set to interact with the actual file system so the change would be backwards compatible.Describe alternatives you've considered
There are other packages providing a similar file system abstraction that we could consider.
sigs.k8s.io/kustomize/pkg/fs also provides a FileSystem interface that seems to be very similar, I'm not sure which one we should be using or whether this one in the one mentioned above should be unified eventually.
Go 1.16 comes with an
fs
package but this would force kustomize and all its users to update to Go 1.16, which seems a non-starter.If this issue is accepted, I would like to provide a PR I have already been working on.
The text was updated successfully, but these errors were encountered: