retry
This commit is contained in:
parent
628a734a37
commit
305f38a0ad
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
11
main.go
11
main.go
|
@ -199,9 +199,11 @@ func parseJSONVolumeMounts(jsonStr string) []string {
|
|||
var volumeMounts []string
|
||||
volumeData := strings.Split(jsonStr, "},{")
|
||||
for _, data := range volumeData {
|
||||
if strings.Contains(data, "\"Destination\"") {
|
||||
if strings.Contains(data, "\"Source\"") && strings.Contains(data, "\"Destination\"") {
|
||||
parts := strings.Split(data, "\"")
|
||||
volumeMounts = append(volumeMounts, parts[3]+":"+parts[7])
|
||||
source := parts[3]
|
||||
destination := parts[7]
|
||||
volumeMounts = append(volumeMounts, source+":"+destination)
|
||||
}
|
||||
}
|
||||
return volumeMounts
|
||||
|
@ -212,8 +214,9 @@ func parseJSONPorts(jsonStr string) []string {
|
|||
portData := strings.Split(jsonStr, "},{")
|
||||
for _, data := range portData {
|
||||
if strings.Contains(data, "\"HostPort\"") {
|
||||
hostPort := strings.Split(data, "\"")[3]
|
||||
containerPort := strings.Split(data, "\"")[7]
|
||||
parts := strings.Split(data, "\"")
|
||||
hostPort := parts[3]
|
||||
containerPort := strings.Split(parts[1], "/")[0]
|
||||
ports = append(ports, hostPort+":"+containerPort)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue