Skip to content
Snippets Groups Projects
Commit 58b732f5 authored by Takumaru Sekine's avatar Takumaru Sekine Committed by Yas Naoi
Browse files

Issue #3275736 by sekinet, yas: Fix the error "The YAML URL field needs to be installed"

parent ab656a69
Branches
Tags
4 merge requests!1759Issue #3356778: Release 5.1.1,!1679Issue #3349074: Fix the OpenStack Project create and edit form in SPA that "Member" cannot be saved due to a validation error,!1607Issue #3343582: Add the function to preview OpenStack stack in the SPA,!1032Issue #3284576: Release 5.0.0-alpha2
......@@ -3648,3 +3648,54 @@ function k8s_update_8348() {
\Drupal::service('cloud')->updateYmlDefinitions($files, 'k8s');
drupal_flush_all_caches();
}
/**
* Add yaml_url to each entity except k8s_schedule.
*/
function k8s_update_8349(): void {
$definition_update_manager = \Drupal::entityDefinitionUpdateManager();
$field = BaseFieldDefinition::create('string')
->setLabel(t('YAML URL'))
->setDescription(t('YAML URL.'));
$entities = [
'k8s_api_service',
'k8s_cluster_role',
'k8s_cluster_role_binding',
'k8s_config_map',
'k8s_cron_job',
'k8s_daemon_set',
'k8s_deployment',
'k8s_endpoint',
'k8s_event',
'k8s_horizontal_pod_autoscaler',
'k8s_ingress',
'k8s_job',
'k8s_limit_range',
'k8s_namespace',
'k8s_network_policy',
'k8s_node',
'k8s_persistent_volume',
'k8s_persistent_volume_claim',
'k8s_pod',
'k8s_priority_class',
'k8s_replica_set',
'k8s_resource_quota',
'k8s_role',
'k8s_role_binding',
'k8s_secret',
'k8s_storage_class',
'k8s_service_account',
'k8s_service',
'k8s_stateful_set',
];
foreach ($entities ?: [] as $entity) {
$definition_update_manager->installFieldStorageDefinition(
'yaml_url',
$entity,
'k8s',
$field
);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment