Problem/Motivation

  • I would like to implement the editing feature of K8s Pod in SPA as well.
  • But the problem with using the Cloud module's editing form as is was that it was difficult to check for errors.

Proposed resolution

  • Therefore, we will create an editing form in SPA and implement the editing process in REST API.
  • The REST API should also be available on the Cloud module side.

Issue fork cloud-3263292

Command icon Show commands

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

Ryo Yamashita created an issue. See original summary.

ryo yamashita’s picture

@yas

At this stage, if you open the editor page of the K8s Pod and press the Save button, the server will return a 500 error in the REST API process. When I checked the error log in Drupal, I saw the following output. However, I have confirmed that the service in question can be used on the Drupal Form side. What are the possible causes? Thanks!

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "k8s.operations". (/var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php の 156 行目 Drupal\Component\DependencyInjection\Container->get() 内)

log view

yas’s picture

@ryo-yamashita

I posted my comment. Could you please try to modify to K8sOperationsServiceInterface? Thanks!

ryo yamashita’s picture

@yas

From the results of the automated tests, it was found that changing "K8sOperationsService" to "K8sOperationsServiceInterface" in k8s.services.yml would not pass the automated tests.

As for the issue of the REST API in k8s ApiController.php not working properly, I will look into the possibility of implementing the function by other means.

yas’s picture

@ryo-yamashita

Thank you for the update. I posted my minor comment. Thanks!

ryo yamashita’s picture

Status: Needs work » Needs review

@yas

I finished fixing the REST API in ApiController.php of k8s. Please review it. Thanks!

yas’s picture

Status: Needs review » Needs work

@ryo-yamashita

Thank you for the update. It looks good to me now. However there is one leftover for my comment. Could you please check it? Thanks!

yas’s picture

@ryo-yamasthia

Thank you for the update. Sorry, I was wrong about the place where I wanted to point out. Could you please check it again?

ryo yamashita’s picture

Status: Needs work » Needs review

@yas

I refixed the source code. Please review it. Thanks!

yas’s picture

Status: Needs review » Reviewed & tested by the community

@ryo-yamashita

Thank you for the fix. I'll merge the patch to 4.x and 5.x, and close this issue as Fixed.

  • yas committed 52874f7 on 4.x authored by Ryo Yamashita
    Issue #3263292 by Ryo Yamashita, yas: Add the function to edit K8s Pod...

  • yas committed 17818aa on 5.x authored by Ryo Yamashita
    Issue #3263292 by Ryo Yamashita, yas: Add the function to edit K8s Pod...
yas’s picture

Status: Reviewed & tested by the community » Fixed

.

ryo yamashita’s picture

Status: Fixed » Needs review

@yas

Code fix pushed to 3263292-add-the-function-to-edit-k8s-pod-in-the-spa-2 branch. Please review it. Thanks!

yas’s picture

Status: Needs review » Reviewed & tested by the community

@ryo-yamashita

Thank you for the fixes. I'll merge the patch to 4.x and 5.x, and close this issue as Fixed.

  • yas committed 2296a60 on 5.x authored by Ryo Yamashita
    Issue #3263292 by Ryo Yamashita, yas: Hotfix - Add the function to edit...

  • yas committed e487673 on 4.x authored by Ryo Yamashita
    Issue #3263292 by Ryo Yamashita, yas: Hotfix - Add the function to edit...
yas’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.