Comments

jigish.addweb created an issue. See original summary.

jigish.addweb’s picture

Status: Active » Needs review
StatusFileSize
new19.34 KB
xiaohua guan’s picture

@jigish.addweb

Thanks for your patch. I found some problems below.

1. The claim_ref should be reason.

+  /**
+   * {@inheritdoc}
+   */
+  public function getReason() {
+    return $this->get('claim_ref')->value;

2. It seems that some codes weren't included into the patch.
For example, I can't find where the variable $claim is declared.

+    $entity->setClaimRef($claim);
+    $entity->setPhase($persistent_volume['status']['phase'] ?? '');
+    $entity->setReason($persistent_volume['status']['reason'] ?? '-');
jigish.addweb’s picture

Issue summary: View changes
StatusFileSize
new22.63 KB
jigish.addweb’s picture

Issue summary: View changes

@guan

Thank you for reviewing the patch. I updated the code.
Please review the patch

jigish.addweb’s picture

StatusFileSize
new23.65 KB
xiaohua guan’s picture

@jigishi.addweb

The patch file looks good. Thanks.

yas’s picture

Status: Needs review » Needs work
StatusFileSize
new1.1 MB

@jigishaddweb

Thank you for the update. I tested the patch; and I would like to ask you to change the columns to sortable ones

screenshot-2020-01-09a.png


I encountered the following error while executing drush updb since I have unreachable K8s cluster.
$ drush updb -y
 [success] Cache rebuild complete.
 -------- ----------- --------------- --------------------------------------- 
  Module   Update ID   Type            Description                            
 -------- ----------- --------------- --------------------------------------- 
  k8s      8256        hook_update_n   Add fields to k8s_persistent_volume.   
 -------- ----------- --------------- --------------------------------------- 


 // Do you wish to run the specified pending updates?: yes.                                                             

>  [notice] Update started: k8s_update_8256
>  [notice] Update completed: k8s_update_8256
>  [error]  Message: An error occurred when calling K8s API: GET /persistentvolumes
>  
>  [error]  Message: Status Code: 401
>  
>  [error]  Message: Error reason: Unauthorized
>  
>  [error]  Message: Message: Unauthorized
>  
 [success] Finished performing updates.
 [success] Cache rebuild complete.

I assume the error was caused by the following code.

diff --git a/modules/cloud_service_providers/k8s/k8s.install b/modules/cloud_service_providers/k8s/k8s.install
index ec8dd116..bf9e31f4 100644
--- a/modules/cloud_service_providers/k8s/k8s.install
+++ b/modules/cloud_service_providers/k8s/k8s.install
@@ -1177,6 +1177,67 @@ function k8s_update_8255() {

+  foreach ($config_entities as $config_entity) {
+    $k8s_service->setCloudContext($config_entity->getCloudContext());
+    $k8s_service->updateVolumeWithoutBatch();
+  }

Looks we need to validate the K8s cluster connection before start to run $k8s_service->updateVolumeWithoutBatch(); . You can call $k8s_service->getNamespaces(); w/ try-catch clause.

yas’s picture

jigish.addweb’s picture

Status: Needs work » Needs review
StatusFileSize
new24.9 KB
yas’s picture

Status: Needs review » Reviewed & tested by the community

@jigishaddweb

Thank you for the update. I tested it and looks good to me. I'll merge the patch to 8.x-1.x and 8.x-2.x and close this issue as Fixed.

  • yas committed 2474a24 on 8.x-1.x authored by jigish.addweb
    Issue #3105016 by jigish.addweb, yas, Xiaohua Guan: Add more properties...

  • yas committed de9842f on 8.x-2.x authored by jigish.addweb
    Issue #3105016 by jigish.addweb, yas, Xiaohua Guan: Add more properties...
yas’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed
StatusFileSize
new950.22 KB

Status: Fixed » Closed (fixed)

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