diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index d9ab31b8d..38b4bea4d 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -348,7 +348,8 @@ class ShixunsController < ApplicationController sub_type.each do |mirror| ShixunMirrorRepository.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror) # 实训子镜像服务配置 - ShixunServiceConfig.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror) + name = MirrorRepository.find_by(id: mirror).try(:name) #查看镜像是否有名称,如果没有名称就不用服务配置 + ShixunServiceConfig.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror) if name.present? end end @@ -422,6 +423,7 @@ class ShixunsController < ApplicationController # 超级管理员和运营人员才能保存 中间层服务器pod信息的配置 if current_user.admin? || current_user.business? @shixun.shixun_service_configs.destroy_all + logger.info("######service_config_params[:shixun_service_configs]:#{service_config_params[:shixun_service_configs]}") @shixun.shixun_service_configs.create!(service_config_params[:shixun_service_configs]) end rescue Exception => e