Closed (fixed)
Project:
Cloud
Version:
4.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
6 Aug 2021 at 10:03 UTC
Updated:
3 Sep 2021 at 08:14 UTC
Jump to comment: Most recent, Most recent file
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3227081-2.patch | 3.43 KB | ryo yamashita |
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
ryo yamashita commentedComment #4
ryo yamashita commented@yas
I have created a patch. Could you please check it?
Comment #5
yas@RyoYamashita
Thank you for supplying the patch. I posted the comment for refactoring. Thanks!
Comment #6
ryo yamashita commented@yas
I checked your comment.
I modified the code as you pointed out and got an error like "Cannot instantiate interface Drupal\k8sService\K8sRestServiceInterface".
Please refer to the following log text and patch file for specific confirmation.
Comment #7
yas@RyoYamashita
Could you please attach the patch? Definitely there is some problem about instantiation of the service. Thanks!
Comment #8
ryo yamashita commented@yas
The patch file is 3227081-2.patch.
I thought I could implement the service by referring to K8sService, but I am having trouble with the above error.
I would be grateful for your advice.
Comment #9
yas@RyoYamashita
Sorry I've missed the attached patch since I thought you'd updated MR branch.
Anyhow, I couldn't find the
K8sRestServiceInterfacedefinition.I think we have something like this:
k8s.service.ymlThen,
K8sRestServiceFactoryshould return aK8sRestServiceclass. To implementK8sRestServiceFactory, see also and refer to theK8sServiceFactoryclass. TheK8sRestServiceclass should implementK8sServiceInterfaceas I mentioned my comment above. Or, probably we can re-use the existingK8sServiceFactoryto getK8sRestService.@xiaohua-guan
What do you think?
Comment #10
ryo yamashita commented@yas
Thank you for all the advice you have given me.
It didn't occur to me that I also need to implement the factory class.
The following are the additions to the k8s.service.yml, which do not include the factory class.
Also, for the patch, would it have been clearer to submit the MR instead of the patch file? I will do so in the future.
Comment #11
xiaohua guan commented@yas @RyoYamashita
I can't find the definition of K8sRestServiceInterface too. K8sRestServiceInterface should be included into the patch file. Also I think the name of the service class should be changed to K8sRestService.
Comment #12
ryo yamashita commented@yas @xiaohua-guan
I submitted the fix by MR, not by patch file.
By creating the Factory class, I was able to reference the created K8sRestService class from the ApiController class.
However, when I acquire the log information, it becomes null.
The K8sRestService class should have acquired the K8sService information by DI in the constructor, but it may not have been read properly.
Comment #13
yas@RyoYamashita
Thank you for the update. I posted my comments.
@xiaohua-guan
What do you think?
Comment #14
xiaohua guan commented@yas @RyoYamashita
I think the k8s rest service is unnecessary, because the APIController can call the getPodLog of k8s service directly. So the k8s rest service should be deleted.
Comment #15
ryo yamashita commented@yas
I have recreated a patch. Could you please check it?
Comment #16
yas@ryo-yamashita
Thank you for the update and this code is what we expected. There is one leftover to add a comment into YAML file. Please see my comment at: https://git.drupalcode.org/project/cloud/-/merge_requests/338#note_39605
Thanks
Comment #17
ryo yamashita commented@yas
I fixed YAML file's comment and rebase this branch. Could you please check it?
Comment #18
yas@ryo-yamashita
Thank you for the update. It sounds great new. I'll merge the patch to
4.xand close this issue as Fixed.Comment #19
yasComment #22
yas