Commit e2b03dfe authored by Yas Naoi's avatar Yas Naoi Committed by Yas Naoi
Browse files

Issue #3163409 by yas: Fix an Internal Server Error: "Call to undefined method...

Issue #3163409 by yas: Fix an Internal Server Error: "Call to undefined method Drupal\cloud\Entity\CloudConfig::link() in Drupal\k8s\Plugin\Block\K8sNodeAllocatedResourcesBlock->build()"
parent b6be488a
Loading
Loading
Loading
Loading
+4 −1
Changes for modules/cloud_service_providers/k8s/src/Plugin/Block/K8sNodeAllocatedResourcesBlock.php: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ class K8sNodeAllocatedResourcesBlock extends K8sBaseBlock {

  /**
   * {@inheritdoc}
   * @throws \Drupal\Core\Entity\EntityMalformedException
   */
  public function build() {

@@ -77,7 +78,9 @@ class K8sNodeAllocatedResourcesBlock extends K8sBaseBlock {
        $this->cloudConfigPluginManager->setCloudContext($k8s_cluster['value']);
        $cloud_config = $this->cloudConfigPluginManager->loadConfigEntity();
        $message = count($k8s_clusters) > 1
          ? $this->t('Node Allocated Resources block requires K8s Metrics Server for %cloud_config.', ['%cloud_config' => $cloud_config->link()])
          ? $this->t('Node Allocated Resources block requires K8s Metrics Server for %cloud_config.', [
            '%cloud_config' => $cloud_config->toLink()->toString(),
          ])
          : $this->t('Node Allocated Resources block requires K8s Metrics Server.');
        if ($this->isMetricsServerEnabled($k8s_cluster['value'] ?? '', $message)) {
          $metrics_enabled = TRUE;