diff --git a/Gopkg.lock b/Gopkg.lock index fbdbf9e2..b05e32d2 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -933,7 +933,7 @@ [[projects]] branch = "master" - digest = "1:2cc284a39bc41da614158a089ed2e976cd5461a93ede77f52263c1f3370995c2" + digest = "1:5ca4167264dc0212a6d38d700ec305125f38af525371465b5ad3367178bc20b4" name = "knative.dev/pkg" packages = [ "apis", @@ -952,18 +952,18 @@ "metrics/metricskey", ] pruneopts = "T" - revision = "3732de5802012193835c9fe65436b761ed3fecea" + revision = "340e3aefcd4b731170fc27a72ebdc273c87ae93a" [[projects]] branch = "master" - digest = "1:d98cbeb7a88cc866d8353ffec3116baf6397669bde5ceb4caccf540e8cacc496" + digest = "1:5299d75a2b08a91c54ffb8b76afe21eb5f1ecf7bc4d67b859fc081f9415452bc" name = "knative.dev/test-infra" packages = [ "scripts", "tools/dep-collector", ] pruneopts = "UT" - revision = "34a629e61afcc53b94725894cdc4caf70b536ee1" + revision = "6c8da588aaa3d2bff76a9c37fd6ac5c9a6c02c09" [[projects]] digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c" diff --git a/vendor/knative.dev/pkg/Gopkg.lock b/vendor/knative.dev/pkg/Gopkg.lock index bf513fbc..f7541218 100644 --- a/vendor/knative.dev/pkg/Gopkg.lock +++ b/vendor/knative.dev/pkg/Gopkg.lock @@ -1337,6 +1337,7 @@ "k8s.io/api/admissionregistration/v1beta1", "k8s.io/api/apps/v1", "k8s.io/api/authentication/v1", + "k8s.io/api/autoscaling/v2beta1", "k8s.io/api/batch/v1", "k8s.io/api/core/v1", "k8s.io/api/extensions/v1beta1", @@ -1382,6 +1383,8 @@ "k8s.io/client-go/kubernetes/fake", "k8s.io/client-go/kubernetes/scheme", "k8s.io/client-go/kubernetes/typed/core/v1", + "k8s.io/client-go/listers/apps/v1", + "k8s.io/client-go/listers/autoscaling/v2beta1", "k8s.io/client-go/listers/core/v1", "k8s.io/client-go/plugin/pkg/client/auth/gcp", "k8s.io/client-go/rest", diff --git a/vendor/knative.dev/pkg/OWNERS_ALIASES b/vendor/knative.dev/pkg/OWNERS_ALIASES index 52cfdb2b..40c15c79 100644 --- a/vendor/knative.dev/pkg/OWNERS_ALIASES +++ b/vendor/knative.dev/pkg/OWNERS_ALIASES @@ -3,10 +3,12 @@ aliases: - evankanderson - mattmoor - vaikas-google + - vaikas apis-approvers: - mattmoor - vaikas-google + - vaikas - n3wscott apis-istio-approvers: @@ -15,10 +17,12 @@ aliases: apis-duck-approvers: - mattmoor - vaikas-google + - vaikas cloudevents-approvers: - n3wscott - vaikas-google + - vaikas configmap-approvers: - mattmoor @@ -65,6 +69,7 @@ aliases: source-approvers: - n3wscott - vaikas-google + - vaikas webhook-approvers: - mattmoor diff --git a/vendor/knative.dev/pkg/test/junit/junit.go b/vendor/knative.dev/pkg/test/junit/junit.go new file mode 100644 index 00000000..898de62e --- /dev/null +++ b/vendor/knative.dev/pkg/test/junit/junit.go @@ -0,0 +1,142 @@ +/* +Copyright 2019 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// junit.go defines types and functions specific to manipulating junit test result XML files + +package junit + +import ( + "encoding/xml" + "fmt" +) + +// TestStatusEnum is a enum for test result status +type TestStatusEnum string + +const ( + // Failed means junit test failed + Failed TestStatusEnum = "failed" + // Skipped means junit test skipped + Skipped TestStatusEnum = "skipped" + // Passed means junit test passed + Passed TestStatusEnum = "passed" +) + +// TestSuites holds a list of TestSuite results +type TestSuites struct { + XMLName xml.Name `xml:"testsuites"` + Suites []TestSuite `xml:"testsuite"` +} + +// TestSuite holds results +type TestSuite struct { + XMLName xml.Name `xml:"testsuite"` + Name string `xml:"name,attr"` + Time float64 `xml:"time,attr"` // Seconds + Failures int `xml:"failures,attr"` + Tests int `xml:"tests,attr"` + TestCases []TestCase `xml:"testcase"` + Properties TestProperties `xml:"properties"` +} + +// TestCase holds results +type TestCase struct { + Name string `xml:"name,attr"` + Time float64 `xml:"time,attr"` // Seconds + ClassName string `xml:"classname,attr"` + Failure *string `xml:"failure,omitempty"` + Output *string `xml:"system-out,omitempty"` + Error *string `xml:"system-err,omitempty"` + Skipped *string `xml:"skipped,omitempty"` + Properties TestProperties `xml:"properties"` +} + +// TestProperties is an array of test properties +type TestProperties struct { + Properties []TestProperty `xml:"property"` +} + +// TestProperty defines a property of the test +type TestProperty struct { + Name string `xml:"name,attr"` + Value string `xml:"value,attr"` +} + +// GetTestStatus returns the test status as a string +func (testCase *TestCase) GetTestStatus() TestStatusEnum { + testStatus := Passed + switch { + case testCase.Failure != nil: + testStatus = Failed + case testCase.Skipped != nil: + testStatus = Skipped + } + return testStatus +} + +// AddProperty adds property to testcase +func (testCase *TestCase) AddProperty(name, val string) { + property := TestProperty{Name: name, Value: val} + testCase.Properties.Properties = append(testCase.Properties.Properties, property) +} + +// AddTestCase adds a testcase to the testsuite +func (ts *TestSuite) AddTestCase(tc TestCase) { + ts.TestCases = append(ts.TestCases, tc) +} + +// GetTestSuite gets TestSuite struct by name +func (testSuites *TestSuites) GetTestSuite(suiteName string) (*TestSuite, error) { + for _, testSuite := range testSuites.Suites { + if testSuite.Name == suiteName { + return &testSuite, nil + } + } + return nil, fmt.Errorf("Test suite '%s' not found", suiteName) +} + +// AddTestSuite adds TestSuite to TestSuites +func (testSuites *TestSuites) AddTestSuite(testSuite *TestSuite) error { + if _, err := testSuites.GetTestSuite(testSuite.Name); err == nil { + return fmt.Errorf("Test suite '%s' already exists", testSuite.Name) + } + testSuites.Suites = append(testSuites.Suites, *testSuite) + return nil +} + +// ToBytes converts TestSuites struct to bytes array +func (testSuites *TestSuites) ToBytes(prefix, indent string) ([]byte, error) { + return xml.MarshalIndent(testSuites, prefix, indent) +} + +// UnMarshal converts bytes array to TestSuites struct, +// it works with both TestSuites and TestSuite structs, if +// input is a TestSuite struct it will still return a TestSuites +// struct, which is an empty wrapper TestSuites containing only +// the input Suite +func UnMarshal(buf []byte) (*TestSuites, error) { + var testSuites TestSuites + if err := xml.Unmarshal(buf, &testSuites); err == nil { + return &testSuites, nil + } + + // The input might be a TestSuite if reach here, try parsing with TestSuite + testSuites.Suites = append([]TestSuite(nil), TestSuite{}) + if err := xml.Unmarshal(buf, &testSuites.Suites[0]); err != nil { + return nil, err + } + return &testSuites, nil +} diff --git a/vendor/knative.dev/pkg/webhook/certificates/certificates.go b/vendor/knative.dev/pkg/webhook/certificates/certificates.go new file mode 100644 index 00000000..a05f38e4 --- /dev/null +++ b/vendor/knative.dev/pkg/webhook/certificates/certificates.go @@ -0,0 +1,84 @@ +/* +Copyright 2019 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package certificates + +import ( + "context" + + apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/client-go/kubernetes" + corelisters "k8s.io/client-go/listers/core/v1" + "knative.dev/pkg/controller" + "knative.dev/pkg/logging" + "knative.dev/pkg/system" + certresources "knative.dev/pkg/webhook/certificates/resources" +) + +type reconciler struct { + client kubernetes.Interface + secretlister corelisters.SecretLister + secretName string + serviceName string +} + +var _ controller.Reconciler = (*reconciler)(nil) + +// Reconcile implements controller.Reconciler +func (r *reconciler) Reconcile(ctx context.Context, key string) error { + return r.reconcileCertificate(ctx) +} + +func (r *reconciler) reconcileCertificate(ctx context.Context) error { + logger := logging.FromContext(ctx) + + secret, err := r.secretlister.Secrets(system.Namespace()).Get(r.secretName) + if apierrors.IsNotFound(err) { + secret, err = certresources.MakeSecret(ctx, r.secretName, system.Namespace(), r.serviceName) + if err != nil { + return err + } + secret, err = r.client.CoreV1().Secrets(secret.Namespace).Create(secret) + if err != nil { + return err + } + } else if err != nil { + logger.Errorf("error accessing certificate secret %q: %v", r.secretName, err) + return err + } + + if _, haskey := secret.Data[certresources.ServerKey]; !haskey { + logger.Infof("Certificate secret %q is missing key %q", r.secretName, certresources.ServerKey) + } else if _, haskey := secret.Data[certresources.ServerCert]; !haskey { + logger.Infof("Certificate secret %q is missing key %q", r.secretName, certresources.ServerCert) + } else if _, haskey := secret.Data[certresources.CACert]; !haskey { + logger.Infof("Certificate secret %q is missing key %q", r.secretName, certresources.CACert) + } else { + // It has all of the keys, it's good. + return nil + } + // Don't modify the informer copy. + secret = secret.DeepCopy() + + // One of the secret's keys is missing, so synthesize a new one and update the secret. + newSecret, err := certresources.MakeSecret(ctx, r.secretName, system.Namespace(), r.serviceName) + if err != nil { + return err + } + secret.Data = newSecret.Data + _, err = r.client.CoreV1().Secrets(secret.Namespace).Update(secret) + return err +} diff --git a/vendor/knative.dev/pkg/webhook/certificates/controller.go b/vendor/knative.dev/pkg/webhook/certificates/controller.go new file mode 100644 index 00000000..43a7b60a --- /dev/null +++ b/vendor/knative.dev/pkg/webhook/certificates/controller.go @@ -0,0 +1,67 @@ +/* +Copyright 2019 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package certificates + +import ( + "context" + + // Injection stuff + kubeclient "knative.dev/pkg/client/injection/kube/client" + secretinformer "knative.dev/pkg/client/injection/kube/informers/core/v1/secret" + + "k8s.io/client-go/tools/cache" + "knative.dev/pkg/configmap" + "knative.dev/pkg/controller" + "knative.dev/pkg/logging" + "knative.dev/pkg/system" + "knative.dev/pkg/webhook" +) + +// NewController constructs a controller for materializing webhook certificates. +// In order for it to bootstrap, an empty secret should be created with the +// expected name (and lifecycle managed accordingly), and thereafter this controller +// will ensure it has the appropriate shape for the webhook. +func NewController( + ctx context.Context, + cmw configmap.Watcher, +) *controller.Impl { + + client := kubeclient.Get(ctx) + secretInformer := secretinformer.Get(ctx) + options := webhook.GetOptions(ctx) + + wh := &reconciler{ + secretName: options.SecretName, + serviceName: options.ServiceName, + + client: client, + secretlister: secretInformer.Lister(), + } + + logger := logging.FromContext(ctx) + c := controller.NewImpl(wh, logger, "WebhookCertificates") + + // Reconcile when the cert bundle changes. + secretInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{ + FilterFunc: controller.FilterWithNameAndNamespace(system.Namespace(), wh.secretName), + // It doesn't matter what we enqueue because we will always Reconcile + // the named MWH resource. + Handler: controller.HandleAll(c.Enqueue), + }) + + return c +} diff --git a/vendor/knative.dev/pkg/webhook/certificates/resources/secret.go b/vendor/knative.dev/pkg/webhook/certificates/resources/secret.go index c5494e2e..154ebcd6 100644 --- a/vendor/knative.dev/pkg/webhook/certificates/resources/secret.go +++ b/vendor/knative.dev/pkg/webhook/certificates/resources/secret.go @@ -35,7 +35,11 @@ const ( // MakeSecret synthesizes a Kubernetes Secret object with the keys specified by // ServerKey, ServerCert, and CACert populated with a fresh certificate. -func MakeSecret(ctx context.Context, name, namespace, serviceName string) (*corev1.Secret, error) { +// This is mutable to make deterministic testing possible. +var MakeSecret = MakeSecretInternal + +// MakeSecretInternal is only public so MakeSecret can be restored in testing. Use MakeSecret. +func MakeSecretInternal(ctx context.Context, name, namespace, serviceName string) (*corev1.Secret, error) { serverKey, serverCert, caCert, err := CreateCerts(ctx, serviceName, namespace) if err != nil { return nil, err diff --git a/vendor/knative.dev/pkg/webhook/testing/factory.go b/vendor/knative.dev/pkg/webhook/testing/factory.go new file mode 100644 index 00000000..2347a935 --- /dev/null +++ b/vendor/knative.dev/pkg/webhook/testing/factory.go @@ -0,0 +1,140 @@ +/* +Copyright 2019 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package testing + +import ( + "context" + "encoding/json" + "testing" + + fakesharedclient "knative.dev/pkg/client/injection/client/fake" + fakekubeclient "knative.dev/pkg/client/injection/kube/client/fake" + fakedynamicclient "knative.dev/pkg/injection/clients/dynamicclient/fake" + + "knative.dev/pkg/configmap" + "knative.dev/pkg/controller" + "knative.dev/pkg/logging" + logtesting "knative.dev/pkg/logging/testing" + + "k8s.io/apimachinery/pkg/api/meta" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + ktesting "k8s.io/client-go/testing" + "k8s.io/client-go/tools/record" + + rtesting "knative.dev/pkg/reconciler/testing" +) + +const ( + // maxEventBufferSize is the estimated max number of event notifications that + // can be buffered during reconciliation. + maxEventBufferSize = 10 +) + +// Ctor functions create a k8s controller with given params. +type Ctor func(context.Context, *Listers, configmap.Watcher) controller.Reconciler + +// MakeFactory creates a reconciler factory with fake clients and controller created by `ctor`. +func MakeFactory(ctor Ctor) rtesting.Factory { + return func(t *testing.T, r *rtesting.TableRow) ( + controller.Reconciler, rtesting.ActionRecorderList, rtesting.EventList, *rtesting.FakeStatsReporter) { + ls := NewListers(r.Objects) + + ctx := r.Ctx + if ctx == nil { + ctx = context.Background() + } + logger := logtesting.TestLogger(t) + ctx = logging.WithLogger(ctx, logger) + + ctx, kubeClient := fakekubeclient.With(ctx, ls.GetKubeObjects()...) + ctx, sharedClient := fakesharedclient.With(ctx, ls.GetSharedObjects()...) + ctx, dynamicClient := fakedynamicclient.With(ctx, + ls.NewScheme(), ToUnstructured(t, ls.NewScheme(), r.Objects)...) + + // The dynamic client's support for patching is BS. Implement it + // here via PrependReactor (this can be overridden below by the + // provided reactors). + dynamicClient.PrependReactor("patch", "*", + func(action ktesting.Action) (bool, runtime.Object, error) { + return true, nil, nil + }) + + eventRecorder := record.NewFakeRecorder(maxEventBufferSize) + ctx = controller.WithEventRecorder(ctx, eventRecorder) + statsReporter := &rtesting.FakeStatsReporter{} + + // This is needed for the tests that use generated names and + // the object cannot be created beforehand. + kubeClient.PrependReactor("create", "*", + func(action ktesting.Action) (bool, runtime.Object, error) { + ca := action.(ktesting.CreateAction) + ls.IndexerFor(ca.GetObject()).Add(ca.GetObject()) + return false, nil, nil + }, + ) + + // Set up our Controller from the fakes. + c := ctor(ctx, &ls, configmap.NewStaticWatcher()) + // Update the context with the stuff we decorated it with. + r.Ctx = ctx + + for _, reactor := range r.WithReactors { + kubeClient.PrependReactor("*", "*", reactor) + sharedClient.PrependReactor("*", "*", reactor) + dynamicClient.PrependReactor("*", "*", reactor) + } + + actionRecorderList := rtesting.ActionRecorderList{sharedClient, dynamicClient, kubeClient} + eventList := rtesting.EventList{Recorder: eventRecorder} + + return c, actionRecorderList, eventList, statsReporter + } +} + +// ToUnstructured takes a list of k8s resources and converts them to +// Unstructured objects. +// We must pass objects as Unstructured to the dynamic client fake, or it +// won't handle them properly. +func ToUnstructured(t *testing.T, sch *runtime.Scheme, objs []runtime.Object) (us []runtime.Object) { + for _, obj := range objs { + obj = obj.DeepCopyObject() // Don't mess with the primary copy + // Determine and set the TypeMeta for this object based on our test scheme. + gvks, _, err := sch.ObjectKinds(obj) + if err != nil { + t.Fatalf("Unable to determine kind for type: %v", err) + } + apiv, k := gvks[0].ToAPIVersionAndKind() + ta, err := meta.TypeAccessor(obj) + if err != nil { + t.Fatalf("Unable to create type accessor: %v", err) + } + ta.SetAPIVersion(apiv) + ta.SetKind(k) + + b, err := json.Marshal(obj) + if err != nil { + t.Fatalf("Unable to marshal: %v", err) + } + u := &unstructured.Unstructured{} + if err := json.Unmarshal(b, u); err != nil { + t.Fatalf("Unable to unmarshal: %v", err) + } + us = append(us, u) + } + return +} diff --git a/vendor/knative.dev/pkg/webhook/testing/listers.go b/vendor/knative.dev/pkg/webhook/testing/listers.go new file mode 100644 index 00000000..41246af2 --- /dev/null +++ b/vendor/knative.dev/pkg/webhook/testing/listers.go @@ -0,0 +1,132 @@ +/* +Copyright 2019 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package testing + +import ( + appsv1 "k8s.io/api/apps/v1" + autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" + fakekubeclientset "k8s.io/client-go/kubernetes/fake" + appsv1listers "k8s.io/client-go/listers/apps/v1" + autoscalingv2beta1listers "k8s.io/client-go/listers/autoscaling/v2beta1" + corev1listers "k8s.io/client-go/listers/core/v1" + "k8s.io/client-go/tools/cache" + istiov1alpha3 "knative.dev/pkg/apis/istio/v1alpha3" + fakesharedclientset "knative.dev/pkg/client/clientset/versioned/fake" + istiolisters "knative.dev/pkg/client/listers/istio/v1alpha3" + "knative.dev/pkg/reconciler/testing" +) + +var clientSetSchemes = []func(*runtime.Scheme) error{ + fakekubeclientset.AddToScheme, + fakesharedclientset.AddToScheme, + autoscalingv2beta1.AddToScheme, +} + +// Listers is used to synthesize informer-style Listers from fixed lists of resources in tests. +type Listers struct { + sorter testing.ObjectSorter +} + +// NewListers constructs a Listers from a collection of objects. +func NewListers(objs []runtime.Object) Listers { + scheme := NewScheme() + + ls := Listers{ + sorter: testing.NewObjectSorter(scheme), + } + + ls.sorter.AddObjects(objs...) + + return ls +} + +// NewScheme constructs a scheme from the set of client schemes supported by this package. +func NewScheme() *runtime.Scheme { + scheme := runtime.NewScheme() + + for _, addTo := range clientSetSchemes { + addTo(scheme) + } + return scheme +} + +// NewScheme constructs a scheme from the set of client schemes supported by this lister. +func (*Listers) NewScheme() *runtime.Scheme { + return NewScheme() +} + +// IndexerFor returns the indexer for the given object. +func (l *Listers) IndexerFor(obj runtime.Object) cache.Indexer { + return l.sorter.IndexerForObjectType(obj) +} + +// GetKubeObjects filters the Listers initial list of objects to built-in types +func (l *Listers) GetKubeObjects() []runtime.Object { + return l.sorter.ObjectsForSchemeFunc(fakekubeclientset.AddToScheme) +} + +// GetSharedObjects filters the Listers initial list of objects to types defined in knative/pkg +func (l *Listers) GetSharedObjects() []runtime.Object { + return l.sorter.ObjectsForSchemeFunc(fakesharedclientset.AddToScheme) +} + +// GetHorizontalPodAutoscalerLister gets lister for HorizontalPodAutoscaler resources. +func (l *Listers) GetHorizontalPodAutoscalerLister() autoscalingv2beta1listers.HorizontalPodAutoscalerLister { + return autoscalingv2beta1listers.NewHorizontalPodAutoscalerLister(l.IndexerFor(&autoscalingv2beta1.HorizontalPodAutoscaler{})) +} + +// GetVirtualServiceLister gets lister for Istio VirtualService resource. +func (l *Listers) GetVirtualServiceLister() istiolisters.VirtualServiceLister { + return istiolisters.NewVirtualServiceLister(l.IndexerFor(&istiov1alpha3.VirtualService{})) +} + +// GetGatewayLister gets lister for Istio Gateway resource. +func (l *Listers) GetGatewayLister() istiolisters.GatewayLister { + return istiolisters.NewGatewayLister(l.IndexerFor(&istiov1alpha3.Gateway{})) +} + +// GetDeploymentLister gets lister for K8s Deployment resource. +func (l *Listers) GetDeploymentLister() appsv1listers.DeploymentLister { + return appsv1listers.NewDeploymentLister(l.IndexerFor(&appsv1.Deployment{})) +} + +// GetK8sServiceLister gets lister for K8s Service resource. +func (l *Listers) GetK8sServiceLister() corev1listers.ServiceLister { + return corev1listers.NewServiceLister(l.IndexerFor(&corev1.Service{})) +} + +// GetEndpointsLister gets lister for K8s Endpoints resource. +func (l *Listers) GetEndpointsLister() corev1listers.EndpointsLister { + return corev1listers.NewEndpointsLister(l.IndexerFor(&corev1.Endpoints{})) +} + +// GetSecretLister gets lister for K8s Secret resource. +func (l *Listers) GetSecretLister() corev1listers.SecretLister { + return corev1listers.NewSecretLister(l.IndexerFor(&corev1.Secret{})) +} + +// GetConfigMapLister gets lister for K8s ConfigMap resource. +func (l *Listers) GetConfigMapLister() corev1listers.ConfigMapLister { + return corev1listers.NewConfigMapLister(l.IndexerFor(&corev1.ConfigMap{})) +} + +// GetNamespaceLister gets lister for Namespace resource. +func (l *Listers) GetNamespaceLister() corev1listers.NamespaceLister { + return corev1listers.NewNamespaceLister(l.IndexerFor(&corev1.Namespace{})) +} diff --git a/vendor/knative.dev/test-infra/scripts/e2e-tests.sh b/vendor/knative.dev/test-infra/scripts/e2e-tests.sh index 8ba80bbc..131ca54d 100755 --- a/vendor/knative.dev/test-infra/scripts/e2e-tests.sh +++ b/vendor/knative.dev/test-infra/scripts/e2e-tests.sh @@ -311,6 +311,7 @@ function create_test_cluster_with_retries() { [[ -z "$(grep -Fo 'does not have enough resources available to fulfill' ${cluster_creation_log})" \ && -z "$(grep -Fo 'ResponseError: code=400, message=No valid versions with the prefix' ${cluster_creation_log})" \ && -z "$(grep -Po 'ResponseError: code=400, message=Master version "[0-9a-z\-\.]+" is unsupported' ${cluster_creation_log})" ]] \ + && -z "$(grep -Po 'only \d+ nodes out of \d+ have registered; this is likely due to Nodes failing to start correctly' ${cluster_creation_log})" ]] \ && return 1 done done