* [misc] adjust instance init method for devops app.

This commit is contained in:
caoyanyi
2024-12-17 10:03:33 +08:00
committed by 刘刚
parent 55911b6e58
commit f9c5d8b602
2 changed files with 2 additions and 24 deletions
+2 -3
View File
@@ -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;