Skip to content
Snippets Groups Projects

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

1 file
+ 51
0
Compare changes
  • Side-by-side
  • Inline
@@ -3648,3 +3648,54 @@ function k8s_update_8348() {
@@ -3648,3 +3648,54 @@ function k8s_update_8348() {
\Drupal::service('cloud')->updateYmlDefinitions($files, 'k8s');
\Drupal::service('cloud')->updateYmlDefinitions($files, 'k8s');
drupal_flush_all_caches();
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
 
);
 
}
 
}
Loading