kubernetes-client icon indicating copy to clipboard operation
kubernetes-client copied to clipboard

Better File utilities

Open GregJohnStewart opened this issue 4 years ago • 4 comments

Hello all, I realize that this might be a little bit of an ask, as I know the API follows (generally) the OC command structure, but I was wondering if the pod file handling API could be expanded.

The file api (client.pods().withName().file().*) seems pretty sparse, and was wondering if it would be possible to add full file CRUD capabilities here.

For my own purposes, I have been able to 'fill in' the capabilities I need beyond what is available with .file() using exec commands, but I don't consider this optimal, though perhaps that might be how some functionalities need to happen 'behind the scenes' here...

To be clear, it would be nice to have:

  • file().upload(OutputStream) (upload via streams, rather than needing a file on the client to exist)
  • file().delete() deleting the file
  • file().exists() determining if the file actually exists

My particular use case is I am writing integration tests for a system that relies on files in a PV, and in order to get proper coverage I need to interact with the files directly.

GregJohnStewart avatar Jan 27 '21 16:01 GregJohnStewart

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

stale[bot] avatar May 09 '21 14:05 stale[bot]

Bump? Been a while, hadn't heard anything.

GregJohnStewart avatar May 16 '21 17:05 GregJohnStewart

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

stale[bot] avatar Aug 15 '21 05:08 stale[bot]

  • file().upload(OutputStream) (upload via streams, rather than needing a file on the client to exist)

This one is already covered:

client.pods().withName(podName).file("/path/to/file").upload(inputStream);
  • file().delete() deleting the file

  • file().exists() determining if the file actually exists

For these ones we could try to provide an implementation if interested, but it would be really brittle, especially for delete.

manusa avatar Mar 05 '24 15:03 manusa

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

stale[bot] avatar Jun 04 '24 01:06 stale[bot]