Skip to content
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

JSON encoded string input #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

radianbaskoro
Copy link

I have a use case to show deployment progress with multi line messages. This PR is for adding an optional JSON encoded string input for the frames.

In case of badly formed JSON string, it will print an error message and still use the original frame as the message.

@mroth mroth changed the title Multi line JSON encoded strings Jul 10, 2020
@mroth mroth changed the title JSON encoded strings JSON encoded string input Jul 10, 2020
@mroth
Copy link
Owner

mroth commented Jul 10, 2020

Thanks @radianbaskoro! Sorry for the delay.

I'm trying to understand the use case a bit better so I can offer feedback. What tool is the output coming from, what what does it's typical output look like?

@radianbaskoro
Copy link
Author

Output comes from kubectl to query my kubernetes cluster status during deployment. It would look something like:

$ kubectl get pods
NAME     READY     STATUS        RESTARTS   AGE
pod-0    1/1       Running       0          4m
pod-1    1/1       Running       0          2m
pod-2    0/1       Pending       0          2s
pod-3    1/1       Terminating   0          10d

The idea is to notify the progression of deployment from our CI/CD pipeline to our slack channel, and allow us to make any intervention if needed.

@mroth
Copy link
Owner

mroth commented Jul 17, 2020

Got it. So in this case, kubectl get pods returns a single status update, with normal line breaks. So are you running this through some sort of other command that runs it repeatedly, and then piping that through some other command to do the JSON encoding?

(It's been a number of years since I touched this library, so I've decided to do a general cleanup, which may result in minor API changes. I'll also hopefully be able to generalize and expose the underlying library API, so for more complex usage, it may make more sense to rig it via the Go library instead of the CLI client.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants