Skip to content
Snippets Groups Projects
Commit cac42fcb authored by xiaohua guan's avatar xiaohua guan Committed by Yas Naoi
Browse files

Issue #3221182 by Xiaohua Guan, yas: Add Cloud Orchestrator cloud service...

Issue #3221182 by Xiaohua Guan, yas: Add Cloud Orchestrator cloud service provider (QueueWorker) (Convert payload) (OpenStack entities)
parent af37d654
No related branches found
No related tags found
No related merge requests found
......@@ -351,3 +351,37 @@ function cloud_cluster_update_9011(): void {
drupal_flush_all_caches();
}
/**
* Add cloud_cluster_name and cloud_cluster_worker_name to openstack_* entities.
*/
function cloud_cluster_update_9012(): void {
$definition_update_manager = \Drupal::entityDefinitionUpdateManager();
$fields = [];
$fields['cloud_cluster_name'] = BaseFieldDefinition::create('string')
->setLabel(t('Cloud Orchestrator Name'))
->setDescription(t('The name of cloud orchestrator.'));
$fields['cloud_cluster_worker_name'] = BaseFieldDefinition::create('string')
->setLabel(t('Cloud Orchestrator Worker Name'))
->setDescription(t('The name of cloud orchestrator worker.'));
$entity_type_definitions = \Drupal::entityTypeManager()->getDefinitions();
foreach ($entity_type_definitions ?: [] as $entity_type_key => $entity_type_definition) {
if (!preg_match('/^openstack_[a-z_]+$/', $entity_type_key)) {
continue;
}
foreach ($fields as $name => $field) {
$definition_update_manager->installFieldStorageDefinition(
$name,
$entity_type_key,
'openstack',
$field
);
}
}
drupal_flush_all_caches();
}
......@@ -386,6 +386,7 @@ function cloud_cluster_get_supported_entity_types(): array {
'aws_cloud',
'k8s',
'vmware',
'openstack',
'cloud_config',
];
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment