diff --git a/module/instance/model.php b/module/instance/model.php index cbcf558e94..1a5aeb145b 100644 --- a/module/instance/model.php +++ b/module/instance/model.php @@ -1114,8 +1114,7 @@ class instanceModel extends model if(empty($tempMappings)) return; $pipeline = new stdclass(); - $instance->type = $instance->chart; - $pipeline->type = $instance->type == 'nexus3' ? 'nexus' : $instance->type; + $pipeline->type = $instance->chart == 'nexus3' ? 'nexus' : $instance->chart; $pipeline->private = md5(strval(rand(10,113450))); $pipeline->createdBy = 'system'; $pipeline->createdDate = helper::now(); @@ -1142,7 +1141,7 @@ class instanceModel extends model public function generatePipelineName(object $instance): string { $name = $instance->name; - $type = $instance->type; + $type = $instance->chart; if(empty($this->loadModel('pipeline')->getByNameAndType($name, $type))) return $name; if(empty($this->loadModel('pipeline')->getByNameAndType($name . '-' . $instance->appVersion, $type))) return $name . '-' . $instance->appVersion; diff --git a/module/instance/zen.php b/module/instance/zen.php index 3eafa07a41..3ce7972b72 100644 --- a/module/instance/zen.php +++ b/module/instance/zen.php @@ -53,27 +53,6 @@ class instanceZen extends instance $this->view->backupList = $this->instance->backupList($instance); } - /** - * 自动保存devops应用授权信息。 - * Auto save auth info of devops. - * - * @param object $instance - * @access protected - * @return string - */ - protected function generatePipelineName(object $instance): string - { - $name = $instance->name; - $type = $instance->type; - if(empty($this->loadModel('pipeline')->getByNameAndType($name, $type))) return $name; - if(empty($this->loadModel('pipeline')->getByNameAndType($name . '-' . $instance->appVersion, $type))) return $name . '-' . $instance->appVersion; - - for($times = 1; $times < 5; $times ++) - { - if(empty($this->loadModel('pipeline')->getByNameAndType($name . '-' . $times, $name))) return $name . '-' . $times; - } - } - /** * 检查安装应用时数据合法性 * Check for install.