Merge pull request #3686 from Shopify/dbg-tool

Add debug binary to the docker image
This commit is contained in:
Kubernetes Prow Robot 2019-02-11 07:27:15 -08:00 committed by GitHub
commit 9ba67992be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 4356 additions and 34 deletions

View file

@ -22,6 +22,7 @@ import (
"fmt"
"io/ioutil"
"net/http"
"os"
"time"
"github.com/tv42/httpunix"
@ -87,6 +88,21 @@ func NewPostStatusRequest(path, contentType string, data interface{}) (int, []by
return res.StatusCode, body, nil
}
// ReadNginxConf reads the nginx configuration file into a string
func ReadNginxConf() (string, error) {
confFile, err := os.Open("/etc/nginx/nginx.conf")
if err != nil {
return "", err
}
defer confFile.Close()
contents, err := ioutil.ReadAll(confFile)
if err != nil {
return "", err
}
return string(contents), nil
}
func buildUnixSocketClient() *http.Client {
u := &httpunix.Transport{
DialTimeout: 1 * time.Second,