Coder Social home page Coder Social logo

Comments (5)

mruoss avatar mruoss commented on June 1, 2024 2

Released with 2.3.0

from k8s.

mruoss avatar mruoss commented on June 1, 2024 1

Hi @elliottneilclark

Nice catch. I think it's not such a big deal. When I've implemented the mint client for the connect operation, I was focusing on podExec. Each frame you get from podExec comes with a leading byte, annotating the channel (stdout, stderr, error). That's why I'm pattern matching against that first byte in K8s.Client.Mint.Request.map_frame/1.

Obviously, the binary stream sent when connecting to pods/log is not prefixed. So I think all that's missing is something like this: def map_frame({:binary, <<msg::binary>>}), do: {:stdout, msg}.

I will try to add a test and fix this weekend.

from k8s.

elliottneilclark avatar elliottneilclark commented on June 1, 2024

So I think all that's missing is something like this:

Keyword.take(opts, [:stdin, :stdout, :stderr, :tty, :command, :container])

I think that this needs to accept the query params that pods/log can put forward. Here's a good list for that: https://github.com/kube-rs/kube/blob/3e7f32e7b046c5428539050674e8d2404e3680d5/kube-core/src/subresource.rs#L40

from k8s.

mruoss avatar mruoss commented on June 1, 2024

I see, thanks for the hint.

I've created a PR (wip). I'm still considering splitting the pods/exec and pods/log cases for the params, though. The defaults are different and the "allowed params", too...

from k8s.

elliottneilclark avatar elliottneilclark commented on June 1, 2024

I've created a PR (wip).

Thank you. I like that; it's elegant in re-using what's already there.

I'm still considering splitting the pods/exec and pods/log cases for the params, though.

That makes sense; most of the clients I could find had separate APIs for exec/connect and logging. It would also allow for a cleaner API when not trying to follow the logs (aka :get with the log subresource.)

from k8s.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.