[ Cmii ] [ Octopus ] - update image tag
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package a_executor
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"wdd.io/agent-common/image"
|
||||
)
|
||||
@@ -270,7 +271,33 @@ func (op *AgentOsOperator) pushImageToTargetHarbor(funcArgs []string) (bool, []s
|
||||
targetImageFullName,
|
||||
}
|
||||
}
|
||||
|
||||
func (op *AgentOsOperator) updateImageTag(funcArgs []string) (bool, []string) {
|
||||
namespace := funcArgs[6]
|
||||
imageFullName := funcArgs[0]
|
||||
if !strings.HasPrefix(imageFullName, image.CmiiHarborPrefix) {
|
||||
return false, []string{
|
||||
"cant update this image !",
|
||||
}
|
||||
}
|
||||
appName := image.ImageFullNameToAppName(imageFullName)
|
||||
newTag := image.ImageFullNameToImageTag(imageFullName)
|
||||
|
||||
sprintf := fmt.Sprintf("start to update [%s] image tag [%s] to [%s]", namespace, appName, newTag)
|
||||
log.Info(sprintf)
|
||||
|
||||
update, resultLog := K8sDeploymentUpdateTag(namespace, appName, newTag)
|
||||
if !update {
|
||||
return false, []string{
|
||||
sprintf,
|
||||
}
|
||||
}
|
||||
return true, []string{
|
||||
resultLog,
|
||||
}
|
||||
}
|
||||
|
||||
func (op *AgentOsOperator) updateImageTagByFile(funcArgs []string) (bool, []string) {
|
||||
namespace := funcArgs[6]
|
||||
//targetImageFullName := funcArgs[7]
|
||||
proxyUrl := funcArgs[4]
|
||||
|
||||
Reference in New Issue
Block a user