mirror of
https://github.com/rancher/os.git
synced 2025-09-01 14:48:55 +00:00
Go DNS patch based on build tag
This commit is contained in:
@@ -16,5 +16,5 @@ OUTPUT=${OUTPUT:-bin/ros}
|
|||||||
echo Building $OUTPUT
|
echo Building $OUTPUT
|
||||||
|
|
||||||
CONST="-X github.com/docker/docker/dockerversion.GitCommit=${COMMIT} -X github.com/docker/docker/dockerversion.Version=${DOCKER_PATCH_VERSION} -X github.com/docker/docker/dockerversion.BuildTime=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -X github.com/docker/docker/dockerversion.IAmStatic=true -X github.com/rancher/os/config.VERSION=${VERSION}"
|
CONST="-X github.com/docker/docker/dockerversion.GitCommit=${COMMIT} -X github.com/docker/docker/dockerversion.Version=${DOCKER_PATCH_VERSION} -X github.com/docker/docker/dockerversion.BuildTime=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -X github.com/docker/docker/dockerversion.IAmStatic=true -X github.com/rancher/os/config.VERSION=${VERSION}"
|
||||||
go build -tags "selinux cgo daemon netgo" -installsuffix netgo -ldflags "$CONST -linkmode external -extldflags -static" -o ${OUTPUT}
|
go build -tags "selinux cgo daemon netgo dnspatch" -installsuffix netgo -ldflags "$CONST -linkmode external -extldflags -static" -o ${OUTPUT}
|
||||||
strip --strip-all ${OUTPUT}
|
strip --strip-all ${OUTPUT}
|
||||||
|
@@ -4,7 +4,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -87,7 +86,7 @@ func loadFromNetwork(location string) ([]byte, error) {
|
|||||||
|
|
||||||
var err error
|
var err error
|
||||||
for i := 0; i < 300; i++ {
|
for i := 0; i < 300; i++ {
|
||||||
net.UpdateDnsConf()
|
updateDNSCache()
|
||||||
|
|
||||||
var resp *http.Response
|
var resp *http.Response
|
||||||
resp, err = http.Get(location)
|
resp, err = http.Get(location)
|
||||||
|
9
util/network/update_dns_cache.go
Normal file
9
util/network/update_dns_cache.go
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
// +build dnspatch
|
||||||
|
|
||||||
|
package network
|
||||||
|
|
||||||
|
import "net"
|
||||||
|
|
||||||
|
func updateDNSCache() {
|
||||||
|
net.UpdateDnsConf()
|
||||||
|
}
|
5
util/network/update_dns_cache_patched.go
Normal file
5
util/network/update_dns_cache_patched.go
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
// +build !dnspatch
|
||||||
|
|
||||||
|
package network
|
||||||
|
|
||||||
|
func updateDNSCache() {}
|
Reference in New Issue
Block a user