Skip to content

Conversation

@brendandburns
Copy link
Contributor

@brendandburns brendandburns commented Mar 30, 2019

Closes #4

@drubin

Thanks!

@k8s-ci-robot k8s-ci-robot requested review from drubin and mbohlool March 30, 2019 05:35
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 30, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brendandburns

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 30, 2019
}
request = @client.build_request('GET', path + '?watch=true', opts)
request.on_body do |chunk|
parts = chunk.split(/\n/)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure transport chunks always end in a newline. Last part might be incomplete, may need to buffer it and concat with first part of next chunk?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Fixed (and added some tests to validate)

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 2, 2019
@brendandburns
Copy link
Contributor Author

@cben thanks for the feedback, comment addressed!

@drubin
Copy link
Contributor

drubin commented Apr 5, 2019

Feels like we should rebase the Add support for Azure AAD login. Fix some bugs. out of this PR though?


def split_lines(last, chunk)
data = chunk
data = last + "\n" + data unless last.empty?
Copy link

@cben cben Apr 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea was that a single line could(?) be split between prev chunk and this one, so I think this should just be

Suggested change
data = last + "\n" + data unless last.empty?
data = last + data

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because if last itself is empty you don't want to randomly prepend a newline... (I had that bug)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right but I'm saying you don't want the newline between them!
Say first chunk is cut {"Foo": 0}\n{"ba
and next chunk continues it r": 1}\n{"baz.
If you join with a newline, the 2nd json will not parse properly.

Then, prepending an empty string is harmless, you can keep the unless last.empty? or drop it, as you prefer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@brendandburns
Copy link
Contributor Author

@cben comment addressed

@drubin let's merge #39 and then I will rebase to remove that commit.

Thanks!

@brendandburns
Copy link
Contributor Author

@drubin @cben rebased and ready to merge.

@brendandburns brendandburns force-pushed the watch branch 2 times, most recently from ad4c9d7 to 55c8daf Compare April 30, 2019 22:18
@brendandburns
Copy link
Contributor Author

@drubin @cben ok, this is actually really ready for re-review :)

@cben
Copy link

cben commented May 1, 2019

Do kube_condig.rb changes belong in this PR? No opinion on those.
The rest LGTM 💯

@brendandburns
Copy link
Contributor Author

@cben the same fix is in #44 so let's merge that first and I'll rebase?

@cben
Copy link

cben commented May 1, 2019

Just to be clear, I'm not a merger/maintainer here.
I'm following this repo to "spy for the opposition" 😉 and got interested in this one...

@drubin
Copy link
Contributor

drubin commented May 7, 2019

@brendandburns mind rebasing/fixing/closing depending on how you see fit?

@brendandburns
Copy link
Contributor Author

@drubin rebased. please take another look.

Thanks!

@drubin
Copy link
Contributor

drubin commented May 9, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 9, 2019
@k8s-ci-robot k8s-ci-robot merged commit ec67474 into kubernetes-client:master May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Watch

4 participants