Merge branch 'develop' of ssh://amuz.es:29418/infra/octopus into develop
* 'develop' of ssh://amuz.es:29418/infra/octopus: nil ㅂㅓ그 수정 subnet 찾는 모드 추가 # Conflicts: # octopus-outside/main.go
This commit is contained in:
commit
2278737a0c
|
@ -180,7 +180,12 @@ func getSubnetIPInfo(ip net.IP, verbose bool) (gw net.IP, cidr uint64, linkname
|
|||
if verbose {
|
||||
fmt.Printf(" routing table %s\n", route.String())
|
||||
}
|
||||
if route.Dst.Contains(ip) {
|
||||
|
||||
if route.Dst == nil {
|
||||
if verbose {
|
||||
fmt.Printf(" - default gateway : no one!\n")
|
||||
}
|
||||
} else if route.Dst.Contains(ip) {
|
||||
if verbose {
|
||||
fmt.Printf(" - matched routing role : %s\n", route.String())
|
||||
}
|
||||
|
@ -191,13 +196,21 @@ func getSubnetIPInfo(ip net.IP, verbose bool) (gw net.IP, cidr uint64, linkname
|
|||
}
|
||||
}
|
||||
|
||||
if matchedRoute == nil {
|
||||
if verbose {
|
||||
fmt.Println(" - cannot getting routing rule")
|
||||
fmt.Println(" abandon this interface ")
|
||||
}
|
||||
continue
|
||||
}
|
||||
if cidrData, err := getCidr(*matchedRoute.Dst); err == nil {
|
||||
cidr = cidrData
|
||||
if verbose {
|
||||
fmt.Printf(" interface have a subnet routing rule. gateway: %s", matchedRoute)
|
||||
fmt.Println(" ok! matched ")
|
||||
}
|
||||
gw, cidr, linkname = matchedRoute.Gw, cidrData, attrs.Name
|
||||
gw, cidr, linkname = matchedRoute.Src, cidrData, attrs.Name
|
||||
break
|
||||
} else if verbose {
|
||||
fmt.Printf(" - cannot getting netmask : %s", err)
|
||||
fmt.Println(" abandon this interface ")
|
||||
|
@ -508,7 +521,7 @@ func main() {
|
|||
option = append(option, fmt.Sprintf("--setenv=GATEWAY_ADDR=%s", gw.String()))
|
||||
option = append(option, fmt.Sprintf("--machine=%s", nodeName))
|
||||
option = append(option, fmt.Sprintf("--directory=%s", filepath.Join(nodePath, "merge")))
|
||||
# option = append(option, "--keep-unit", "--register=yes", "--settings=override", "--private-users=1354956800:65536", "--private-users-chown")
|
||||
// option = append(option, "--keep-unit", "--register=yes", "--settings=override", "--private-users=1354956800:65536", "--private-users-chown")
|
||||
option = append(option, "--keep-unit", "--register=yes", "--settings=override")
|
||||
|
||||
for _, mountPoint := range config.MoundPoint {
|
||||
|
|
Loading…
Reference in New Issue