Loading modules/cloud_service_providers/aws_cloud/aws_cloud.install +1 −1 Original line number Diff line number Diff line Loading @@ -2203,7 +2203,7 @@ function aws_cloud_update_8216(): void { foreach ($cloud_configs_temp ?: [] as $cloud_config_temp) { try { $cloud_config_temp = unserialize($cloud_config_temp, ['allowed_classes' => TRUE]); $cloud_config_temp = unserialize($cloud_config_temp, ['allowed_classes' => ['CloudConfig']]); $params = [ // Those fields such as 'type', 'name', 'cloud_context'... are not the // field_*, so we will access the value via each method. Loading modules/cloud_service_providers/cloud_cluster/cloud_cluster.module +2 −10 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ use Drupal\cloud\Entity\CloudLaunchTemplate; use Drupal\cloud\Traits\CloudContentEntityTrait; use Drupal\cloud_cluster\Entity\CloudClusterWorker\CloudClusterWorker; use Drupal\cloud_cluster\Plugin\rest\resource\CloudClusterWorkerResource; use Drupal\cloud_cluster\Service\CloudClusterServiceInterface; use Drupal\Component\Serialization\Yaml; use Drupal\Core\Ajax\AjaxResponse; use Drupal\Core\Ajax\CssCommand; Loading @@ -31,15 +32,6 @@ use Drupal\file\Entity\File; use Drupal\views\Plugin\views\query\QueryPluginBase; use Drupal\views\ViewExecutable; define('CLOUD_CLUSTER_SUPPORTED_ENTITY_TYPES', [ 'aws_cloud_*', 'k8s_*', 'vmware_*', 'openstack_*', 'cloud_config', 'cloud_launch_template', ]); /** * Implements hook_help(). */ Loading Loading @@ -441,7 +433,7 @@ function cloud_cluster_menu_local_tasks_alter(&$data, $route_name): void { * The entity type is supported or not. */ function cloud_cluster_is_entity_type_supported($entity_type): bool { $regex = '^' . implode('$|^', CLOUD_CLUSTER_SUPPORTED_ENTITY_TYPES) . '$'; $regex = '^' . implode('$|^', CloudClusterServiceInterface::CLOUD_CLUSTER_SUPPORTED_ENTITY_TYPES) . '$'; $regex = str_replace('_*', '_[a-z_]+', $regex); return preg_match("/$regex/", $entity_type); } Loading modules/cloud_service_providers/cloud_cluster/src/Service/CloudClusterServiceInterface.php 0 → 100644 +19 −0 Original line number Diff line number Diff line <?php namespace Drupal\cloud_cluster\Service; /** * Provides K8sService interface. */ interface CloudClusterServiceInterface { public const CLOUD_CLUSTER_SUPPORTED_ENTITY_TYPES = [ 'aws_cloud_*', 'k8s_*', 'vmware_*', 'openstack_*', 'cloud_config', 'cloud_launch_template', ]; } Loading
modules/cloud_service_providers/aws_cloud/aws_cloud.install +1 −1 Original line number Diff line number Diff line Loading @@ -2203,7 +2203,7 @@ function aws_cloud_update_8216(): void { foreach ($cloud_configs_temp ?: [] as $cloud_config_temp) { try { $cloud_config_temp = unserialize($cloud_config_temp, ['allowed_classes' => TRUE]); $cloud_config_temp = unserialize($cloud_config_temp, ['allowed_classes' => ['CloudConfig']]); $params = [ // Those fields such as 'type', 'name', 'cloud_context'... are not the // field_*, so we will access the value via each method. Loading
modules/cloud_service_providers/cloud_cluster/cloud_cluster.module +2 −10 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ use Drupal\cloud\Entity\CloudLaunchTemplate; use Drupal\cloud\Traits\CloudContentEntityTrait; use Drupal\cloud_cluster\Entity\CloudClusterWorker\CloudClusterWorker; use Drupal\cloud_cluster\Plugin\rest\resource\CloudClusterWorkerResource; use Drupal\cloud_cluster\Service\CloudClusterServiceInterface; use Drupal\Component\Serialization\Yaml; use Drupal\Core\Ajax\AjaxResponse; use Drupal\Core\Ajax\CssCommand; Loading @@ -31,15 +32,6 @@ use Drupal\file\Entity\File; use Drupal\views\Plugin\views\query\QueryPluginBase; use Drupal\views\ViewExecutable; define('CLOUD_CLUSTER_SUPPORTED_ENTITY_TYPES', [ 'aws_cloud_*', 'k8s_*', 'vmware_*', 'openstack_*', 'cloud_config', 'cloud_launch_template', ]); /** * Implements hook_help(). */ Loading Loading @@ -441,7 +433,7 @@ function cloud_cluster_menu_local_tasks_alter(&$data, $route_name): void { * The entity type is supported or not. */ function cloud_cluster_is_entity_type_supported($entity_type): bool { $regex = '^' . implode('$|^', CLOUD_CLUSTER_SUPPORTED_ENTITY_TYPES) . '$'; $regex = '^' . implode('$|^', CloudClusterServiceInterface::CLOUD_CLUSTER_SUPPORTED_ENTITY_TYPES) . '$'; $regex = str_replace('_*', '_[a-z_]+', $regex); return preg_match("/$regex/", $entity_type); } Loading
modules/cloud_service_providers/cloud_cluster/src/Service/CloudClusterServiceInterface.php 0 → 100644 +19 −0 Original line number Diff line number Diff line <?php namespace Drupal\cloud_cluster\Service; /** * Provides K8sService interface. */ interface CloudClusterServiceInterface { public const CLOUD_CLUSTER_SUPPORTED_ENTITY_TYPES = [ 'aws_cloud_*', 'k8s_*', 'vmware_*', 'openstack_*', 'cloud_config', 'cloud_launch_template', ]; }