Update go dependencies
This commit is contained in:
parent
2f8cbeb8fa
commit
23e7565ebc
396 changed files with 57233 additions and 47523 deletions
15
vendor/sigs.k8s.io/testing_frameworks/integration/apiserver.go
generated
vendored
15
vendor/sigs.k8s.io/testing_frameworks/integration/apiserver.go
generated
vendored
|
|
@ -71,6 +71,15 @@ type APIServer struct {
|
|||
// Start starts the apiserver, waits for it to come up, and returns an error,
|
||||
// if occurred.
|
||||
func (s *APIServer) Start() error {
|
||||
if s.processState == nil {
|
||||
if err := s.setProcessState(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return s.processState.Start(s.Out, s.Err)
|
||||
}
|
||||
|
||||
func (s *APIServer) setProcessState() error {
|
||||
if s.EtcdURL == nil {
|
||||
return fmt.Errorf("expected EtcdURL to be configured")
|
||||
}
|
||||
|
|
@ -110,11 +119,7 @@ func (s *APIServer) Start() error {
|
|||
s.processState.Args, err = internal.RenderTemplates(
|
||||
internal.DoAPIServerArgDefaulting(s.Args), s,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return s.processState.Start(s.Out, s.Err)
|
||||
return err
|
||||
}
|
||||
|
||||
// Stop stops this process gracefully, waits for its termination, and cleans up
|
||||
|
|
|
|||
15
vendor/sigs.k8s.io/testing_frameworks/integration/etcd.go
generated
vendored
15
vendor/sigs.k8s.io/testing_frameworks/integration/etcd.go
generated
vendored
|
|
@ -61,6 +61,15 @@ type Etcd struct {
|
|||
// Start starts the etcd, waits for it to come up, and returns an error, if one
|
||||
// occoured.
|
||||
func (e *Etcd) Start() error {
|
||||
if e.processState == nil {
|
||||
if err := e.setProcessState(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return e.processState.Start(e.Out, e.Err)
|
||||
}
|
||||
|
||||
func (e *Etcd) setProcessState() error {
|
||||
var err error
|
||||
|
||||
e.processState = &internal.ProcessState{}
|
||||
|
|
@ -88,11 +97,7 @@ func (e *Etcd) Start() error {
|
|||
e.processState.Args, err = internal.RenderTemplates(
|
||||
internal.DoEtcdArgDefaulting(e.Args), e,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return e.processState.Start(e.Out, e.Err)
|
||||
return err
|
||||
}
|
||||
|
||||
// Stop stops this process gracefully, waits for its termination, and cleans up
|
||||
|
|
|
|||
8
vendor/sigs.k8s.io/testing_frameworks/integration/internal/etcd.go
generated
vendored
8
vendor/sigs.k8s.io/testing_frameworks/integration/internal/etcd.go
generated
vendored
|
|
@ -1,6 +1,8 @@
|
|||
package internal
|
||||
|
||||
import "net/url"
|
||||
import (
|
||||
"net/url"
|
||||
)
|
||||
|
||||
var EtcdDefaultArgs = []string{
|
||||
"--listen-peer-urls=http://localhost:0",
|
||||
|
|
@ -28,9 +30,9 @@ func isSecureScheme(scheme string) bool {
|
|||
func GetEtcdStartMessage(listenUrl url.URL) string {
|
||||
if isSecureScheme(listenUrl.Scheme) {
|
||||
// https://github.com/coreos/etcd/blob/a7f1fbe00ec216fcb3a1919397a103b41dca8413/embed/serve.go#L167
|
||||
return "serving client requests on " + listenUrl.Hostname()
|
||||
return "serving client requests on "
|
||||
}
|
||||
|
||||
// https://github.com/coreos/etcd/blob/a7f1fbe00ec216fcb3a1919397a103b41dca8413/embed/serve.go#L124
|
||||
return "serving insecure client requests on " + listenUrl.Hostname()
|
||||
return "serving insecure client requests on "
|
||||
}
|
||||
|
|
|
|||
15
vendor/sigs.k8s.io/testing_frameworks/integration/internal/process.go
generated
vendored
15
vendor/sigs.k8s.io/testing_frameworks/integration/internal/process.go
generated
vendored
|
|
@ -4,11 +4,13 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/onsi/gomega/gbytes"
|
||||
|
|
@ -38,6 +40,10 @@ type ProcessState struct {
|
|||
// Deprecated: Use HealthCheckEndpoint in favour of StartMessage
|
||||
StartMessage string
|
||||
Args []string
|
||||
|
||||
// ready holds wether the process is currently in ready state (hit the ready condition) or not.
|
||||
// It will be set to true on a successful `Start()` and set to false on a successful `Stop()`
|
||||
ready bool
|
||||
}
|
||||
|
||||
type DefaultedProcessInput struct {
|
||||
|
|
@ -71,7 +77,7 @@ func DoDefaulting(
|
|||
}
|
||||
defaults.URL = url.URL{
|
||||
Scheme: "http",
|
||||
Host: fmt.Sprintf("%s:%d", host, port),
|
||||
Host: net.JoinHostPort(host, strconv.Itoa(port)),
|
||||
}
|
||||
} else {
|
||||
defaults.URL = *listenUrl
|
||||
|
|
@ -107,6 +113,10 @@ func DoDefaulting(
|
|||
type stopChannel chan struct{}
|
||||
|
||||
func (ps *ProcessState) Start(stdout, stderr io.Writer) (err error) {
|
||||
if ps.ready {
|
||||
return nil
|
||||
}
|
||||
|
||||
command := exec.Command(ps.Path, ps.Args...)
|
||||
|
||||
ready := make(chan bool)
|
||||
|
|
@ -131,6 +141,7 @@ func (ps *ProcessState) Start(stdout, stderr io.Writer) (err error) {
|
|||
|
||||
select {
|
||||
case <-ready:
|
||||
ps.ready = true
|
||||
return nil
|
||||
case <-timedOut:
|
||||
if pollerStopCh != nil {
|
||||
|
|
@ -194,7 +205,7 @@ func (ps *ProcessState) Stop() error {
|
|||
case <-timedOut:
|
||||
return fmt.Errorf("timeout waiting for process %s to stop", path.Base(ps.Path))
|
||||
}
|
||||
|
||||
ps.ready = false
|
||||
if ps.DirNeedsCleaning {
|
||||
return os.RemoveAll(ps.Dir)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue