-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add: new routes for daemonsets #510
Conversation
I'm trying to run test locally to make Travis green. If you have any hint I'll take it :) I did not manage to get a go test command working as test and code are in separated folder. |
@Seb-Solon To run tests use |
Current coverage is 95.20%
@@ master #510 diff @@
==========================================
Files 173 173
Lines 1332 1332
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 1262 1268 +6
+ Misses 70 64 -6
Partials 0 0
|
PR is ready IMO. I won't touch it anymore, have fun 😄 |
d92e5f0
to
3c59476
Compare
Hey @Seb-Solon, thanks for doing this! :) Are you saying that you arent going to work on this PR to have it merged? |
No what I meant was : "The CI is green, it's not work in progress anymore". I'm waiting for your comment / review :) |
All right, sounds perfect. Would you mind waiting a few more days with this PR? The problem is on our side: we do not know how to scale the UX of the UI to accommodate more types of resource lists. This is a critical problem that we will be solving in a few days. Once we know how to add new resources to the UI, it will be very easy for us to the such PRs through. Is this okay for you? |
No problem, take your time :) |
Thank you! |
Wait a few more days to see what's happening with design that we have for handling multiple resources: #589 If it gets accepted, then we can go ahead with implementation |
Hi, What about this PR ? I saw that you commited things about the new dashboard design. |
Oh, yeah. We can merge this PR now :) I'm very happy to work with you to get it merged and have support for DaemonSets in the UI. |
We've made lots of changes to backend code since start of this PR. Can you rebase it? |
Rebased, waiting for travis to be green |
It appears you need to apply some fixes. We've completely refactored go codebase and now it's divided into packages. First step would be to check our new pattern and try to follow it. Create Thanks for help! |
Ok, I'm working on this. Can you give me a command to build the dashboard locally? I can see those . import and this makes fail my previous command I had to build |
Hm... If your repo clone is really old, best create and then git checkout -b titilambert-Add_ds_routes master
git pull https://github.com/titilambert/dashboard.git Add_ds_routes With this you should have a clean environment. If this does not help, try entering the root dir of the repo and: rm -rf node_modules/
npm install
gulp clean
gulp build
gulp backend # to compile backend
gulp test # to test all
gulp backend-test # to test backend only |
Ok I'm done, Travis is green waiting for you input. |
@floreks Can you review this also? |
Review status: 0 of 17 files reviewed at latest revision, 11 unresolved discussions. src/app/backend/handler/apihandler.go, line 28 [r7] (raw file):
Do not use dot-imports for new code. The dot imports that are here are for legacy reasons, we plan to remove them ASAP. Remove the dot and prefix all stuff you use from the package there with "daemonset". src/app/backend/resource/common/podinfo.go, line 106 [r7] (raw file):
Hmm... This needs a name and documentation that does not mention daemon sets. src/app/backend/resource/common/podinfo.go, line 106 [r7] (raw file):
Also, I think the argument semantics are flipped. I.e., "testedObjectLabels" is actually label selector and vice versa. src/app/backend/resource/common/resourcechannels.go, line 253 [r7] (raw file):
s/ReplicaSet/DaemonSet src/app/backend/resource/daemonset/daemonsetcommon.go, line 33 [r7] (raw file):
Remove this struct and just use PodInfo from common/podinfo.go. It does the same. src/app/backend/resource/daemonset/daemonsetdetail.go, line 20 [r7] (raw file):
Do not use dot-imports for new code :) src/app/backend/resource/daemonset/daemonsetdetail.go, line 50 [r7] (raw file):
Use PodInfo from common :) src/app/backend/resource/daemonset/daemonsetdetail.go, line 224 [r7] (raw file):
Can you delete the internal/external endpoints code from this PR? We plan to have a common way of handling this across our codebase, so duplicating work is not necessary. src/app/backend/resource/daemonset/daemonsetlist.go, line 23 [r7] (raw file):
Dot imports :) src/app/backend/resource/daemonset/daemonsetpods.go, line 15 [r7] (raw file):
Can you remove this part from the PR? We plan to have better and easier way of getting pods for a controller. It'd also make the PR smaller. src/app/backend/resource/daemonset/daemonsetpodsmetrics.go, line 68 [r7] (raw file):
This looks like a copy&paste from rcpodsmetrics. Can you reuse code from there? Comments from Reviewable |
Nice work! We'll have a few iterations of comments and, hopefully, merge quickly :)
|
Review status: 0 of 17 files reviewed at latest revision, 13 unresolved discussions. src/app/backend/handler/apihandler.go, line 191 [r7] (raw file):
@bryk should we follow already new api concept? src/app/backend/resource/daemonset/daemonsetdetail.go, line 63 [r7] (raw file):
There is no deamon set specific data in this structure. Could we just have Pod structure in common and reuse it everywhere? Later we can think about extracting more data to meta object. @bryk what do you think? Comments from Reviewable |
Review status: 0 of 17 files reviewed at latest revision, 13 unresolved discussions. src/app/backend/handler/apihandler.go, line 191 [r7] (raw file):
|
Review status: 0 of 17 files reviewed at latest revision, 13 unresolved discussions. src/app/backend/resource/daemonset/daemonsetdetail.go, line 63 [r7] (raw file):
|
Review status: 0 of 15 files reviewed at latest revision, 13 unresolved discussions, some commit checks failed. src/app/backend/resource/common/podinfo.go, line 106 [r7] (raw file):
|
I'll squash my commit and rebase once we agree on the PR |
A few more comments. I'm very happy where this PR goes. We should merge it soon. My comments are mostly about using new stuff that was introduced in the backend code in the meantime.
|
I've rebased on master and used the pod resource available. I'll squash everything in 2/4 commits at the end (code + test or code + move + test *2) . Squashing will make tree more readable in my opinion, but maybe you don't mind having ~15 commits for that.
|
Review status: 0 of 13 files reviewed at latest revision, 7 unresolved discussions. src/app/backend/resource/daemonset/daemonsetdetail.go, line 241 [r8] (raw file):
|
Review status: 0 of 13 files reviewed at latest revision, 7 unresolved discussions. src/app/backend/resource/daemonset/daemonsetdetail.go, line 160 [r8] (raw file):
There is PR with generic delete functionality waiting for merge. Should be in soon so this can be refactored. src/app/backend/resource/daemonset/daemonsetdetail.go, line 241 [r8] (raw file):
|
Looks nice :) Please rebase, use all common functionality that @floreks mentioned and let's merge this and iterate on issues later. Please make next PRs smaller, so that we can have quicker turnaround :)
|
I am almost done but I still have a small issue. The function GetExternalEndpoints here ( https://github.com/kubernetes/dashboard/blob/master/src/app/backend/resource/common/endpoint.go#L36) is not generic enough actually. DaemonSet selector are unversioned.LabelSelector with MatchExpressions and MatchLabels. If I want to use this function I must only use the MatchLabels attribute. I am not sure it's a good idea but we can fix it later. @bryk what do you think?
|
I rebased and updated the code. I tried to used the generic function as much as I could except for the part I was referring above. This forced me to export more functions from common package to use them
|
Create an issue on GitHub that the generic method is invalid and go ahead and use it. State in the bug how it should look like. All else LGTM :) Reviewed 3 of 11 files at r5, 2 of 12 files at r7, 1 of 15 files at r8, 12 of 17 files at r11, 1 of 1 files at r12. Comments from Reviewable |
Done with #743. Commits squashed.
|
|
Merging :) Thanks for the work. Do you need any help now?
|
Hi,
I started to implement #509.
I tried to keep it simple : the code is very similar to the replication controller one. Maybe we could refactor it but :
Feel free to comment!