[ Cmii ] [ Octopus ] - add all image tag back up; add socks5 proxy
This commit is contained in:
@@ -99,6 +99,40 @@ func (deploy CmiiDeploymentInterface) Convert(deployment v1.Deployment) CmiiDepl
|
||||
return deploy
|
||||
}
|
||||
|
||||
func (deploy CmiiDeploymentInterface) ConvertFromStatefulSet(statefulSet v1.StatefulSet) CmiiDeploymentInterface {
|
||||
containers := statefulSet.Spec.Template.Spec.Containers
|
||||
|
||||
containerImageMap := make(map[string]string, len(containers))
|
||||
if len(containers) > 1 {
|
||||
log.WarnF("[CmiiDeploymentInterface ConvertFromStatefulSet] - statefulSet [%s] [%s] container greater than one !", statefulSet.Namespace, statefulSet.Name)
|
||||
}
|
||||
for _, container := range containers {
|
||||
containerImageMap[container.Name] = container.Image
|
||||
deploy.Image = container.Image
|
||||
deploy.ContainerName = container.Name
|
||||
deploy.ImageTag = strings.Split(container.Image, ":")[1]
|
||||
|
||||
for _, envVar := range container.Env {
|
||||
if strings.HasPrefix(envVar.Name, "GIT_BRANCH") {
|
||||
deploy.GitBranch = envVar.Value
|
||||
}
|
||||
|
||||
if strings.HasPrefix(envVar.Name, "GIT_COMMIT") {
|
||||
deploy.GitCommit = envVar.Value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
deploy.Name = statefulSet.Name
|
||||
deploy.Namespace = statefulSet.Namespace
|
||||
deploy.AvailableReplicas = statefulSet.Status.AvailableReplicas
|
||||
deploy.Replicas = *statefulSet.Spec.Replicas
|
||||
deploy.ContainerImageMap = containerImageMap
|
||||
deploy.StatusOk = statefulSet.Status.AvailableReplicas == *statefulSet.Spec.Replicas
|
||||
|
||||
return deploy
|
||||
}
|
||||
|
||||
func (pod CmiiPodInterface) Convert(podDetail corev1.Pod) CmiiPodInterface {
|
||||
|
||||
containers := podDetail.Spec.Containers
|
||||
|
||||
Reference in New Issue
Block a user