[ Cmii ] [ Octopus ] - add all image tag back up; add socks5 proxy

This commit is contained in:
zeaslity
2024-03-01 09:31:37 +08:00
parent 9d5ca4b50f
commit 52c360eb49
29 changed files with 2886 additions and 83 deletions

View File

@@ -426,6 +426,74 @@ func BackupAllCmiiDeploymentToMap(cmiiEnv string) (backendMap, frontendMap map[s
return backendMap, frontendMap
}
func BackUpAllCmiiAppImageNameFromEnv(cmiiEnv string) {
CmiiOperator.changeOperatorEnv(cmiiEnv)
filePath := "C:\\Users\\wddsh\\Documents\\IdeaProjects\\ProjectOctopus\\cmii_operator\\log\\images-" + CmiiOperator.CurrentNamespace + "-" + utils.TimeSplitFormatString() + ".txt"
only := make(map[string]string, 150)
// front
executor.BasicAppendContentToFile("---\n", filePath)
for key, value := range CmiiFrontendAppMap {
_, ok := only[key]
if !ok {
deploy := CmiiOperator.DeploymentOneInterface(cmiiEnv, key)
if deploy != nil {
only[key] = value
executor.BasicAppendContentToFile(deploy.Image+"\n", filePath)
}
}
}
executor.BasicAppendContentToFile("---\n", filePath)
for key, value := range CmiiBackendAppMap {
_, ok := only[key]
if !ok {
deploy := CmiiOperator.DeploymentOneInterface(cmiiEnv, key)
if deploy != nil {
only[key] = value
executor.BasicAppendContentToFile(deploy.Image+"\n", filePath)
}
}
}
// backend
executor.BasicAppendContentToFile("---\n", filePath)
// gis server
for key, value := range CmiiGISAppMap {
_, ok := only[key]
if !ok {
deploy := CmiiOperator.DeploymentOneInterface(cmiiEnv, key)
if deploy != nil {
only[key] = value
executor.BasicAppendContentToFile(deploy.Image+"\n", filePath)
}
}
}
// srs
executor.BasicAppendContentToFile("---\n", filePath)
for key, value := range CmiiSrsAppMap {
_, ok := only[key]
if !ok {
var app *CmiiDeploymentInterface
if strings.Contains(value, "deployment") {
app = CmiiOperator.DeploymentOneInterface(cmiiEnv, key)
if app != nil {
only[key] = value
executor.BasicAppendContentToFile(app.Image+"\n", filePath)
}
} else if strings.Contains(value, "state") {
app = CmiiOperator.StatefulSetOneInterface(cmiiEnv, key)
if app != nil {
only[key] = value
for _, image := range app.ContainerImageMap {
executor.BasicAppendContentToFile(image+"\n", filePath)
}
}
}
}
}
executor.BasicAppendContentToFile("---\n", filePath)
}
func FilterAllCmiiAppStrict(source []CmiiDeploymentInterface) (result []CmiiDeploymentInterface) {
for _, c := range source {