mirror of https://github.com/knative/caching.git
Auto-update dependencies (#228)
Produced via: `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh` /assign n3wscott vagababov /cc n3wscott vagababov
This commit is contained in:
parent
435a8dc1b0
commit
f4321d939a
|
|
@ -966,7 +966,7 @@
|
|||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:af30f32b9caae9e7c28eb5223eef83b00f0b47b6dc0b2d3838f3c3204d50d23e"
|
||||
digest = "1:064cef5ec36970abc88e990be3e032b7bed5969201962d27d9e80982168b6664"
|
||||
name = "knative.dev/pkg"
|
||||
packages = [
|
||||
"apis",
|
||||
|
|
@ -986,7 +986,7 @@
|
|||
"reconciler",
|
||||
]
|
||||
pruneopts = "T"
|
||||
revision = "d1665814487e0f9a731e1874fce8d318918622f1"
|
||||
revision = "1327ff317946b1d98492b35655e761702db330ca"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
|
|
@ -997,7 +997,7 @@
|
|||
"tools/dep-collector",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "49c52045657f611c1f7da8c24cf47418e05bff3a"
|
||||
revision = "3cf9b305bb55cce84866bbf7e7fc4415adde01fb"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c"
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ type KubeClient struct {
|
|||
|
||||
// NewSpoofingClient returns a spoofing client to make requests
|
||||
func NewSpoofingClient(client *KubeClient, logf logging.FormatLogger, domain string, resolvable bool, opts ...spoof.TransportOption) (*spoof.SpoofingClient, error) {
|
||||
return spoof.New(client.Kube, logf, domain, resolvable, Flags.IngressEndpoint, opts...)
|
||||
return spoof.New(client.Kube, logf, domain, resolvable, Flags.IngressEndpoint, Flags.SpoofRequestInterval, Flags.SpoofRequestTimeout, opts...)
|
||||
}
|
||||
|
||||
// NewKubeClient instantiates and returns several clientsets required for making request to the
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import (
|
|||
"path"
|
||||
"sync"
|
||||
"text/template"
|
||||
"time"
|
||||
|
||||
"knative.dev/pkg/test/logging"
|
||||
)
|
||||
|
|
@ -46,13 +47,15 @@ var (
|
|||
|
||||
// EnvironmentFlags define the flags that are needed to run the e2e tests.
|
||||
type EnvironmentFlags struct {
|
||||
Cluster string // K8s cluster (defaults to cluster in kubeconfig)
|
||||
Kubeconfig string // Path to kubeconfig (defaults to ./kube/config)
|
||||
Namespace string // K8s namespace (blank by default, to be overwritten by test suite)
|
||||
IngressEndpoint string // Host to use for ingress endpoint
|
||||
ImageTemplate string // Template to build the image reference (defaults to {{.Repository}}/{{.Name}}:{{.Tag}})
|
||||
DockerRepo string // Docker repo (defaults to $KO_DOCKER_REPO)
|
||||
Tag string // Tag for test images
|
||||
Cluster string // K8s cluster (defaults to cluster in kubeconfig)
|
||||
Kubeconfig string // Path to kubeconfig (defaults to ./kube/config)
|
||||
Namespace string // K8s namespace (blank by default, to be overwritten by test suite)
|
||||
IngressEndpoint string // Host to use for ingress endpoint
|
||||
ImageTemplate string // Template to build the image reference (defaults to {{.Repository}}/{{.Name}}:{{.Tag}})
|
||||
DockerRepo string // Docker repo (defaults to $KO_DOCKER_REPO)
|
||||
Tag string // Tag for test images
|
||||
SpoofRequestInterval time.Duration // SpoofRequestInterval is the interval between requests in SpoofingClient
|
||||
SpoofRequestTimeout time.Duration // SpoofRequestTimeout is the timeout for polling requests in SpoofingClient
|
||||
}
|
||||
|
||||
func initializeFlags() *EnvironmentFlags {
|
||||
|
|
@ -82,6 +85,12 @@ func initializeFlags() *EnvironmentFlags {
|
|||
flag.StringVar(&f.ImageTemplate, "imagetemplate", "{{.Repository}}/{{.Name}}:{{.Tag}}",
|
||||
"Provide a template to generate the reference to an image from the test. Defaults to `{{.Repository}}/{{.Name}}:{{.Tag}}`.")
|
||||
|
||||
flag.DurationVar(&f.SpoofRequestInterval, "spoofinterval", 1*time.Second,
|
||||
"Provide an interval between requests for the SpoofingClient")
|
||||
|
||||
flag.DurationVar(&f.SpoofRequestTimeout, "spooftimeout", 5*time.Minute,
|
||||
"Provide a request timeout for the SpoofingClient")
|
||||
|
||||
defaultRepo := os.Getenv("KO_DOCKER_REPO")
|
||||
flag.StringVar(&f.DockerRepo, "dockerrepo", defaultRepo,
|
||||
"Provide the uri of the docker repo you have uploaded the test image to using `uploadtestimage.sh`. Defaults to $KO_DOCKER_REPO")
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ func WaitForEndpointState(
|
|||
desc string,
|
||||
resolvable bool,
|
||||
opts ...interface{}) (*spoof.Response, error) {
|
||||
return WaitForEndpointStateWithTimeout(kubeClient, logf, url, inState, desc, resolvable, spoof.RequestTimeout, opts...)
|
||||
return WaitForEndpointStateWithTimeout(kubeClient, logf, url, inState, desc, resolvable, Flags.SpoofRequestTimeout, opts...)
|
||||
}
|
||||
|
||||
// WaitForEndpointStateWithTimeout will poll an endpoint until inState indicates the state is achieved
|
||||
|
|
|
|||
|
|
@ -39,9 +39,6 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
requestInterval = 1 * time.Second
|
||||
// RequestTimeout is the default timeout for the polling requests.
|
||||
RequestTimeout = 5 * time.Minute
|
||||
// Name of the temporary HTTP header that is added to http.Request to indicate that
|
||||
// it is a SpoofClient.Poll request. This header is removed before making call to backend.
|
||||
pollReqHeader = "X-Kn-Poll-Request-Do-Not-Trace"
|
||||
|
|
@ -107,6 +104,8 @@ func New(
|
|||
domain string,
|
||||
resolvable bool,
|
||||
endpointOverride string,
|
||||
requestInterval time.Duration,
|
||||
requestTimeout time.Duration,
|
||||
opts ...TransportOption) (*SpoofingClient, error) {
|
||||
endpoint, err := ResolveEndpoint(kubeClientset, domain, resolvable, endpointOverride)
|
||||
if err != nil {
|
||||
|
|
@ -140,7 +139,7 @@ func New(
|
|||
sc := SpoofingClient{
|
||||
Client: &http.Client{Transport: roundTripper},
|
||||
RequestInterval: requestInterval,
|
||||
RequestTimeout: RequestTimeout,
|
||||
RequestTimeout: requestTimeout,
|
||||
Logf: logf,
|
||||
}
|
||||
return &sc, nil
|
||||
|
|
|
|||
Loading…
Reference in New Issue