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]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
digest = "1:af30f32b9caae9e7c28eb5223eef83b00f0b47b6dc0b2d3838f3c3204d50d23e"
|
digest = "1:064cef5ec36970abc88e990be3e032b7bed5969201962d27d9e80982168b6664"
|
||||||
name = "knative.dev/pkg"
|
name = "knative.dev/pkg"
|
||||||
packages = [
|
packages = [
|
||||||
"apis",
|
"apis",
|
||||||
|
|
@ -986,7 +986,7 @@
|
||||||
"reconciler",
|
"reconciler",
|
||||||
]
|
]
|
||||||
pruneopts = "T"
|
pruneopts = "T"
|
||||||
revision = "d1665814487e0f9a731e1874fce8d318918622f1"
|
revision = "1327ff317946b1d98492b35655e761702db330ca"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
|
|
@ -997,7 +997,7 @@
|
||||||
"tools/dep-collector",
|
"tools/dep-collector",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "49c52045657f611c1f7da8c24cf47418e05bff3a"
|
revision = "3cf9b305bb55cce84866bbf7e7fc4415adde01fb"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c"
|
digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c"
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ type KubeClient struct {
|
||||||
|
|
||||||
// NewSpoofingClient returns a spoofing client to make requests
|
// 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) {
|
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
|
// NewKubeClient instantiates and returns several clientsets required for making request to the
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ import (
|
||||||
"path"
|
"path"
|
||||||
"sync"
|
"sync"
|
||||||
"text/template"
|
"text/template"
|
||||||
|
"time"
|
||||||
|
|
||||||
"knative.dev/pkg/test/logging"
|
"knative.dev/pkg/test/logging"
|
||||||
)
|
)
|
||||||
|
|
@ -46,13 +47,15 @@ var (
|
||||||
|
|
||||||
// EnvironmentFlags define the flags that are needed to run the e2e tests.
|
// EnvironmentFlags define the flags that are needed to run the e2e tests.
|
||||||
type EnvironmentFlags struct {
|
type EnvironmentFlags struct {
|
||||||
Cluster string // K8s cluster (defaults to cluster in kubeconfig)
|
Cluster string // K8s cluster (defaults to cluster in kubeconfig)
|
||||||
Kubeconfig string // Path to kubeconfig (defaults to ./kube/config)
|
Kubeconfig string // Path to kubeconfig (defaults to ./kube/config)
|
||||||
Namespace string // K8s namespace (blank by default, to be overwritten by test suite)
|
Namespace string // K8s namespace (blank by default, to be overwritten by test suite)
|
||||||
IngressEndpoint string // Host to use for ingress endpoint
|
IngressEndpoint string // Host to use for ingress endpoint
|
||||||
ImageTemplate string // Template to build the image reference (defaults to {{.Repository}}/{{.Name}}:{{.Tag}})
|
ImageTemplate string // Template to build the image reference (defaults to {{.Repository}}/{{.Name}}:{{.Tag}})
|
||||||
DockerRepo string // Docker repo (defaults to $KO_DOCKER_REPO)
|
DockerRepo string // Docker repo (defaults to $KO_DOCKER_REPO)
|
||||||
Tag string // Tag for test images
|
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 {
|
func initializeFlags() *EnvironmentFlags {
|
||||||
|
|
@ -82,6 +85,12 @@ func initializeFlags() *EnvironmentFlags {
|
||||||
flag.StringVar(&f.ImageTemplate, "imagetemplate", "{{.Repository}}/{{.Name}}:{{.Tag}}",
|
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}}`.")
|
"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")
|
defaultRepo := os.Getenv("KO_DOCKER_REPO")
|
||||||
flag.StringVar(&f.DockerRepo, "dockerrepo", defaultRepo,
|
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")
|
"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,
|
desc string,
|
||||||
resolvable bool,
|
resolvable bool,
|
||||||
opts ...interface{}) (*spoof.Response, error) {
|
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
|
// WaitForEndpointStateWithTimeout will poll an endpoint until inState indicates the state is achieved
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
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
|
// 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.
|
// it is a SpoofClient.Poll request. This header is removed before making call to backend.
|
||||||
pollReqHeader = "X-Kn-Poll-Request-Do-Not-Trace"
|
pollReqHeader = "X-Kn-Poll-Request-Do-Not-Trace"
|
||||||
|
|
@ -107,6 +104,8 @@ func New(
|
||||||
domain string,
|
domain string,
|
||||||
resolvable bool,
|
resolvable bool,
|
||||||
endpointOverride string,
|
endpointOverride string,
|
||||||
|
requestInterval time.Duration,
|
||||||
|
requestTimeout time.Duration,
|
||||||
opts ...TransportOption) (*SpoofingClient, error) {
|
opts ...TransportOption) (*SpoofingClient, error) {
|
||||||
endpoint, err := ResolveEndpoint(kubeClientset, domain, resolvable, endpointOverride)
|
endpoint, err := ResolveEndpoint(kubeClientset, domain, resolvable, endpointOverride)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -140,7 +139,7 @@ func New(
|
||||||
sc := SpoofingClient{
|
sc := SpoofingClient{
|
||||||
Client: &http.Client{Transport: roundTripper},
|
Client: &http.Client{Transport: roundTripper},
|
||||||
RequestInterval: requestInterval,
|
RequestInterval: requestInterval,
|
||||||
RequestTimeout: RequestTimeout,
|
RequestTimeout: requestTimeout,
|
||||||
Logf: logf,
|
Logf: logf,
|
||||||
}
|
}
|
||||||
return &sc, nil
|
return &sc, nil
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue