From aa9bd3961c44b5c8a772cf44dc5364d381d935cf Mon Sep 17 00:00:00 2001 From: Matt Moore Date: Wed, 26 Jun 2019 13:56:06 -0700 Subject: [PATCH] Migrate to knative.dev/pkg (#35) These changes done via: ``` sed -i 's@"github.com/knative/pkg@"knative.dev/pkg@g' $(find -name '*.go' | grep -v vendor | xargs grep github.com/knative/pkg | cut -d':' -f 1) ``` `Gopkg.toml`: - github.com/knative/pkg -> knative.dev/pkg - release-0.7 -> master `./hack/update-codegen.sh`: - github.com/knative/pkg -> knative.dev/pkg ``` ./hack/update-deps.sh ./hack/update-codegen.sh ``` --- Gopkg.lock | 68 +-- Gopkg.toml | 9 +- hack/update-codegen.sh | 2 +- pkg/apis/caching/v1alpha1/image_types.go | 4 +- pkg/apis/caching/v1alpha1/image_types_test.go | 2 +- pkg/apis/caching/v1alpha1/image_validation.go | 2 +- .../caching/v1alpha1/image_validation_test.go | 2 +- pkg/client/injection/client/client.go | 4 +- pkg/client/injection/client/fake/fake.go | 4 +- .../caching/factory/cachingfactory.go | 6 +- .../informers/caching/factory/fake/fake.go | 4 +- .../caching/v1alpha1/image/fake/fake.go | 4 +- .../informers/caching/v1alpha1/image/image.go | 6 +- vendor/github.com/golang/groupcache/LICENSE | 191 ++++++++ .../github.com/golang/groupcache/lru/lru.go | 133 +++++ .../pkg/.github/pull-request-template.md | 6 - .../knative/pkg/injection/controllers.go | 43 -- vendor/k8s.io/client-go/tools/record/doc.go | 18 + vendor/k8s.io/client-go/tools/record/event.go | 322 ++++++++++++ .../client-go/tools/record/events_cache.go | 462 ++++++++++++++++++ vendor/k8s.io/client-go/tools/record/fake.go | 58 +++ .../pkg/.gitattributes | 0 .../PULL_REQUEST_TEMPLATE/breaking-change.md | 22 + .../.github/PULL_REQUEST_TEMPLATE/bug-fix.md | 10 + .../PULL_REQUEST_TEMPLATE/normal-change.md | 8 + .../pkg/.github/issue-template.md | 0 .../knative => knative.dev}/pkg/.gitignore | 0 .../pkg/CONTRIBUTING.md | 0 .../pkg/DEVELOPMENT.md | 6 +- .../knative => knative.dev}/pkg/Gopkg.lock | 37 +- .../knative => knative.dev}/pkg/Gopkg.toml | 4 + .../knative => knative.dev}/pkg/LICENSE | 0 .../pkg/OWNERS_ALIASES | 0 .../knative => knative.dev}/pkg/README.md | 0 vendor/knative.dev/pkg/RELEASING.md | 91 ++++ .../pkg/apis/condition_set.go | 0 .../pkg/apis/condition_types.go | 0 .../pkg/apis/contexts.go | 34 +- .../pkg/apis/deprecated.go | 0 .../knative => knative.dev}/pkg/apis/doc.go | 0 .../pkg/apis/duck/cached.go | 0 .../pkg/apis/duck/doc.go | 0 .../pkg/apis/duck/enqueue.go | 0 .../pkg/apis/duck/interface.go | 0 .../pkg/apis/duck/patch.go | 0 .../pkg/apis/duck/proxy.go | 0 .../pkg/apis/duck/register.go | 0 .../pkg/apis/duck/typed.go | 64 ++- .../pkg/apis/duck/unstructured.go | 0 .../apis/duck/v1alpha1/addressable_types.go | 6 +- .../pkg/apis/duck/v1alpha1/condition_set.go | 2 +- .../apis/duck/v1alpha1/conditions_types.go | 4 +- .../pkg/apis/duck/v1alpha1/doc.go | 0 .../duck/v1alpha1/legacy_targetable_types.go | 4 +- .../pkg/apis/duck/v1alpha1/register.go | 2 +- .../duck/v1alpha1/retired_targetable_types.go | 4 +- .../duck/v1alpha1/zz_generated.deepcopy.go | 0 .../apis/duck/v1beta1/addressable_types.go | 4 +- .../pkg/apis/duck/v1beta1/doc.go | 0 .../pkg/apis/duck/v1beta1/register.go | 2 +- .../pkg/apis/duck/v1beta1/status_types.go | 4 +- .../duck/v1beta1/zz_generated.deepcopy.go | 2 +- .../pkg/apis/duck/verify.go | 2 +- .../pkg/apis/field_error.go | 2 +- .../pkg/apis/interfaces.go | 7 + .../pkg/apis/istio/authentication/register.go | 0 .../apis/istio/authentication/v1alpha1/doc.go | 0 .../authentication/v1alpha1/policy_types.go | 2 +- .../istio/authentication/v1alpha1/register.go | 2 +- .../v1alpha1/zz_generated.deepcopy.go | 2 +- .../pkg/apis/istio/common/v1alpha1/string.go | 0 .../pkg/apis/istio/register.go | 0 .../pkg/apis/istio/v1alpha3/README.md | 0 .../istio/v1alpha3/destinationrule_types.go | 0 .../pkg/apis/istio/v1alpha3/doc.go | 0 .../pkg/apis/istio/v1alpha3/gateway_types.go | 0 .../pkg/apis/istio/v1alpha3/register.go | 2 +- .../istio/v1alpha3/virtualservice_types.go | 2 +- .../istio/v1alpha3/zz_generated.deepcopy.go | 2 +- .../pkg/apis/kind2resource.go | 0 .../pkg/apis/metadata_validation.go | 0 .../pkg/apis/testing/conditions.go | 4 +- .../knative => knative.dev}/pkg/apis/url.go | 0 .../pkg/apis/volatile_time.go | 0 .../pkg/apis/zz_generated.deepcopy.go | 0 .../pkg/changeset/commit.go | 0 .../pkg/changeset/doc.go | 0 .../pkg/changeset/testdata/HEAD | 0 .../pkg/changeset/testdata/noncommitted/HEAD | 0 .../client/clientset/versioned/clientset.go | 4 +- .../pkg/client/clientset/versioned/doc.go | 0 .../versioned/fake/clientset_generated.go | 10 +- .../client/clientset/versioned/fake/doc.go | 0 .../clientset/versioned/fake/register.go | 4 +- .../client/clientset/versioned/scheme/doc.go | 0 .../clientset/versioned/scheme/register.go | 4 +- .../v1alpha1/authentication_client.go | 4 +- .../typed/authentication/v1alpha1/doc.go | 0 .../typed/authentication/v1alpha1/fake/doc.go | 0 .../fake/fake_authentication_client.go | 2 +- .../v1alpha1/fake/fake_policy.go | 2 +- .../v1alpha1/generated_expansion.go | 0 .../typed/authentication/v1alpha1/policy.go | 4 +- .../typed/istio/v1alpha3/destinationrule.go | 4 +- .../versioned/typed/istio/v1alpha3/doc.go | 0 .../typed/istio/v1alpha3/fake/doc.go | 0 .../v1alpha3/fake/fake_destinationrule.go | 2 +- .../typed/istio/v1alpha3/fake/fake_gateway.go | 2 +- .../istio/v1alpha3/fake/fake_istio_client.go | 2 +- .../v1alpha3/fake/fake_virtualservice.go | 2 +- .../versioned/typed/istio/v1alpha3/gateway.go | 4 +- .../istio/v1alpha3/generated_expansion.go | 0 .../typed/istio/v1alpha3/istio_client.go | 4 +- .../typed/istio/v1alpha3/virtualservice.go | 4 +- .../authentication/interface.go | 4 +- .../authentication/v1alpha1/interface.go | 2 +- .../authentication/v1alpha1/policy.go | 8 +- .../informers/externalversions/factory.go | 8 +- .../informers/externalversions/generic.go | 4 +- .../internalinterfaces/factory_interfaces.go | 2 +- .../externalversions/istio/interface.go | 4 +- .../istio/v1alpha3/destinationrule.go | 8 +- .../istio/v1alpha3/gateway.go | 8 +- .../istio/v1alpha3/interface.go | 2 +- .../istio/v1alpha3/virtualservice.go | 8 +- .../pkg/client/injection/client/client.go | 6 +- .../pkg/client/injection/client/fake/fake.go | 8 +- .../factory/authenticationfactory.go | 10 +- .../authentication}/factory/fake/fake.go | 10 +- .../v1alpha1/policy/fake/fake.go | 8 +- .../authentication/v1alpha1/policy/policy.go | 10 +- .../informers/istio}/factory/fake/fake.go | 10 +- .../informers/istio/factory/istiofactory.go | 10 +- .../destinationrule/destinationrule.go | 10 +- .../v1alpha3/destinationrule/fake/fake.go | 8 +- .../istio/v1alpha3/gateway/fake/fake.go | 8 +- .../istio/v1alpha3/gateway/gateway.go | 10 +- .../v1alpha3/virtualservice/fake/fake.go | 8 +- .../v1alpha3/virtualservice/virtualservice.go | 10 +- .../v1alpha1/expansion_generated.go | 0 .../listers/authentication/v1alpha1/policy.go | 2 +- .../listers/istio/v1alpha3/destinationrule.go | 2 +- .../istio/v1alpha3/expansion_generated.go | 0 .../client/listers/istio/v1alpha3/gateway.go | 2 +- .../listers/istio/v1alpha3/virtualservice.go | 2 +- .../pkg/cloudevents/README.md | 0 .../pkg/cloudevents/builder.go | 0 .../pkg/cloudevents/client.go | 0 .../pkg/cloudevents/doc.go | 0 .../pkg/cloudevents/encoding_binary.go | 0 .../pkg/cloudevents/encoding_structured.go | 0 .../pkg/cloudevents/event.go | 0 .../pkg/cloudevents/event_v01.go | 0 .../pkg/cloudevents/event_v02.go | 0 .../pkg/cloudevents/handler.go | 0 .../pkg/code-of-conduct.md | 0 .../codegen/cmd/injection-gen/args/args.go | 0 .../cmd/injection-gen/generators/client.go | 5 +- .../cmd/injection-gen/generators/factory.go | 7 +- .../injection-gen/generators/fakeclient.go | 5 +- .../injection-gen/generators/fakefactory.go | 5 +- .../injection-gen/generators/fakeinformer.go | 5 +- .../cmd/injection-gen/generators/informer.go | 7 +- .../injection-gen/generators/namesystems.go | 0 .../cmd/injection-gen/generators/packages.go | 2 +- .../pkg/codegen/cmd/injection-gen/main.go | 4 +- .../pkg/configmap/doc.go | 0 .../pkg/configmap/filter.go | 0 .../pkg/configmap/informed_watcher.go | 0 .../pkg/configmap/load.go | 0 .../pkg/configmap/manual_watcher.go | 0 .../pkg/configmap/static_watcher.go | 0 .../pkg/configmap/store.go | 3 + .../pkg/configmap/testing/configmap.go | 7 +- .../pkg/configmap/watcher.go | 0 .../pkg/controller/controller.go | 26 +- .../pkg/controller/helper.go | 2 +- .../pkg/controller/stats_reporter.go | 2 +- .../controller/testing/fake_stats_reporter.go | 0 .../pkg/hack/boilerplate/boilerplate.go.txt | 0 .../pkg/hack/generate-knative.sh | 0 .../pkg/hack/update-codegen.sh | 8 +- .../pkg/hack/update-deps.sh | 7 +- .../pkg/hack/verify-codegen.sh | 0 .../pkg/injection/README.md | 60 ++- .../pkg/injection/clients.go | 0 .../injection/clients/apiextclient/apiext.go | 49 ++ .../clients/apiextclient/fake/fake.go | 53 ++ .../clients/dynamicclient/dynamicclient.go | 6 +- .../clients/dynamicclient/fake/fake.go | 8 +- .../injection/clients/kubeclient/fake/fake.go | 8 +- .../clients/kubeclient/kubeclient.go | 6 +- .../pkg/injection/doc.go | 33 +- .../pkg/injection/factories.go | 0 .../pkg/injection/informers.go | 2 +- .../apiextensionsv1beta1/crd/crd.go | 52 ++ .../apiextensionsv1beta1/crd/fake/fake.go | 38 ++ .../apiextinformers/factory/factory.go | 53 ++ .../apiextinformers/factory/fake/fake.go | 40 ++ .../appsv1/deployment/deployment.go | 10 +- .../appsv1/deployment/fake/fake.go | 8 +- .../autoscalingv1/hpa/fake/fake.go | 8 +- .../kubeinformers/autoscalingv1/hpa/hpa.go | 10 +- .../autoscalingv2beta1/hpa/fake/fake.go | 8 +- .../autoscalingv2beta1/hpa/hpa.go | 10 +- .../kubeinformers/batchv1/job/fake/fake.go | 38 ++ .../kubeinformers/batchv1/job/job.go | 52 ++ .../corev1/configmap/configmap.go | 10 +- .../corev1/configmap/fake/fake.go | 8 +- .../corev1/endpoints/endpoints.go | 10 +- .../corev1/endpoints/fake/fake.go | 8 +- .../corev1/namespace/fake/fake.go | 38 ++ .../corev1/namespace/namespace.go | 52 ++ .../kubeinformers/corev1/pod/fake/fake.go | 38 ++ .../informers/kubeinformers/corev1/pod/pod.go | 52 ++ .../kubeinformers/corev1/secret/fake/fake.go | 8 +- .../kubeinformers/corev1/secret/secret.go | 10 +- .../kubeinformers/corev1/service/fake/fake.go | 8 +- .../kubeinformers/corev1/service/service.go | 10 +- .../corev1/serviceaccount/fake/fake.go | 38 ++ .../corev1/serviceaccount/service.go | 52 ++ .../kubeinformers/factory/factory.go | 10 +- .../kubeinformers/factory/fake/fake.go | 8 +- .../kubeinformers/rbacv1/role/fake/fake.go | 38 ++ .../kubeinformers/rbacv1/role/role.go | 52 ++ .../rbacv1/rolebinding/fake/fake.go | 38 ++ .../rbacv1/rolebinding/rolebinding.go | 52 ++ .../pkg/injection/interface.go | 20 +- .../pkg/injection/sharedmain/main.go | 44 +- .../pkg/kmeta/accessor.go | 0 .../knative => knative.dev}/pkg/kmeta/doc.go | 0 .../pkg/kmeta/labels.go | 0 vendor/knative.dev/pkg/kmeta/names.go | 41 ++ .../pkg/kmeta/owner_references.go | 0 .../knative => knative.dev}/pkg/kmp/diff.go | 0 .../knative => knative.dev}/pkg/kmp/doc.go | 0 .../pkg/kmp/reporters.go | 0 .../pkg/logging/config.go | 4 +- .../pkg/logging/logger.go | 0 .../pkg/logging/logkey/constants.go | 0 .../pkg/logging/testing/util.go | 2 +- .../pkg/logging/zz_generated.deepcopy.go | 0 .../pkg/metrics/config.go | 2 +- .../pkg/metrics/doc.go | 0 .../pkg/metrics/exporter.go | 0 .../pkg/metrics/gcp_metadata.go | 4 +- .../pkg/metrics/metricskey/constants.go | 0 .../pkg/metrics/monitored_resources.go | 2 +- .../pkg/metrics/prometheus_exporter.go | 0 .../pkg/metrics/record.go | 2 +- .../pkg/metrics/stackdriver_exporter.go | 2 +- .../pkg/metrics/testing/config.go | 2 +- .../knative => knative.dev}/pkg/ptr/doc.go | 0 .../knative => knative.dev}/pkg/ptr/ptr.go | 0 .../pkg/reconciler/testing/actions.go | 0 .../pkg/reconciler/testing/clock.go | 0 .../pkg/reconciler/testing/context.go | 35 ++ .../pkg/reconciler/testing/events.go | 0 .../testing/generate_name_reactor.go | 0 .../pkg/reconciler/testing/hooks.go | 0 .../pkg/reconciler/testing/reactions.go | 2 +- .../pkg/reconciler/testing/sorter.go | 0 .../pkg/reconciler/testing/stats.go | 0 .../pkg/reconciler/testing/table.go | 6 +- .../pkg/reconciler/testing/tracker.go | 2 +- .../pkg/reconciler/testing/util.go | 0 .../pkg/signals/signal.go | 0 .../pkg/signals/signal_posix.go | 0 .../pkg/signals/signal_windows.go | 0 .../pkg/system/clock.go | 0 .../pkg/system/names.go | 2 +- .../pkg/system/testing/names.go | 2 +- .../pkg/test/README.md | 0 .../pkg/test/cleanup.go | 2 +- .../pkg/test/clients.go | 4 +- .../knative => knative.dev}/pkg/test/crd.go | 0 .../pkg/test/e2e_flags.go | 0 .../pkg/test/helpers/data.go | 0 vendor/knative.dev/pkg/test/helpers/name.go | 36 ++ .../pkg/test/ingress/ingress.go | 0 .../pkg/test/kube_checks.go | 2 +- .../pkg/test/logging/logging.go | 2 +- vendor/knative.dev/pkg/test/logstream/doc.go | 21 + .../pkg/test/logstream/interface.go | 52 ++ .../pkg/test/logstream/kubelogs.go | 177 +++++++ vendor/knative.dev/pkg/test/logstream/null.go | 30 ++ .../pkg/test/monitoring/doc.go | 0 .../pkg/test/monitoring/monitoring.go | 2 +- .../pkg/test/presubmit-tests.sh | 0 .../pkg/test/request.go | 33 +- .../pkg/test/spoof/error_checks.go | 0 .../pkg/test/spoof/spoof.go | 6 +- .../pkg/test/zipkin/doc.go | 0 .../pkg/test/zipkin/util.go | 4 +- .../pkg/testing/doc.go | 0 .../pkg/testing/inner_default_resource.go | 2 +- .../pkg/testing/register.go | 0 .../pkg/testing/resource.go | 55 +-- .../pkg/testing/zz_generated.deepcopy.go | 0 .../pkg/tracing/config/doc.go | 0 .../pkg/tracing/config/tracing.go | 0 .../tracing/config/zz_generated.deepcopy.go | 0 .../pkg/tracing/http.go | 0 .../pkg/tracing/opencensus.go | 2 +- .../pkg/tracing/zipkin.go | 2 +- .../pkg/tracker/doc.go | 0 .../pkg/tracker/enqueue.go | 2 +- .../pkg/tracker/interface.go | 0 .../pkg/version/version.go | 0 .../pkg/webhook/certs.go | 2 +- vendor/knative.dev/pkg/webhook/user_info.go | 62 +++ .../pkg/webhook/webhook.go | 48 +- .../pkg/websocket/connection.go | 0 .../pkg/websocket/hijack.go | 0 314 files changed, 3253 insertions(+), 591 deletions(-) create mode 100644 vendor/github.com/golang/groupcache/LICENSE create mode 100644 vendor/github.com/golang/groupcache/lru/lru.go delete mode 100644 vendor/github.com/knative/pkg/.github/pull-request-template.md delete mode 100644 vendor/github.com/knative/pkg/injection/controllers.go create mode 100644 vendor/k8s.io/client-go/tools/record/doc.go create mode 100644 vendor/k8s.io/client-go/tools/record/event.go create mode 100644 vendor/k8s.io/client-go/tools/record/events_cache.go create mode 100644 vendor/k8s.io/client-go/tools/record/fake.go rename vendor/{github.com/knative => knative.dev}/pkg/.gitattributes (100%) create mode 100644 vendor/knative.dev/pkg/.github/PULL_REQUEST_TEMPLATE/breaking-change.md create mode 100644 vendor/knative.dev/pkg/.github/PULL_REQUEST_TEMPLATE/bug-fix.md create mode 100644 vendor/knative.dev/pkg/.github/PULL_REQUEST_TEMPLATE/normal-change.md rename vendor/{github.com/knative => knative.dev}/pkg/.github/issue-template.md (100%) rename vendor/{github.com/knative => knative.dev}/pkg/.gitignore (100%) rename vendor/{github.com/knative => knative.dev}/pkg/CONTRIBUTING.md (100%) rename vendor/{github.com/knative => knative.dev}/pkg/DEVELOPMENT.md (94%) rename vendor/{github.com/knative => knative.dev}/pkg/Gopkg.lock (95%) rename vendor/{github.com/knative => knative.dev}/pkg/Gopkg.toml (95%) rename vendor/{github.com/knative => knative.dev}/pkg/LICENSE (100%) rename vendor/{github.com/knative => knative.dev}/pkg/OWNERS_ALIASES (100%) rename vendor/{github.com/knative => knative.dev}/pkg/README.md (100%) create mode 100644 vendor/knative.dev/pkg/RELEASING.md rename vendor/{github.com/knative => knative.dev}/pkg/apis/condition_set.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/condition_types.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/contexts.go (86%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/deprecated.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/cached.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/enqueue.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/interface.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/patch.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/proxy.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/register.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/typed.go (75%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/unstructured.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/v1alpha1/addressable_types.go (96%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/v1alpha1/condition_set.go (99%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/v1alpha1/conditions_types.go (99%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/v1alpha1/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/v1alpha1/legacy_targetable_types.go (97%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/v1alpha1/register.go (98%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/v1alpha1/retired_targetable_types.go (97%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/v1beta1/addressable_types.go (97%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/v1beta1/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/v1beta1/register.go (97%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/v1beta1/status_types.go (98%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/v1beta1/zz_generated.deepcopy.go (99%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/duck/verify.go (99%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/field_error.go (99%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/interfaces.go (90%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/istio/authentication/register.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/istio/authentication/v1alpha1/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/istio/authentication/v1alpha1/policy_types.go (99%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/istio/authentication/v1alpha1/register.go (96%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/istio/authentication/v1alpha1/zz_generated.deepcopy.go (99%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/istio/common/v1alpha1/string.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/istio/register.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/istio/v1alpha3/README.md (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/istio/v1alpha3/destinationrule_types.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/istio/v1alpha3/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/istio/v1alpha3/gateway_types.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/istio/v1alpha3/register.go (97%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/istio/v1alpha3/virtualservice_types.go (99%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go (99%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/kind2resource.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/metadata_validation.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/testing/conditions.go (95%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/url.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/volatile_time.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/apis/zz_generated.deepcopy.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/changeset/commit.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/changeset/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/changeset/testdata/HEAD (100%) rename vendor/{github.com/knative => knative.dev}/pkg/changeset/testdata/noncommitted/HEAD (100%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/clientset.go (95%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/fake/clientset_generated.go (86%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/fake/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/fake/register.go (92%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/scheme/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/scheme/register.go (92%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go (95%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/typed/authentication/v1alpha1/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go (92%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/fake_policy.go (98%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/typed/authentication/v1alpha1/generated_expansion.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/typed/authentication/v1alpha1/policy.go (97%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/typed/istio/v1alpha3/destinationrule.go (97%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/typed/istio/v1alpha3/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_destinationrule.go (98%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_gateway.go (98%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_istio_client.go (94%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_virtualservice.go (98%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/typed/istio/v1alpha3/gateway.go (97%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/typed/istio/v1alpha3/generated_expansion.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/typed/istio/v1alpha3/istio_client.go (96%) rename vendor/{github.com/knative => knative.dev}/pkg/client/clientset/versioned/typed/istio/v1alpha3/virtualservice.go (97%) rename vendor/{github.com/knative => knative.dev}/pkg/client/informers/externalversions/authentication/interface.go (88%) rename vendor/{github.com/knative => knative.dev}/pkg/client/informers/externalversions/authentication/v1alpha1/interface.go (93%) rename vendor/{github.com/knative => knative.dev}/pkg/client/informers/externalversions/authentication/v1alpha1/policy.go (91%) rename vendor/{github.com/knative => knative.dev}/pkg/client/informers/externalversions/factory.go (95%) rename vendor/{github.com/knative => knative.dev}/pkg/client/informers/externalversions/generic.go (95%) rename vendor/{github.com/knative => knative.dev}/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go (94%) rename vendor/{github.com/knative => knative.dev}/pkg/client/informers/externalversions/istio/interface.go (88%) rename vendor/{github.com/knative => knative.dev}/pkg/client/informers/externalversions/istio/v1alpha3/destinationrule.go (92%) rename vendor/{github.com/knative => knative.dev}/pkg/client/informers/externalversions/istio/v1alpha3/gateway.go (91%) rename vendor/{github.com/knative => knative.dev}/pkg/client/informers/externalversions/istio/v1alpha3/interface.go (95%) rename vendor/{github.com/knative => knative.dev}/pkg/client/informers/externalversions/istio/v1alpha3/virtualservice.go (92%) rename vendor/{github.com/knative => knative.dev}/pkg/client/injection/client/client.go (89%) rename vendor/{github.com/knative => knative.dev}/pkg/client/injection/client/fake/fake.go (86%) rename vendor/{github.com/knative => knative.dev}/pkg/client/injection/informers/authentication/factory/authenticationfactory.go (83%) rename vendor/{github.com/knative/pkg/client/injection/informers/istio => knative.dev/pkg/client/injection/informers/authentication}/factory/fake/fake.go (76%) rename vendor/{github.com/knative => knative.dev}/pkg/client/injection/informers/authentication/v1alpha1/policy/fake/fake.go (77%) rename vendor/{github.com/knative => knative.dev}/pkg/client/injection/informers/authentication/v1alpha1/policy/policy.go (81%) rename vendor/{github.com/knative/pkg/client/injection/informers/authentication => knative.dev/pkg/client/injection/informers/istio}/factory/fake/fake.go (75%) rename vendor/{github.com/knative => knative.dev}/pkg/client/injection/informers/istio/factory/istiofactory.go (83%) rename vendor/{github.com/knative => knative.dev}/pkg/client/injection/informers/istio/v1alpha3/destinationrule/destinationrule.go (82%) rename vendor/{github.com/knative => knative.dev}/pkg/client/injection/informers/istio/v1alpha3/destinationrule/fake/fake.go (78%) rename vendor/{github.com/knative => knative.dev}/pkg/client/injection/informers/istio/v1alpha3/gateway/fake/fake.go (78%) rename vendor/{github.com/knative => knative.dev}/pkg/client/injection/informers/istio/v1alpha3/gateway/gateway.go (81%) rename vendor/{github.com/knative => knative.dev}/pkg/client/injection/informers/istio/v1alpha3/virtualservice/fake/fake.go (78%) rename vendor/{github.com/knative => knative.dev}/pkg/client/injection/informers/istio/v1alpha3/virtualservice/virtualservice.go (82%) rename vendor/{github.com/knative => knative.dev}/pkg/client/listers/authentication/v1alpha1/expansion_generated.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/client/listers/authentication/v1alpha1/policy.go (97%) rename vendor/{github.com/knative => knative.dev}/pkg/client/listers/istio/v1alpha3/destinationrule.go (98%) rename vendor/{github.com/knative => knative.dev}/pkg/client/listers/istio/v1alpha3/expansion_generated.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/client/listers/istio/v1alpha3/gateway.go (98%) rename vendor/{github.com/knative => knative.dev}/pkg/client/listers/istio/v1alpha3/virtualservice.go (98%) rename vendor/{github.com/knative => knative.dev}/pkg/cloudevents/README.md (100%) rename vendor/{github.com/knative => knative.dev}/pkg/cloudevents/builder.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/cloudevents/client.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/cloudevents/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/cloudevents/encoding_binary.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/cloudevents/encoding_structured.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/cloudevents/event.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/cloudevents/event_v01.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/cloudevents/event_v02.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/cloudevents/handler.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/code-of-conduct.md (100%) rename vendor/{github.com/knative => knative.dev}/pkg/codegen/cmd/injection-gen/args/args.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/codegen/cmd/injection-gen/generators/client.go (96%) rename vendor/{github.com/knative => knative.dev}/pkg/codegen/cmd/injection-gen/generators/factory.go (93%) rename vendor/{github.com/knative => knative.dev}/pkg/codegen/cmd/injection-gen/generators/fakeclient.go (96%) rename vendor/{github.com/knative => knative.dev}/pkg/codegen/cmd/injection-gen/generators/fakefactory.go (96%) rename vendor/{github.com/knative => knative.dev}/pkg/codegen/cmd/injection-gen/generators/fakeinformer.go (95%) rename vendor/{github.com/knative => knative.dev}/pkg/codegen/cmd/injection-gen/generators/informer.go (95%) rename vendor/{github.com/knative => knative.dev}/pkg/codegen/cmd/injection-gen/generators/namesystems.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/codegen/cmd/injection-gen/generators/packages.go (99%) rename vendor/{github.com/knative => knative.dev}/pkg/codegen/cmd/injection-gen/main.go (91%) rename vendor/{github.com/knative => knative.dev}/pkg/configmap/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/configmap/filter.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/configmap/informed_watcher.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/configmap/load.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/configmap/manual_watcher.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/configmap/static_watcher.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/configmap/store.go (98%) rename vendor/{github.com/knative => knative.dev}/pkg/configmap/testing/configmap.go (95%) rename vendor/{github.com/knative => knative.dev}/pkg/configmap/watcher.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/controller/controller.go (94%) rename vendor/{github.com/knative => knative.dev}/pkg/controller/helper.go (98%) rename vendor/{github.com/knative => knative.dev}/pkg/controller/stats_reporter.go (99%) rename vendor/{github.com/knative => knative.dev}/pkg/controller/testing/fake_stats_reporter.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/hack/boilerplate/boilerplate.go.txt (100%) rename vendor/{github.com/knative => knative.dev}/pkg/hack/generate-knative.sh (100%) rename vendor/{github.com/knative => knative.dev}/pkg/hack/update-codegen.sh (88%) rename vendor/{github.com/knative => knative.dev}/pkg/hack/update-deps.sh (86%) rename vendor/{github.com/knative => knative.dev}/pkg/hack/verify-codegen.sh (100%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/README.md (75%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/clients.go (100%) create mode 100644 vendor/knative.dev/pkg/injection/clients/apiextclient/apiext.go create mode 100644 vendor/knative.dev/pkg/injection/clients/apiextclient/fake/fake.go rename vendor/{github.com/knative => knative.dev}/pkg/injection/clients/dynamicclient/dynamicclient.go (88%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/clients/dynamicclient/fake/fake.go (86%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/clients/kubeclient/fake/fake.go (86%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/clients/kubeclient/kubeclient.go (88%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/doc.go (64%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/factories.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/informers.go (98%) create mode 100644 vendor/knative.dev/pkg/injection/informers/apiextinformers/apiextensionsv1beta1/crd/crd.go create mode 100644 vendor/knative.dev/pkg/injection/informers/apiextinformers/apiextensionsv1beta1/crd/fake/fake.go create mode 100644 vendor/knative.dev/pkg/injection/informers/apiextinformers/factory/factory.go create mode 100644 vendor/knative.dev/pkg/injection/informers/apiextinformers/factory/fake/fake.go rename vendor/{github.com/knative => knative.dev}/pkg/injection/informers/kubeinformers/appsv1/deployment/deployment.go (83%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/informers/kubeinformers/appsv1/deployment/fake/fake.go (80%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/informers/kubeinformers/autoscalingv1/hpa/fake/fake.go (80%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/informers/kubeinformers/autoscalingv1/hpa/hpa.go (82%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/informers/kubeinformers/autoscalingv2beta1/hpa/fake/fake.go (79%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/informers/kubeinformers/autoscalingv2beta1/hpa/hpa.go (82%) create mode 100644 vendor/knative.dev/pkg/injection/informers/kubeinformers/batchv1/job/fake/fake.go create mode 100644 vendor/knative.dev/pkg/injection/informers/kubeinformers/batchv1/job/job.go rename vendor/{github.com/knative => knative.dev}/pkg/injection/informers/kubeinformers/corev1/configmap/configmap.go (83%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/informers/kubeinformers/corev1/configmap/fake/fake.go (80%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/informers/kubeinformers/corev1/endpoints/endpoints.go (83%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/informers/kubeinformers/corev1/endpoints/fake/fake.go (80%) create mode 100644 vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/namespace/fake/fake.go create mode 100644 vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/namespace/namespace.go create mode 100644 vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/pod/fake/fake.go create mode 100644 vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/pod/pod.go rename vendor/{github.com/knative => knative.dev}/pkg/injection/informers/kubeinformers/corev1/secret/fake/fake.go (80%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/informers/kubeinformers/corev1/secret/secret.go (83%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/informers/kubeinformers/corev1/service/fake/fake.go (80%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/informers/kubeinformers/corev1/service/service.go (83%) create mode 100644 vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/serviceaccount/fake/fake.go create mode 100644 vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/serviceaccount/service.go rename vendor/{github.com/knative => knative.dev}/pkg/injection/informers/kubeinformers/factory/factory.go (83%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/informers/kubeinformers/factory/fake/fake.go (82%) create mode 100644 vendor/knative.dev/pkg/injection/informers/kubeinformers/rbacv1/role/fake/fake.go create mode 100644 vendor/knative.dev/pkg/injection/informers/kubeinformers/rbacv1/role/role.go create mode 100644 vendor/knative.dev/pkg/injection/informers/kubeinformers/rbacv1/rolebinding/fake/fake.go create mode 100644 vendor/knative.dev/pkg/injection/informers/kubeinformers/rbacv1/rolebinding/rolebinding.go rename vendor/{github.com/knative => knative.dev}/pkg/injection/interface.go (83%) rename vendor/{github.com/knative => knative.dev}/pkg/injection/sharedmain/main.go (74%) rename vendor/{github.com/knative => knative.dev}/pkg/kmeta/accessor.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/kmeta/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/kmeta/labels.go (100%) create mode 100644 vendor/knative.dev/pkg/kmeta/names.go rename vendor/{github.com/knative => knative.dev}/pkg/kmeta/owner_references.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/kmp/diff.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/kmp/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/kmp/reporters.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/logging/config.go (98%) rename vendor/{github.com/knative => knative.dev}/pkg/logging/logger.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/logging/logkey/constants.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/logging/testing/util.go (97%) rename vendor/{github.com/knative => knative.dev}/pkg/logging/zz_generated.deepcopy.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/metrics/config.go (99%) rename vendor/{github.com/knative => knative.dev}/pkg/metrics/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/metrics/exporter.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/metrics/gcp_metadata.go (91%) rename vendor/{github.com/knative => knative.dev}/pkg/metrics/metricskey/constants.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/metrics/monitored_resources.go (97%) rename vendor/{github.com/knative => knative.dev}/pkg/metrics/prometheus_exporter.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/metrics/record.go (97%) rename vendor/{github.com/knative => knative.dev}/pkg/metrics/stackdriver_exporter.go (99%) rename vendor/{github.com/knative => knative.dev}/pkg/metrics/testing/config.go (95%) rename vendor/{github.com/knative => knative.dev}/pkg/ptr/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/ptr/ptr.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/reconciler/testing/actions.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/reconciler/testing/clock.go (100%) create mode 100644 vendor/knative.dev/pkg/reconciler/testing/context.go rename vendor/{github.com/knative => knative.dev}/pkg/reconciler/testing/events.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/reconciler/testing/generate_name_reactor.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/reconciler/testing/hooks.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/reconciler/testing/reactions.go (98%) rename vendor/{github.com/knative => knative.dev}/pkg/reconciler/testing/sorter.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/reconciler/testing/stats.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/reconciler/testing/table.go (98%) rename vendor/{github.com/knative => knative.dev}/pkg/reconciler/testing/tracker.go (96%) rename vendor/{github.com/knative => knative.dev}/pkg/reconciler/testing/util.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/signals/signal.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/signals/signal_posix.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/signals/signal_windows.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/system/clock.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/system/names.go (96%) rename vendor/{github.com/knative => knative.dev}/pkg/system/testing/names.go (95%) rename vendor/{github.com/knative => knative.dev}/pkg/test/README.md (100%) rename vendor/{github.com/knative => knative.dev}/pkg/test/cleanup.go (96%) rename vendor/{github.com/knative => knative.dev}/pkg/test/clients.go (98%) rename vendor/{github.com/knative => knative.dev}/pkg/test/crd.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/test/e2e_flags.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/test/helpers/data.go (100%) create mode 100644 vendor/knative.dev/pkg/test/helpers/name.go rename vendor/{github.com/knative => knative.dev}/pkg/test/ingress/ingress.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/test/kube_checks.go (99%) rename vendor/{github.com/knative => knative.dev}/pkg/test/logging/logging.go (99%) create mode 100644 vendor/knative.dev/pkg/test/logstream/doc.go create mode 100644 vendor/knative.dev/pkg/test/logstream/interface.go create mode 100644 vendor/knative.dev/pkg/test/logstream/kubelogs.go create mode 100644 vendor/knative.dev/pkg/test/logstream/null.go rename vendor/{github.com/knative => knative.dev}/pkg/test/monitoring/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/test/monitoring/monitoring.go (98%) rename vendor/{github.com/knative => knative.dev}/pkg/test/presubmit-tests.sh (100%) rename vendor/{github.com/knative => knative.dev}/pkg/test/request.go (87%) rename vendor/{github.com/knative => knative.dev}/pkg/test/spoof/error_checks.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/test/spoof/spoof.go (98%) rename vendor/{github.com/knative => knative.dev}/pkg/test/zipkin/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/test/zipkin/util.go (98%) rename vendor/{github.com/knative => knative.dev}/pkg/testing/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/testing/inner_default_resource.go (99%) rename vendor/{github.com/knative => knative.dev}/pkg/testing/register.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/testing/resource.go (73%) rename vendor/{github.com/knative => knative.dev}/pkg/testing/zz_generated.deepcopy.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/tracing/config/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/tracing/config/tracing.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/tracing/config/zz_generated.deepcopy.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/tracing/http.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/tracing/opencensus.go (98%) rename vendor/{github.com/knative => knative.dev}/pkg/tracing/zipkin.go (96%) rename vendor/{github.com/knative => knative.dev}/pkg/tracker/doc.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/tracker/enqueue.go (99%) rename vendor/{github.com/knative => knative.dev}/pkg/tracker/interface.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/version/version.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/webhook/certs.go (99%) create mode 100644 vendor/knative.dev/pkg/webhook/user_info.go rename vendor/{github.com/knative => knative.dev}/pkg/webhook/webhook.go (94%) rename vendor/{github.com/knative => knative.dev}/pkg/websocket/connection.go (100%) rename vendor/{github.com/knative => knative.dev}/pkg/websocket/hijack.go (100%) diff --git a/Gopkg.lock b/Gopkg.lock index a1d17485..dfa30de1 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -117,6 +117,14 @@ pruneopts = "NUT" revision = "23def4e6c14b4da8ac2ed8007337bc5eb5007998" +[[projects]] + branch = "master" + digest = "1:b7cb6054d3dff43b38ad2e92492f220f57ae6087ee797dca298139776749ace8" + name = "github.com/golang/groupcache" + packages = ["lru"] + pruneopts = "NUT" + revision = "5b532d6fd5efaf7fa130d4e859a2fde0fc3a9e1b" + [[projects]] digest = "1:4dacf728c83400b3e9d1d3025dd3c1e93e9a1b033726d1b193dc209f3fa9cb7a" name = "github.com/golang/protobuf" @@ -244,28 +252,6 @@ pruneopts = "NUT" revision = "f2b4162afba35581b6d4a50d3b8f34e33c144682" -[[projects]] - digest = "1:6a405899228cd065e8730e163e7fbb4faaee51af4035120ec054795873380d50" - name = "github.com/knative/pkg" - packages = [ - "apis", - "changeset", - "codegen/cmd/injection-gen", - "codegen/cmd/injection-gen/args", - "codegen/cmd/injection-gen/generators", - "configmap", - "controller", - "injection", - "kmeta", - "kmp", - "logging", - "logging/logkey", - "metrics", - "metrics/metricskey", - ] - pruneopts = "T" - revision = "4d86f3ad6f48dffa0846c76711ca6c3697def63c" - [[projects]] branch = "master" digest = "1:1bfc083da5bbeb7abaac53c56890eb14eb11bac9ec985bfe338c4bbb0540c9ba" @@ -746,7 +732,7 @@ version = "kubernetes-1.12.6" [[projects]] - digest = "1:febab0466fc1b384189951d4c1aa175cbd03ad10cdb529d1ff2e8b20036ba7e3" + digest = "1:5ccc821e42e8ab9d53d252b4c12d0b7f388afea1f4f2ceb2014dd27976970dc7" name = "k8s.io/client-go" packages = [ "discovery", @@ -867,6 +853,7 @@ "tools/clientcmd/api", "tools/metrics", "tools/pager", + "tools/record", "tools/reference", "transport", "util/buffer", @@ -941,17 +928,34 @@ pruneopts = "NUT" revision = "e3762e86a74c878ffed47484592986685639c2cd" +[[projects]] + branch = "master" + digest = "1:a1c54962db67cc9b1bda27c8657ae3ca1e7cd9f2702a80012e0abc932c7c7091" + name = "knative.dev/pkg" + packages = [ + "apis", + "changeset", + "codegen/cmd/injection-gen", + "codegen/cmd/injection-gen/args", + "codegen/cmd/injection-gen/generators", + "configmap", + "controller", + "injection", + "kmeta", + "kmp", + "logging", + "logging/logkey", + "metrics", + "metrics/metricskey", + ] + pruneopts = "T" + revision = "3c6bc12e7897bf8c0d1eb1411fbd3d80537420f9" + [solve-meta] analyzer-name = "dep" analyzer-version = 1 input-imports = [ "github.com/google/go-cmp/cmp", - "github.com/knative/pkg/apis", - "github.com/knative/pkg/codegen/cmd/injection-gen", - "github.com/knative/pkg/controller", - "github.com/knative/pkg/injection", - "github.com/knative/pkg/kmeta", - "github.com/knative/pkg/logging", "github.com/knative/test-infra/scripts", "github.com/knative/test-infra/tools/dep-collector", "k8s.io/api/core/v1", @@ -977,6 +981,12 @@ "k8s.io/code-generator/cmd/defaulter-gen", "k8s.io/code-generator/cmd/informer-gen", "k8s.io/code-generator/cmd/lister-gen", + "knative.dev/pkg/apis", + "knative.dev/pkg/codegen/cmd/injection-gen", + "knative.dev/pkg/controller", + "knative.dev/pkg/injection", + "knative.dev/pkg/kmeta", + "knative.dev/pkg/logging", ] solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 234ae8f3..bebc51e3 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -8,7 +8,7 @@ required = [ "k8s.io/code-generator/cmd/client-gen", "k8s.io/code-generator/cmd/lister-gen", "k8s.io/code-generator/cmd/informer-gen", - "github.com/knative/pkg/codegen/cmd/injection-gen", + "knative.dev/pkg/codegen/cmd/injection-gen", "github.com/knative/test-infra/scripts", "github.com/knative/test-infra/tools/dep-collector", ] @@ -38,9 +38,8 @@ required = [ version = "kubernetes-1.12.6" [[override]] - name = "github.com/knative/pkg" - # HEAD as of 2919-06-05 - revision = "4d86f3ad6f48dffa0846c76711ca6c3697def63c" + name = "knative.dev/pkg" + branch = "master" [[override]] name = "google.golang.org/genproto" @@ -76,6 +75,6 @@ required = [ non-go = false [[prune.project]] - name = "github.com/knative/pkg" + name = "knative.dev/pkg" unused-packages = false non-go = false diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 0213d5a0..a4aa094c 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -20,7 +20,7 @@ set -o pipefail REPO_ROOT=$(dirname ${BASH_SOURCE})/.. CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${REPO_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)} -KNATIVE_CODEGEN_PKG=${KNATIVE_CODEGEN_PKG:-$(cd ${REPO_ROOT}; ls -d -1 ./vendor/github.com/knative/pkg 2>/dev/null || echo ../pkg)} +KNATIVE_CODEGEN_PKG=${KNATIVE_CODEGEN_PKG:-$(cd ${REPO_ROOT}; ls -d -1 ./vendor/knative.dev/pkg 2>/dev/null || echo ../pkg)} # generate the code with: # --output-base because this script should also be able to run inside the vendor dir of diff --git a/pkg/apis/caching/v1alpha1/image_types.go b/pkg/apis/caching/v1alpha1/image_types.go index edea28f2..3bad8776 100644 --- a/pkg/apis/caching/v1alpha1/image_types.go +++ b/pkg/apis/caching/v1alpha1/image_types.go @@ -25,8 +25,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" - "github.com/knative/pkg/apis" - "github.com/knative/pkg/kmeta" + "knative.dev/pkg/apis" + "knative.dev/pkg/kmeta" ) // +genclient diff --git a/pkg/apis/caching/v1alpha1/image_types_test.go b/pkg/apis/caching/v1alpha1/image_types_test.go index c68fb257..f793af8d 100644 --- a/pkg/apis/caching/v1alpha1/image_types_test.go +++ b/pkg/apis/caching/v1alpha1/image_types_test.go @@ -23,7 +23,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/knative/pkg/apis" + "knative.dev/pkg/apis" ) func TestIsReady(t *testing.T) { diff --git a/pkg/apis/caching/v1alpha1/image_validation.go b/pkg/apis/caching/v1alpha1/image_validation.go index 33a50578..4e644f95 100644 --- a/pkg/apis/caching/v1alpha1/image_validation.go +++ b/pkg/apis/caching/v1alpha1/image_validation.go @@ -23,7 +23,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/equality" - "github.com/knative/pkg/apis" + "knative.dev/pkg/apis" ) func (rt *Image) Validate(ctx context.Context) *apis.FieldError { diff --git a/pkg/apis/caching/v1alpha1/image_validation_test.go b/pkg/apis/caching/v1alpha1/image_validation_test.go index cc1037d9..5508632b 100644 --- a/pkg/apis/caching/v1alpha1/image_validation_test.go +++ b/pkg/apis/caching/v1alpha1/image_validation_test.go @@ -22,7 +22,7 @@ import ( corev1 "k8s.io/api/core/v1" - "github.com/knative/pkg/apis" + "knative.dev/pkg/apis" ) func TestImageValidation(t *testing.T) { diff --git a/pkg/client/injection/client/client.go b/pkg/client/injection/client/client.go index 628eea0d..d8ec6868 100644 --- a/pkg/client/injection/client/client.go +++ b/pkg/client/injection/client/client.go @@ -22,9 +22,9 @@ import ( "context" versioned "github.com/knative/caching/pkg/client/clientset/versioned" - injection "github.com/knative/pkg/injection" - logging "github.com/knative/pkg/logging" rest "k8s.io/client-go/rest" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" ) func init() { diff --git a/pkg/client/injection/client/fake/fake.go b/pkg/client/injection/client/fake/fake.go index de6a176d..8fb08670 100644 --- a/pkg/client/injection/client/fake/fake.go +++ b/pkg/client/injection/client/fake/fake.go @@ -23,10 +23,10 @@ import ( fake "github.com/knative/caching/pkg/client/clientset/versioned/fake" client "github.com/knative/caching/pkg/client/injection/client" - injection "github.com/knative/pkg/injection" - logging "github.com/knative/pkg/logging" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/rest" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" ) func init() { diff --git a/pkg/client/injection/informers/caching/factory/cachingfactory.go b/pkg/client/injection/informers/caching/factory/cachingfactory.go index 3ccefdb7..d060af64 100644 --- a/pkg/client/injection/informers/caching/factory/cachingfactory.go +++ b/pkg/client/injection/informers/caching/factory/cachingfactory.go @@ -23,9 +23,9 @@ import ( externalversions "github.com/knative/caching/pkg/client/informers/externalversions" client "github.com/knative/caching/pkg/client/injection/client" - controller "github.com/knative/pkg/controller" - injection "github.com/knative/pkg/injection" - logging "github.com/knative/pkg/logging" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" ) func init() { diff --git a/pkg/client/injection/informers/caching/factory/fake/fake.go b/pkg/client/injection/informers/caching/factory/fake/fake.go index 3ec2a058..24eed282 100644 --- a/pkg/client/injection/informers/caching/factory/fake/fake.go +++ b/pkg/client/injection/informers/caching/factory/fake/fake.go @@ -24,8 +24,8 @@ import ( externalversions "github.com/knative/caching/pkg/client/informers/externalversions" fake "github.com/knative/caching/pkg/client/injection/client/fake" factory "github.com/knative/caching/pkg/client/injection/informers/caching/factory" - controller "github.com/knative/pkg/controller" - injection "github.com/knative/pkg/injection" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" ) var Get = factory.Get diff --git a/pkg/client/injection/informers/caching/v1alpha1/image/fake/fake.go b/pkg/client/injection/informers/caching/v1alpha1/image/fake/fake.go index 666824e2..99bbb241 100644 --- a/pkg/client/injection/informers/caching/v1alpha1/image/fake/fake.go +++ b/pkg/client/injection/informers/caching/v1alpha1/image/fake/fake.go @@ -23,8 +23,8 @@ import ( fake "github.com/knative/caching/pkg/client/injection/informers/caching/factory/fake" image "github.com/knative/caching/pkg/client/injection/informers/caching/v1alpha1/image" - controller "github.com/knative/pkg/controller" - injection "github.com/knative/pkg/injection" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" ) var Get = image.Get diff --git a/pkg/client/injection/informers/caching/v1alpha1/image/image.go b/pkg/client/injection/informers/caching/v1alpha1/image/image.go index 40ee814f..55deadd9 100644 --- a/pkg/client/injection/informers/caching/v1alpha1/image/image.go +++ b/pkg/client/injection/informers/caching/v1alpha1/image/image.go @@ -23,9 +23,9 @@ import ( v1alpha1 "github.com/knative/caching/pkg/client/informers/externalversions/caching/v1alpha1" factory "github.com/knative/caching/pkg/client/injection/informers/caching/factory" - controller "github.com/knative/pkg/controller" - injection "github.com/knative/pkg/injection" - logging "github.com/knative/pkg/logging" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" ) func init() { diff --git a/vendor/github.com/golang/groupcache/LICENSE b/vendor/github.com/golang/groupcache/LICENSE new file mode 100644 index 00000000..37ec93a1 --- /dev/null +++ b/vendor/github.com/golang/groupcache/LICENSE @@ -0,0 +1,191 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, "control" means (i) the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +"Object" form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +"submitted" means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of +this License; and +You must cause any modified files to carry prominent notices stating that You +changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets "[]" replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same "printed page" as the copyright notice for easier identification within +third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/vendor/github.com/golang/groupcache/lru/lru.go b/vendor/github.com/golang/groupcache/lru/lru.go new file mode 100644 index 00000000..eac1c766 --- /dev/null +++ b/vendor/github.com/golang/groupcache/lru/lru.go @@ -0,0 +1,133 @@ +/* +Copyright 2013 Google Inc. + +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 lru implements an LRU cache. +package lru + +import "container/list" + +// Cache is an LRU cache. It is not safe for concurrent access. +type Cache struct { + // MaxEntries is the maximum number of cache entries before + // an item is evicted. Zero means no limit. + MaxEntries int + + // OnEvicted optionally specifies a callback function to be + // executed when an entry is purged from the cache. + OnEvicted func(key Key, value interface{}) + + ll *list.List + cache map[interface{}]*list.Element +} + +// A Key may be any value that is comparable. See http://golang.org/ref/spec#Comparison_operators +type Key interface{} + +type entry struct { + key Key + value interface{} +} + +// New creates a new Cache. +// If maxEntries is zero, the cache has no limit and it's assumed +// that eviction is done by the caller. +func New(maxEntries int) *Cache { + return &Cache{ + MaxEntries: maxEntries, + ll: list.New(), + cache: make(map[interface{}]*list.Element), + } +} + +// Add adds a value to the cache. +func (c *Cache) Add(key Key, value interface{}) { + if c.cache == nil { + c.cache = make(map[interface{}]*list.Element) + c.ll = list.New() + } + if ee, ok := c.cache[key]; ok { + c.ll.MoveToFront(ee) + ee.Value.(*entry).value = value + return + } + ele := c.ll.PushFront(&entry{key, value}) + c.cache[key] = ele + if c.MaxEntries != 0 && c.ll.Len() > c.MaxEntries { + c.RemoveOldest() + } +} + +// Get looks up a key's value from the cache. +func (c *Cache) Get(key Key) (value interface{}, ok bool) { + if c.cache == nil { + return + } + if ele, hit := c.cache[key]; hit { + c.ll.MoveToFront(ele) + return ele.Value.(*entry).value, true + } + return +} + +// Remove removes the provided key from the cache. +func (c *Cache) Remove(key Key) { + if c.cache == nil { + return + } + if ele, hit := c.cache[key]; hit { + c.removeElement(ele) + } +} + +// RemoveOldest removes the oldest item from the cache. +func (c *Cache) RemoveOldest() { + if c.cache == nil { + return + } + ele := c.ll.Back() + if ele != nil { + c.removeElement(ele) + } +} + +func (c *Cache) removeElement(e *list.Element) { + c.ll.Remove(e) + kv := e.Value.(*entry) + delete(c.cache, kv.key) + if c.OnEvicted != nil { + c.OnEvicted(kv.key, kv.value) + } +} + +// Len returns the number of items in the cache. +func (c *Cache) Len() int { + if c.cache == nil { + return 0 + } + return c.ll.Len() +} + +// Clear purges all stored items from the cache. +func (c *Cache) Clear() { + if c.OnEvicted != nil { + for _, e := range c.cache { + kv := e.Value.(*entry) + c.OnEvicted(kv.key, kv.value) + } + } + c.ll = nil + c.cache = nil +} diff --git a/vendor/github.com/knative/pkg/.github/pull-request-template.md b/vendor/github.com/knative/pkg/.github/pull-request-template.md deleted file mode 100644 index 033ec443..00000000 --- a/vendor/github.com/knative/pkg/.github/pull-request-template.md +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/vendor/github.com/knative/pkg/injection/controllers.go b/vendor/github.com/knative/pkg/injection/controllers.go deleted file mode 100644 index 2b8bd62d..00000000 --- a/vendor/github.com/knative/pkg/injection/controllers.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -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 injection - -import ( - "context" - - "github.com/knative/pkg/configmap" - "github.com/knative/pkg/controller" -) - -// ControllerInjector holds the type of a callback that attaches a particular -// controller type to a context. -type ControllerInjector func(context.Context, configmap.Watcher) *controller.Impl - -func (i *impl) RegisterController(ii ControllerInjector) { - i.m.Lock() - defer i.m.Unlock() - - i.controllers = append(i.controllers, ii) -} - -func (i *impl) GetControllers() []ControllerInjector { - i.m.RLock() - defer i.m.RUnlock() - - // Copy the slice before returning. - return append(i.controllers[:0:0], i.controllers...) -} diff --git a/vendor/k8s.io/client-go/tools/record/doc.go b/vendor/k8s.io/client-go/tools/record/doc.go new file mode 100644 index 00000000..657ddecb --- /dev/null +++ b/vendor/k8s.io/client-go/tools/record/doc.go @@ -0,0 +1,18 @@ +/* +Copyright 2014 The Kubernetes 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 record has all client logic for recording and reporting events. +package record // import "k8s.io/client-go/tools/record" diff --git a/vendor/k8s.io/client-go/tools/record/event.go b/vendor/k8s.io/client-go/tools/record/event.go new file mode 100644 index 00000000..168dfa80 --- /dev/null +++ b/vendor/k8s.io/client-go/tools/record/event.go @@ -0,0 +1,322 @@ +/* +Copyright 2014 The Kubernetes 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 record + +import ( + "fmt" + "math/rand" + "time" + + "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/clock" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/apimachinery/pkg/watch" + restclient "k8s.io/client-go/rest" + ref "k8s.io/client-go/tools/reference" + + "net/http" + + "github.com/golang/glog" +) + +const maxTriesPerEvent = 12 + +var defaultSleepDuration = 10 * time.Second + +const maxQueuedEvents = 1000 + +// EventSink knows how to store events (client.Client implements it.) +// EventSink must respect the namespace that will be embedded in 'event'. +// It is assumed that EventSink will return the same sorts of errors as +// pkg/client's REST client. +type EventSink interface { + Create(event *v1.Event) (*v1.Event, error) + Update(event *v1.Event) (*v1.Event, error) + Patch(oldEvent *v1.Event, data []byte) (*v1.Event, error) +} + +// EventRecorder knows how to record events on behalf of an EventSource. +type EventRecorder interface { + // Event constructs an event from the given information and puts it in the queue for sending. + // 'object' is the object this event is about. Event will make a reference-- or you may also + // pass a reference to the object directly. + // 'type' of this event, and can be one of Normal, Warning. New types could be added in future + // 'reason' is the reason this event is generated. 'reason' should be short and unique; it + // should be in UpperCamelCase format (starting with a capital letter). "reason" will be used + // to automate handling of events, so imagine people writing switch statements to handle them. + // You want to make that easy. + // 'message' is intended to be human readable. + // + // The resulting event will be created in the same namespace as the reference object. + Event(object runtime.Object, eventtype, reason, message string) + + // Eventf is just like Event, but with Sprintf for the message field. + Eventf(object runtime.Object, eventtype, reason, messageFmt string, args ...interface{}) + + // PastEventf is just like Eventf, but with an option to specify the event's 'timestamp' field. + PastEventf(object runtime.Object, timestamp metav1.Time, eventtype, reason, messageFmt string, args ...interface{}) + + // AnnotatedEventf is just like eventf, but with annotations attached + AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{}) +} + +// EventBroadcaster knows how to receive events and send them to any EventSink, watcher, or log. +type EventBroadcaster interface { + // StartEventWatcher starts sending events received from this EventBroadcaster to the given + // event handler function. The return value can be ignored or used to stop recording, if + // desired. + StartEventWatcher(eventHandler func(*v1.Event)) watch.Interface + + // StartRecordingToSink starts sending events received from this EventBroadcaster to the given + // sink. The return value can be ignored or used to stop recording, if desired. + StartRecordingToSink(sink EventSink) watch.Interface + + // StartLogging starts sending events received from this EventBroadcaster to the given logging + // function. The return value can be ignored or used to stop recording, if desired. + StartLogging(logf func(format string, args ...interface{})) watch.Interface + + // NewRecorder returns an EventRecorder that can be used to send events to this EventBroadcaster + // with the event source set to the given event source. + NewRecorder(scheme *runtime.Scheme, source v1.EventSource) EventRecorder +} + +// Creates a new event broadcaster. +func NewBroadcaster() EventBroadcaster { + return &eventBroadcasterImpl{watch.NewBroadcaster(maxQueuedEvents, watch.DropIfChannelFull), defaultSleepDuration} +} + +func NewBroadcasterForTests(sleepDuration time.Duration) EventBroadcaster { + return &eventBroadcasterImpl{watch.NewBroadcaster(maxQueuedEvents, watch.DropIfChannelFull), sleepDuration} +} + +type eventBroadcasterImpl struct { + *watch.Broadcaster + sleepDuration time.Duration +} + +// StartRecordingToSink starts sending events received from the specified eventBroadcaster to the given sink. +// The return value can be ignored or used to stop recording, if desired. +// TODO: make me an object with parameterizable queue length and retry interval +func (eventBroadcaster *eventBroadcasterImpl) StartRecordingToSink(sink EventSink) watch.Interface { + // The default math/rand package functions aren't thread safe, so create a + // new Rand object for each StartRecording call. + randGen := rand.New(rand.NewSource(time.Now().UnixNano())) + eventCorrelator := NewEventCorrelator(clock.RealClock{}) + return eventBroadcaster.StartEventWatcher( + func(event *v1.Event) { + recordToSink(sink, event, eventCorrelator, randGen, eventBroadcaster.sleepDuration) + }) +} + +func recordToSink(sink EventSink, event *v1.Event, eventCorrelator *EventCorrelator, randGen *rand.Rand, sleepDuration time.Duration) { + // Make a copy before modification, because there could be multiple listeners. + // Events are safe to copy like this. + eventCopy := *event + event = &eventCopy + result, err := eventCorrelator.EventCorrelate(event) + if err != nil { + utilruntime.HandleError(err) + } + if result.Skip { + return + } + tries := 0 + for { + if recordEvent(sink, result.Event, result.Patch, result.Event.Count > 1, eventCorrelator) { + break + } + tries++ + if tries >= maxTriesPerEvent { + glog.Errorf("Unable to write event '%#v' (retry limit exceeded!)", event) + break + } + // Randomize the first sleep so that various clients won't all be + // synced up if the master goes down. + if tries == 1 { + time.Sleep(time.Duration(float64(sleepDuration) * randGen.Float64())) + } else { + time.Sleep(sleepDuration) + } + } +} + +func isKeyNotFoundError(err error) bool { + statusErr, _ := err.(*errors.StatusError) + + if statusErr != nil && statusErr.Status().Code == http.StatusNotFound { + return true + } + + return false +} + +// recordEvent attempts to write event to a sink. It returns true if the event +// was successfully recorded or discarded, false if it should be retried. +// If updateExistingEvent is false, it creates a new event, otherwise it updates +// existing event. +func recordEvent(sink EventSink, event *v1.Event, patch []byte, updateExistingEvent bool, eventCorrelator *EventCorrelator) bool { + var newEvent *v1.Event + var err error + if updateExistingEvent { + newEvent, err = sink.Patch(event, patch) + } + // Update can fail because the event may have been removed and it no longer exists. + if !updateExistingEvent || (updateExistingEvent && isKeyNotFoundError(err)) { + // Making sure that ResourceVersion is empty on creation + event.ResourceVersion = "" + newEvent, err = sink.Create(event) + } + if err == nil { + // we need to update our event correlator with the server returned state to handle name/resourceversion + eventCorrelator.UpdateState(newEvent) + return true + } + + // If we can't contact the server, then hold everything while we keep trying. + // Otherwise, something about the event is malformed and we should abandon it. + switch err.(type) { + case *restclient.RequestConstructionError: + // We will construct the request the same next time, so don't keep trying. + glog.Errorf("Unable to construct event '%#v': '%v' (will not retry!)", event, err) + return true + case *errors.StatusError: + if errors.IsAlreadyExists(err) { + glog.V(5).Infof("Server rejected event '%#v': '%v' (will not retry!)", event, err) + } else { + glog.Errorf("Server rejected event '%#v': '%v' (will not retry!)", event, err) + } + return true + case *errors.UnexpectedObjectError: + // We don't expect this; it implies the server's response didn't match a + // known pattern. Go ahead and retry. + default: + // This case includes actual http transport errors. Go ahead and retry. + } + glog.Errorf("Unable to write event: '%v' (may retry after sleeping)", err) + return false +} + +// StartLogging starts sending events received from this EventBroadcaster to the given logging function. +// The return value can be ignored or used to stop recording, if desired. +func (eventBroadcaster *eventBroadcasterImpl) StartLogging(logf func(format string, args ...interface{})) watch.Interface { + return eventBroadcaster.StartEventWatcher( + func(e *v1.Event) { + logf("Event(%#v): type: '%v' reason: '%v' %v", e.InvolvedObject, e.Type, e.Reason, e.Message) + }) +} + +// StartEventWatcher starts sending events received from this EventBroadcaster to the given event handler function. +// The return value can be ignored or used to stop recording, if desired. +func (eventBroadcaster *eventBroadcasterImpl) StartEventWatcher(eventHandler func(*v1.Event)) watch.Interface { + watcher := eventBroadcaster.Watch() + go func() { + defer utilruntime.HandleCrash() + for watchEvent := range watcher.ResultChan() { + event, ok := watchEvent.Object.(*v1.Event) + if !ok { + // This is all local, so there's no reason this should + // ever happen. + continue + } + eventHandler(event) + } + }() + return watcher +} + +// NewRecorder returns an EventRecorder that records events with the given event source. +func (eventBroadcaster *eventBroadcasterImpl) NewRecorder(scheme *runtime.Scheme, source v1.EventSource) EventRecorder { + return &recorderImpl{scheme, source, eventBroadcaster.Broadcaster, clock.RealClock{}} +} + +type recorderImpl struct { + scheme *runtime.Scheme + source v1.EventSource + *watch.Broadcaster + clock clock.Clock +} + +func (recorder *recorderImpl) generateEvent(object runtime.Object, annotations map[string]string, timestamp metav1.Time, eventtype, reason, message string) { + ref, err := ref.GetReference(recorder.scheme, object) + if err != nil { + glog.Errorf("Could not construct reference to: '%#v' due to: '%v'. Will not report event: '%v' '%v' '%v'", object, err, eventtype, reason, message) + return + } + + if !validateEventType(eventtype) { + glog.Errorf("Unsupported event type: '%v'", eventtype) + return + } + + event := recorder.makeEvent(ref, annotations, eventtype, reason, message) + event.Source = recorder.source + + go func() { + // NOTE: events should be a non-blocking operation + defer utilruntime.HandleCrash() + recorder.Action(watch.Added, event) + }() +} + +func validateEventType(eventtype string) bool { + switch eventtype { + case v1.EventTypeNormal, v1.EventTypeWarning: + return true + } + return false +} + +func (recorder *recorderImpl) Event(object runtime.Object, eventtype, reason, message string) { + recorder.generateEvent(object, nil, metav1.Now(), eventtype, reason, message) +} + +func (recorder *recorderImpl) Eventf(object runtime.Object, eventtype, reason, messageFmt string, args ...interface{}) { + recorder.Event(object, eventtype, reason, fmt.Sprintf(messageFmt, args...)) +} + +func (recorder *recorderImpl) PastEventf(object runtime.Object, timestamp metav1.Time, eventtype, reason, messageFmt string, args ...interface{}) { + recorder.generateEvent(object, nil, timestamp, eventtype, reason, fmt.Sprintf(messageFmt, args...)) +} + +func (recorder *recorderImpl) AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{}) { + recorder.generateEvent(object, annotations, metav1.Now(), eventtype, reason, fmt.Sprintf(messageFmt, args...)) +} + +func (recorder *recorderImpl) makeEvent(ref *v1.ObjectReference, annotations map[string]string, eventtype, reason, message string) *v1.Event { + t := metav1.Time{Time: recorder.clock.Now()} + namespace := ref.Namespace + if namespace == "" { + namespace = metav1.NamespaceDefault + } + return &v1.Event{ + ObjectMeta: metav1.ObjectMeta{ + Name: fmt.Sprintf("%v.%x", ref.Name, t.UnixNano()), + Namespace: namespace, + Annotations: annotations, + }, + InvolvedObject: *ref, + Reason: reason, + Message: message, + FirstTimestamp: t, + LastTimestamp: t, + Count: 1, + Type: eventtype, + } +} diff --git a/vendor/k8s.io/client-go/tools/record/events_cache.go b/vendor/k8s.io/client-go/tools/record/events_cache.go new file mode 100644 index 00000000..a42084f3 --- /dev/null +++ b/vendor/k8s.io/client-go/tools/record/events_cache.go @@ -0,0 +1,462 @@ +/* +Copyright 2015 The Kubernetes 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 record + +import ( + "encoding/json" + "fmt" + "strings" + "sync" + "time" + + "github.com/golang/groupcache/lru" + + "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/clock" + "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/apimachinery/pkg/util/strategicpatch" + "k8s.io/client-go/util/flowcontrol" +) + +const ( + maxLruCacheEntries = 4096 + + // if we see the same event that varies only by message + // more than 10 times in a 10 minute period, aggregate the event + defaultAggregateMaxEvents = 10 + defaultAggregateIntervalInSeconds = 600 + + // by default, allow a source to send 25 events about an object + // but control the refill rate to 1 new event every 5 minutes + // this helps control the long-tail of events for things that are always + // unhealthy + defaultSpamBurst = 25 + defaultSpamQPS = 1. / 300. +) + +// getEventKey builds unique event key based on source, involvedObject, reason, message +func getEventKey(event *v1.Event) string { + return strings.Join([]string{ + event.Source.Component, + event.Source.Host, + event.InvolvedObject.Kind, + event.InvolvedObject.Namespace, + event.InvolvedObject.Name, + event.InvolvedObject.FieldPath, + string(event.InvolvedObject.UID), + event.InvolvedObject.APIVersion, + event.Type, + event.Reason, + event.Message, + }, + "") +} + +// getSpamKey builds unique event key based on source, involvedObject +func getSpamKey(event *v1.Event) string { + return strings.Join([]string{ + event.Source.Component, + event.Source.Host, + event.InvolvedObject.Kind, + event.InvolvedObject.Namespace, + event.InvolvedObject.Name, + string(event.InvolvedObject.UID), + event.InvolvedObject.APIVersion, + }, + "") +} + +// EventFilterFunc is a function that returns true if the event should be skipped +type EventFilterFunc func(event *v1.Event) bool + +// EventSourceObjectSpamFilter is responsible for throttling +// the amount of events a source and object can produce. +type EventSourceObjectSpamFilter struct { + sync.RWMutex + + // the cache that manages last synced state + cache *lru.Cache + + // burst is the amount of events we allow per source + object + burst int + + // qps is the refill rate of the token bucket in queries per second + qps float32 + + // clock is used to allow for testing over a time interval + clock clock.Clock +} + +// NewEventSourceObjectSpamFilter allows burst events from a source about an object with the specified qps refill. +func NewEventSourceObjectSpamFilter(lruCacheSize, burst int, qps float32, clock clock.Clock) *EventSourceObjectSpamFilter { + return &EventSourceObjectSpamFilter{ + cache: lru.New(lruCacheSize), + burst: burst, + qps: qps, + clock: clock, + } +} + +// spamRecord holds data used to perform spam filtering decisions. +type spamRecord struct { + // rateLimiter controls the rate of events about this object + rateLimiter flowcontrol.RateLimiter +} + +// Filter controls that a given source+object are not exceeding the allowed rate. +func (f *EventSourceObjectSpamFilter) Filter(event *v1.Event) bool { + var record spamRecord + + // controls our cached information about this event (source+object) + eventKey := getSpamKey(event) + + // do we have a record of similar events in our cache? + f.Lock() + defer f.Unlock() + value, found := f.cache.Get(eventKey) + if found { + record = value.(spamRecord) + } + + // verify we have a rate limiter for this record + if record.rateLimiter == nil { + record.rateLimiter = flowcontrol.NewTokenBucketRateLimiterWithClock(f.qps, f.burst, f.clock) + } + + // ensure we have available rate + filter := !record.rateLimiter.TryAccept() + + // update the cache + f.cache.Add(eventKey, record) + + return filter +} + +// EventAggregatorKeyFunc is responsible for grouping events for aggregation +// It returns a tuple of the following: +// aggregateKey - key the identifies the aggregate group to bucket this event +// localKey - key that makes this event in the local group +type EventAggregatorKeyFunc func(event *v1.Event) (aggregateKey string, localKey string) + +// EventAggregatorByReasonFunc aggregates events by exact match on event.Source, event.InvolvedObject, event.Type and event.Reason +func EventAggregatorByReasonFunc(event *v1.Event) (string, string) { + return strings.Join([]string{ + event.Source.Component, + event.Source.Host, + event.InvolvedObject.Kind, + event.InvolvedObject.Namespace, + event.InvolvedObject.Name, + string(event.InvolvedObject.UID), + event.InvolvedObject.APIVersion, + event.Type, + event.Reason, + }, + ""), event.Message +} + +// EventAggregatorMessageFunc is responsible for producing an aggregation message +type EventAggregatorMessageFunc func(event *v1.Event) string + +// EventAggregratorByReasonMessageFunc returns an aggregate message by prefixing the incoming message +func EventAggregatorByReasonMessageFunc(event *v1.Event) string { + return "(combined from similar events): " + event.Message +} + +// EventAggregator identifies similar events and aggregates them into a single event +type EventAggregator struct { + sync.RWMutex + + // The cache that manages aggregation state + cache *lru.Cache + + // The function that groups events for aggregation + keyFunc EventAggregatorKeyFunc + + // The function that generates a message for an aggregate event + messageFunc EventAggregatorMessageFunc + + // The maximum number of events in the specified interval before aggregation occurs + maxEvents uint + + // The amount of time in seconds that must transpire since the last occurrence of a similar event before it's considered new + maxIntervalInSeconds uint + + // clock is used to allow for testing over a time interval + clock clock.Clock +} + +// NewEventAggregator returns a new instance of an EventAggregator +func NewEventAggregator(lruCacheSize int, keyFunc EventAggregatorKeyFunc, messageFunc EventAggregatorMessageFunc, + maxEvents int, maxIntervalInSeconds int, clock clock.Clock) *EventAggregator { + return &EventAggregator{ + cache: lru.New(lruCacheSize), + keyFunc: keyFunc, + messageFunc: messageFunc, + maxEvents: uint(maxEvents), + maxIntervalInSeconds: uint(maxIntervalInSeconds), + clock: clock, + } +} + +// aggregateRecord holds data used to perform aggregation decisions +type aggregateRecord struct { + // we track the number of unique local keys we have seen in the aggregate set to know when to actually aggregate + // if the size of this set exceeds the max, we know we need to aggregate + localKeys sets.String + // The last time at which the aggregate was recorded + lastTimestamp metav1.Time +} + +// EventAggregate checks if a similar event has been seen according to the +// aggregation configuration (max events, max interval, etc) and returns: +// +// - The (potentially modified) event that should be created +// - The cache key for the event, for correlation purposes. This will be set to +// the full key for normal events, and to the result of +// EventAggregatorMessageFunc for aggregate events. +func (e *EventAggregator) EventAggregate(newEvent *v1.Event) (*v1.Event, string) { + now := metav1.NewTime(e.clock.Now()) + var record aggregateRecord + // eventKey is the full cache key for this event + eventKey := getEventKey(newEvent) + // aggregateKey is for the aggregate event, if one is needed. + aggregateKey, localKey := e.keyFunc(newEvent) + + // Do we have a record of similar events in our cache? + e.Lock() + defer e.Unlock() + value, found := e.cache.Get(aggregateKey) + if found { + record = value.(aggregateRecord) + } + + // Is the previous record too old? If so, make a fresh one. Note: if we didn't + // find a similar record, its lastTimestamp will be the zero value, so we + // create a new one in that case. + maxInterval := time.Duration(e.maxIntervalInSeconds) * time.Second + interval := now.Time.Sub(record.lastTimestamp.Time) + if interval > maxInterval { + record = aggregateRecord{localKeys: sets.NewString()} + } + + // Write the new event into the aggregation record and put it on the cache + record.localKeys.Insert(localKey) + record.lastTimestamp = now + e.cache.Add(aggregateKey, record) + + // If we are not yet over the threshold for unique events, don't correlate them + if uint(record.localKeys.Len()) < e.maxEvents { + return newEvent, eventKey + } + + // do not grow our local key set any larger than max + record.localKeys.PopAny() + + // create a new aggregate event, and return the aggregateKey as the cache key + // (so that it can be overwritten.) + eventCopy := &v1.Event{ + ObjectMeta: metav1.ObjectMeta{ + Name: fmt.Sprintf("%v.%x", newEvent.InvolvedObject.Name, now.UnixNano()), + Namespace: newEvent.Namespace, + }, + Count: 1, + FirstTimestamp: now, + InvolvedObject: newEvent.InvolvedObject, + LastTimestamp: now, + Message: e.messageFunc(newEvent), + Type: newEvent.Type, + Reason: newEvent.Reason, + Source: newEvent.Source, + } + return eventCopy, aggregateKey +} + +// eventLog records data about when an event was observed +type eventLog struct { + // The number of times the event has occurred since first occurrence. + count uint + + // The time at which the event was first recorded. + firstTimestamp metav1.Time + + // The unique name of the first occurrence of this event + name string + + // Resource version returned from previous interaction with server + resourceVersion string +} + +// eventLogger logs occurrences of an event +type eventLogger struct { + sync.RWMutex + cache *lru.Cache + clock clock.Clock +} + +// newEventLogger observes events and counts their frequencies +func newEventLogger(lruCacheEntries int, clock clock.Clock) *eventLogger { + return &eventLogger{cache: lru.New(lruCacheEntries), clock: clock} +} + +// eventObserve records an event, or updates an existing one if key is a cache hit +func (e *eventLogger) eventObserve(newEvent *v1.Event, key string) (*v1.Event, []byte, error) { + var ( + patch []byte + err error + ) + eventCopy := *newEvent + event := &eventCopy + + e.Lock() + defer e.Unlock() + + // Check if there is an existing event we should update + lastObservation := e.lastEventObservationFromCache(key) + + // If we found a result, prepare a patch + if lastObservation.count > 0 { + // update the event based on the last observation so patch will work as desired + event.Name = lastObservation.name + event.ResourceVersion = lastObservation.resourceVersion + event.FirstTimestamp = lastObservation.firstTimestamp + event.Count = int32(lastObservation.count) + 1 + + eventCopy2 := *event + eventCopy2.Count = 0 + eventCopy2.LastTimestamp = metav1.NewTime(time.Unix(0, 0)) + eventCopy2.Message = "" + + newData, _ := json.Marshal(event) + oldData, _ := json.Marshal(eventCopy2) + patch, err = strategicpatch.CreateTwoWayMergePatch(oldData, newData, event) + } + + // record our new observation + e.cache.Add( + key, + eventLog{ + count: uint(event.Count), + firstTimestamp: event.FirstTimestamp, + name: event.Name, + resourceVersion: event.ResourceVersion, + }, + ) + return event, patch, err +} + +// updateState updates its internal tracking information based on latest server state +func (e *eventLogger) updateState(event *v1.Event) { + key := getEventKey(event) + e.Lock() + defer e.Unlock() + // record our new observation + e.cache.Add( + key, + eventLog{ + count: uint(event.Count), + firstTimestamp: event.FirstTimestamp, + name: event.Name, + resourceVersion: event.ResourceVersion, + }, + ) +} + +// lastEventObservationFromCache returns the event from the cache, reads must be protected via external lock +func (e *eventLogger) lastEventObservationFromCache(key string) eventLog { + value, ok := e.cache.Get(key) + if ok { + observationValue, ok := value.(eventLog) + if ok { + return observationValue + } + } + return eventLog{} +} + +// EventCorrelator processes all incoming events and performs analysis to avoid overwhelming the system. It can filter all +// incoming events to see if the event should be filtered from further processing. It can aggregate similar events that occur +// frequently to protect the system from spamming events that are difficult for users to distinguish. It performs de-duplication +// to ensure events that are observed multiple times are compacted into a single event with increasing counts. +type EventCorrelator struct { + // the function to filter the event + filterFunc EventFilterFunc + // the object that performs event aggregation + aggregator *EventAggregator + // the object that observes events as they come through + logger *eventLogger +} + +// EventCorrelateResult is the result of a Correlate +type EventCorrelateResult struct { + // the event after correlation + Event *v1.Event + // if provided, perform a strategic patch when updating the record on the server + Patch []byte + // if true, do no further processing of the event + Skip bool +} + +// NewEventCorrelator returns an EventCorrelator configured with default values. +// +// The EventCorrelator is responsible for event filtering, aggregating, and counting +// prior to interacting with the API server to record the event. +// +// The default behavior is as follows: +// * Aggregation is performed if a similar event is recorded 10 times in a +// in a 10 minute rolling interval. A similar event is an event that varies only by +// the Event.Message field. Rather than recording the precise event, aggregation +// will create a new event whose message reports that it has combined events with +// the same reason. +// * Events are incrementally counted if the exact same event is encountered multiple +// times. +// * A source may burst 25 events about an object, but has a refill rate budget +// per object of 1 event every 5 minutes to control long-tail of spam. +func NewEventCorrelator(clock clock.Clock) *EventCorrelator { + cacheSize := maxLruCacheEntries + spamFilter := NewEventSourceObjectSpamFilter(cacheSize, defaultSpamBurst, defaultSpamQPS, clock) + return &EventCorrelator{ + filterFunc: spamFilter.Filter, + aggregator: NewEventAggregator( + cacheSize, + EventAggregatorByReasonFunc, + EventAggregatorByReasonMessageFunc, + defaultAggregateMaxEvents, + defaultAggregateIntervalInSeconds, + clock), + + logger: newEventLogger(cacheSize, clock), + } +} + +// EventCorrelate filters, aggregates, counts, and de-duplicates all incoming events +func (c *EventCorrelator) EventCorrelate(newEvent *v1.Event) (*EventCorrelateResult, error) { + if newEvent == nil { + return nil, fmt.Errorf("event is nil") + } + aggregateEvent, ckey := c.aggregator.EventAggregate(newEvent) + observedEvent, patch, err := c.logger.eventObserve(aggregateEvent, ckey) + if c.filterFunc(observedEvent) { + return &EventCorrelateResult{Skip: true}, nil + } + return &EventCorrelateResult{Event: observedEvent, Patch: patch}, err +} + +// UpdateState based on the latest observed state from server +func (c *EventCorrelator) UpdateState(event *v1.Event) { + c.logger.updateState(event) +} diff --git a/vendor/k8s.io/client-go/tools/record/fake.go b/vendor/k8s.io/client-go/tools/record/fake.go new file mode 100644 index 00000000..6e031daa --- /dev/null +++ b/vendor/k8s.io/client-go/tools/record/fake.go @@ -0,0 +1,58 @@ +/* +Copyright 2015 The Kubernetes 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 record + +import ( + "fmt" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +// FakeRecorder is used as a fake during tests. It is thread safe. It is usable +// when created manually and not by NewFakeRecorder, however all events may be +// thrown away in this case. +type FakeRecorder struct { + Events chan string +} + +func (f *FakeRecorder) Event(object runtime.Object, eventtype, reason, message string) { + if f.Events != nil { + f.Events <- fmt.Sprintf("%s %s %s", eventtype, reason, message) + } +} + +func (f *FakeRecorder) Eventf(object runtime.Object, eventtype, reason, messageFmt string, args ...interface{}) { + if f.Events != nil { + f.Events <- fmt.Sprintf(eventtype+" "+reason+" "+messageFmt, args...) + } +} + +func (f *FakeRecorder) PastEventf(object runtime.Object, timestamp metav1.Time, eventtype, reason, messageFmt string, args ...interface{}) { +} + +func (f *FakeRecorder) AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{}) { + f.Eventf(object, eventtype, reason, messageFmt, args) +} + +// NewFakeRecorder creates new fake event recorder with event channel with +// buffer of given size. +func NewFakeRecorder(bufferSize int) *FakeRecorder { + return &FakeRecorder{ + Events: make(chan string, bufferSize), + } +} diff --git a/vendor/github.com/knative/pkg/.gitattributes b/vendor/knative.dev/pkg/.gitattributes similarity index 100% rename from vendor/github.com/knative/pkg/.gitattributes rename to vendor/knative.dev/pkg/.gitattributes diff --git a/vendor/knative.dev/pkg/.github/PULL_REQUEST_TEMPLATE/breaking-change.md b/vendor/knative.dev/pkg/.github/PULL_REQUEST_TEMPLATE/breaking-change.md new file mode 100644 index 00000000..73586619 --- /dev/null +++ b/vendor/knative.dev/pkg/.github/PULL_REQUEST_TEMPLATE/breaking-change.md @@ -0,0 +1,22 @@ +--- +name: Breaking Change +about: Makes a breaking change to knative/pkg +title: '' +labels: +assignees: 'mattmoor' + +--- + +BREAKING CHANGES MUST STAGE CHANGES ONTO DOWNSTREAM +KNATIVE REPOSITORIES + + +| Repo | Pull Request | +|-------------------|--------------------------------| +| Build | knative/build#1234 | +| Eventing | knative/eventing#1234 | +| Serving | knative/serving#1234 | +| Sample Controller | knative/sample-controller#1234 | + + +cc @n3wscott @jasonhall diff --git a/vendor/knative.dev/pkg/.github/PULL_REQUEST_TEMPLATE/bug-fix.md b/vendor/knative.dev/pkg/.github/PULL_REQUEST_TEMPLATE/bug-fix.md new file mode 100644 index 00000000..3fdf033b --- /dev/null +++ b/vendor/knative.dev/pkg/.github/PULL_REQUEST_TEMPLATE/bug-fix.md @@ -0,0 +1,10 @@ +--- +name: Bug Fix +about: Fixes a bug in knative/pkg +title: '' +labels: kind/bug +assignees: '' + +--- + +Fixes: diff --git a/vendor/knative.dev/pkg/.github/PULL_REQUEST_TEMPLATE/normal-change.md b/vendor/knative.dev/pkg/.github/PULL_REQUEST_TEMPLATE/normal-change.md new file mode 100644 index 00000000..cc751f59 --- /dev/null +++ b/vendor/knative.dev/pkg/.github/PULL_REQUEST_TEMPLATE/normal-change.md @@ -0,0 +1,8 @@ +--- +name: Normal Change +about: Makes a boring change to the repo. +title: '' +labels: +assignees: '' + +--- diff --git a/vendor/github.com/knative/pkg/.github/issue-template.md b/vendor/knative.dev/pkg/.github/issue-template.md similarity index 100% rename from vendor/github.com/knative/pkg/.github/issue-template.md rename to vendor/knative.dev/pkg/.github/issue-template.md diff --git a/vendor/github.com/knative/pkg/.gitignore b/vendor/knative.dev/pkg/.gitignore similarity index 100% rename from vendor/github.com/knative/pkg/.gitignore rename to vendor/knative.dev/pkg/.gitignore diff --git a/vendor/github.com/knative/pkg/CONTRIBUTING.md b/vendor/knative.dev/pkg/CONTRIBUTING.md similarity index 100% rename from vendor/github.com/knative/pkg/CONTRIBUTING.md rename to vendor/knative.dev/pkg/CONTRIBUTING.md diff --git a/vendor/github.com/knative/pkg/DEVELOPMENT.md b/vendor/knative.dev/pkg/DEVELOPMENT.md similarity index 94% rename from vendor/github.com/knative/pkg/DEVELOPMENT.md rename to vendor/knative.dev/pkg/DEVELOPMENT.md index 31565202..f7b9b199 100644 --- a/vendor/github.com/knative/pkg/DEVELOPMENT.md +++ b/vendor/knative.dev/pkg/DEVELOPMENT.md @@ -46,7 +46,7 @@ export PATH="${PATH}:${GOPATH}/bin" ### Checkout your fork The Go tools require that you clone the repository to the -`src/github.com/knative/pkg` directory in your +`src/knative.dev/pkg` directory in your [`GOPATH`](https://github.com/golang/go/wiki/SettingGOPATH). To check out this repository: @@ -56,8 +56,8 @@ To check out this repository: 1. Clone it to your machine: ```shell -mkdir -p ${GOPATH}/src/github.com/knative -cd ${GOPATH}/src/github.com/knative +mkdir -p ${GOPATH}/src/knative.dev +cd ${GOPATH}/src/knative.dev git clone git@github.com:${YOUR_GITHUB_USERNAME}/pkg.git cd pkg git remote add upstream git@github.com:knative/pkg.git diff --git a/vendor/github.com/knative/pkg/Gopkg.lock b/vendor/knative.dev/pkg/Gopkg.lock similarity index 95% rename from vendor/github.com/knative/pkg/Gopkg.lock rename to vendor/knative.dev/pkg/Gopkg.lock index 67eb5019..a5c181fd 100644 --- a/vendor/github.com/knative/pkg/Gopkg.lock +++ b/vendor/knative.dev/pkg/Gopkg.lock @@ -300,14 +300,14 @@ [[projects]] branch = "master" - digest = "1:1bfc083da5bbeb7abaac53c56890eb14eb11bac9ec985bfe338c4bbb0540c9ba" + digest = "1:fa87bf3dd5923ba242fd7b496eb170a158e449f6b4a9ba3f0890c551b808f620" name = "github.com/knative/test-infra" packages = [ "scripts", "tools/dep-collector", ] pruneopts = "UT" - revision = "1576da30069624094cf01719452da944b3046826" + revision = "0d9dc298d262fe0b0f6944aa9d45b9ab7f6b34ea" [[projects]] digest = "1:56dbf15e091bf7926cb33a57cb6bdfc658fc6d3498d2f76f10a97ce7856f1fde" @@ -780,6 +780,27 @@ revision = "145d52631d00cbfe68490d19ae4f0f501fd31a95" version = "kubernetes-1.12.6" +[[projects]] + digest = "1:6def8acd040e85b3becb1dd73de1f22a787fd9776e32aa3bbac9cf9727b53d0d" + name = "k8s.io/apiextensions-apiserver" + packages = [ + "pkg/apis/apiextensions", + "pkg/apis/apiextensions/v1beta1", + "pkg/client/clientset/clientset", + "pkg/client/clientset/clientset/fake", + "pkg/client/clientset/clientset/scheme", + "pkg/client/clientset/clientset/typed/apiextensions/v1beta1", + "pkg/client/clientset/clientset/typed/apiextensions/v1beta1/fake", + "pkg/client/informers/externalversions", + "pkg/client/informers/externalversions/apiextensions", + "pkg/client/informers/externalversions/apiextensions/v1beta1", + "pkg/client/informers/externalversions/internalinterfaces", + "pkg/client/listers/apiextensions/v1beta1", + ] + pruneopts = "NUT" + revision = "bd0469a053ff88529a61145790499fe78a09a49d" + version = "kubernetes-1.12.6" + [[projects]] digest = "1:119ae04ee44c5d179dcde1ee686f057cfe3fc54a7ee8484b920932a80309e88b" name = "k8s.io/apimachinery" @@ -836,7 +857,7 @@ version = "kubernetes-1.12.6" [[projects]] - digest = "1:07be043078c2dc2ee33e81278b264a84f364c6d711811d2932aa42212fc4f2ae" + digest = "1:b7dd0420e85cb2968ffb945f2810ea6c796dc2a08660618e2200c08c596f0624" name = "k8s.io/client-go" packages = [ "discovery", @@ -984,11 +1005,9 @@ "pkg/apis/clientauthentication/v1beta1", "pkg/version", "plugin/pkg/client/auth/exec", - "plugin/pkg/client/auth/gcp", "rest", "rest/watch", "testing", - "third_party/forked/golang/template", "tools/auth", "tools/cache", "tools/clientcmd", @@ -1006,7 +1025,6 @@ "util/flowcontrol", "util/homedir", "util/integer", - "util/jsonpath", "util/retry", "util/workqueue", ] @@ -1121,6 +1139,10 @@ "k8s.io/api/batch/v1", "k8s.io/api/core/v1", "k8s.io/api/rbac/v1", + "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset", + "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake", + "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions", + "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/v1beta1", "k8s.io/apimachinery/pkg/api/equality", "k8s.io/apimachinery/pkg/api/errors", "k8s.io/apimachinery/pkg/api/meta", @@ -1149,12 +1171,13 @@ "k8s.io/client-go/informers/apps/v1", "k8s.io/client-go/informers/autoscaling/v1", "k8s.io/client-go/informers/autoscaling/v2beta1", + "k8s.io/client-go/informers/batch/v1", "k8s.io/client-go/informers/core/v1", + "k8s.io/client-go/informers/rbac/v1", "k8s.io/client-go/kubernetes", "k8s.io/client-go/kubernetes/fake", "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1", "k8s.io/client-go/kubernetes/typed/core/v1", - "k8s.io/client-go/plugin/pkg/client/auth/gcp", "k8s.io/client-go/rest", "k8s.io/client-go/testing", "k8s.io/client-go/tools/cache", diff --git a/vendor/github.com/knative/pkg/Gopkg.toml b/vendor/knative.dev/pkg/Gopkg.toml similarity index 95% rename from vendor/github.com/knative/pkg/Gopkg.toml rename to vendor/knative.dev/pkg/Gopkg.toml index e7e23114..4403eaae 100644 --- a/vendor/github.com/knative/pkg/Gopkg.toml +++ b/vendor/knative.dev/pkg/Gopkg.toml @@ -18,6 +18,10 @@ required = [ name = "k8s.io/api" version = "kubernetes-1.12.6" +[[override]] + name = "k8s.io/apiextensions-apiserver" + version = "kubernetes-1.12.6" + [[constraint]] name = "k8s.io/apimachinery" version = "kubernetes-1.12.6" diff --git a/vendor/github.com/knative/pkg/LICENSE b/vendor/knative.dev/pkg/LICENSE similarity index 100% rename from vendor/github.com/knative/pkg/LICENSE rename to vendor/knative.dev/pkg/LICENSE diff --git a/vendor/github.com/knative/pkg/OWNERS_ALIASES b/vendor/knative.dev/pkg/OWNERS_ALIASES similarity index 100% rename from vendor/github.com/knative/pkg/OWNERS_ALIASES rename to vendor/knative.dev/pkg/OWNERS_ALIASES diff --git a/vendor/github.com/knative/pkg/README.md b/vendor/knative.dev/pkg/README.md similarity index 100% rename from vendor/github.com/knative/pkg/README.md rename to vendor/knative.dev/pkg/README.md diff --git a/vendor/knative.dev/pkg/RELEASING.md b/vendor/knative.dev/pkg/RELEASING.md new file mode 100644 index 00000000..36044d76 --- /dev/null +++ b/vendor/knative.dev/pkg/RELEASING.md @@ -0,0 +1,91 @@ +# Releasing knative/pkg + +We release the components of Knative every 6 weeks. All of these components must +be moved to the latest "release" of the knative/pkg shared library prior to each +release, but likely this should happen incrementally over each milestone. + +## Release Process. + +### Step #1: Monday the week prior to each release. + +On Monday of the week prior to the Knative release, each of the downstream +repositories should stage a `[WIP]` Pull Request that advances the knative/pkg +dependency to the latest commit. + +At present, these downstream repositories include: + +1. knative/serving +1. knative/eventing +1. knative/eventing-contrib +1. knative/build +1. knative/sample-controller +1. GoogleCloudPlatform/cloud-run-events + +> The automation that auto-bumps these lives +> [here](https://github.com/mattmoor/knobots/tree/knative/cmd/periodic/kodata). + +`Gopkg.toml` should look like: + +```toml +[[override]] + name = "github.com/knative/pkg" + branch = "master" +``` + +Then the following is run: + +```shell +dep ensure -update github.com/knative/pkg +./hack/update-codegen.sh +``` + +If problems are found, they are addressed and the update is merged, and this +process repeats until knative/pkg can be cleanly updated without any changes. + +> If by mid-week, we do not have a clean PR in each repository, the person +> driving the update should escalate to avoid delaying the release. + +### Step #2: Friday the week prior to each release. + +A release branch is snapped on knative/pkg with the form `release-0.X` where `X` +reflects the forthcoming Knative release. The commit at which this branch is +snapped will be the version that has been staged into `[WIP]` PRs in every +repository. + +These staging PRs are then updated to: + +```toml +[[override]] + name = "github.com/knative/pkg" + # The 0.X release branch. + branch = "release-0.X" +``` + +The `[WIP]` is removed, and the PRs are reviewed and merged. + +## Backporting Fixes + +If a problem is found in knative/pkg in an older release and a fix must be +backported then it should first be fixed at HEAD (if still relevant). It should +be called out and likely discussed (with a lead) in the original PR whether the +fix is desired and eligible for back-porting to a release branch. This may raise +the review bar, or lead to trade-offs in design; it is better to front-load this +consideration to avoid delaying a cherry-pick. + +Once that PR has merged (if still relevant), the same commit should be +cherry-picked onto `release-0.Y` and any merge problems fixed up. + +Once the change is ready, a PR should be sent against `release-0.Y` with the +prefix `[RELEASE-0.Y] Your PR Title` to clearly designate this PR as targeting +the release branch. A lead will review and make a ruling on the PR, but if this +consideration was front-loaded, it should be a short review. + +### Picking up fixes + +Downstream repositories should reference `knative/pkg` release branches from +their own release branches, so to update the `knative/pkg` dependency we run: + +```shell +dep ensure -update github.com/knative/pkg +./hack/update-deps.sh +``` diff --git a/vendor/github.com/knative/pkg/apis/condition_set.go b/vendor/knative.dev/pkg/apis/condition_set.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/condition_set.go rename to vendor/knative.dev/pkg/apis/condition_set.go diff --git a/vendor/github.com/knative/pkg/apis/condition_types.go b/vendor/knative.dev/pkg/apis/condition_types.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/condition_types.go rename to vendor/knative.dev/pkg/apis/condition_types.go diff --git a/vendor/github.com/knative/pkg/apis/contexts.go b/vendor/knative.dev/pkg/apis/contexts.go similarity index 86% rename from vendor/github.com/knative/pkg/apis/contexts.go rename to vendor/knative.dev/pkg/apis/contexts.go index 466b8980..287761e1 100644 --- a/vendor/github.com/knative/pkg/apis/contexts.go +++ b/vendor/knative.dev/pkg/apis/contexts.go @@ -42,10 +42,26 @@ func IsInCreate(ctx context.Context) bool { // the receiver being validated is being updated. type inUpdateKey struct{} +type updatePayload struct { + base interface{} + subresource string +} + // WithinUpdate is used to note that the webhook is calling within // the context of a Update operation. func WithinUpdate(ctx context.Context, base interface{}) context.Context { - return context.WithValue(ctx, inUpdateKey{}, base) + return context.WithValue(ctx, inUpdateKey{}, &updatePayload{ + base: base, + }) +} + +// WithinSubResourceUpdate is used to note that the webhook is calling within +// the context of a Update operation on a subresource. +func WithinSubResourceUpdate(ctx context.Context, base interface{}, sr string) context.Context { + return context.WithValue(ctx, inUpdateKey{}, &updatePayload{ + base: base, + subresource: sr, + }) } // IsInUpdate checks whether the context is an Update. @@ -53,10 +69,24 @@ func IsInUpdate(ctx context.Context) bool { return ctx.Value(inUpdateKey{}) != nil } +// IsInStatusUpdate checks whether the context is an Update. +func IsInStatusUpdate(ctx context.Context) bool { + value := ctx.Value(inUpdateKey{}) + if value == nil { + return false + } + up := value.(*updatePayload) + return up.subresource == "status" +} + // GetBaseline returns the baseline of the update, or nil when we // are not within an update context. func GetBaseline(ctx context.Context) interface{} { - return ctx.Value(inUpdateKey{}) + value := ctx.Value(inUpdateKey{}) + if value == nil { + return nil + } + return value.(*updatePayload).base } // This is attached to contexts passed to webhook interfaces when diff --git a/vendor/github.com/knative/pkg/apis/deprecated.go b/vendor/knative.dev/pkg/apis/deprecated.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/deprecated.go rename to vendor/knative.dev/pkg/apis/deprecated.go diff --git a/vendor/github.com/knative/pkg/apis/doc.go b/vendor/knative.dev/pkg/apis/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/doc.go rename to vendor/knative.dev/pkg/apis/doc.go diff --git a/vendor/github.com/knative/pkg/apis/duck/cached.go b/vendor/knative.dev/pkg/apis/duck/cached.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/duck/cached.go rename to vendor/knative.dev/pkg/apis/duck/cached.go diff --git a/vendor/github.com/knative/pkg/apis/duck/doc.go b/vendor/knative.dev/pkg/apis/duck/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/duck/doc.go rename to vendor/knative.dev/pkg/apis/duck/doc.go diff --git a/vendor/github.com/knative/pkg/apis/duck/enqueue.go b/vendor/knative.dev/pkg/apis/duck/enqueue.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/duck/enqueue.go rename to vendor/knative.dev/pkg/apis/duck/enqueue.go diff --git a/vendor/github.com/knative/pkg/apis/duck/interface.go b/vendor/knative.dev/pkg/apis/duck/interface.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/duck/interface.go rename to vendor/knative.dev/pkg/apis/duck/interface.go diff --git a/vendor/github.com/knative/pkg/apis/duck/patch.go b/vendor/knative.dev/pkg/apis/duck/patch.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/duck/patch.go rename to vendor/knative.dev/pkg/apis/duck/patch.go diff --git a/vendor/github.com/knative/pkg/apis/duck/proxy.go b/vendor/knative.dev/pkg/apis/duck/proxy.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/duck/proxy.go rename to vendor/knative.dev/pkg/apis/duck/proxy.go diff --git a/vendor/github.com/knative/pkg/apis/duck/register.go b/vendor/knative.dev/pkg/apis/duck/register.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/duck/register.go rename to vendor/knative.dev/pkg/apis/duck/register.go diff --git a/vendor/github.com/knative/pkg/apis/duck/typed.go b/vendor/knative.dev/pkg/apis/duck/typed.go similarity index 75% rename from vendor/github.com/knative/pkg/apis/duck/typed.go rename to vendor/knative.dev/pkg/apis/duck/typed.go index 9d29c1e0..bf992c49 100644 --- a/vendor/github.com/knative/pkg/apis/duck/typed.go +++ b/vendor/knative.dev/pkg/apis/duck/typed.go @@ -29,7 +29,7 @@ import ( "k8s.io/client-go/dynamic" "k8s.io/client-go/tools/cache" - "github.com/knative/pkg/apis" + "knative.dev/pkg/apis" ) // TypedInformerFactory implements InformerFactory such that the elements @@ -94,44 +94,36 @@ func AsStructuredWatcher(wf cache.WatchFunc, obj runtime.Object) cache.WatchFunc go func() { defer close(structuredCh) unstructuredCh := uw.ResultChan() - for { - select { - case ue, ok := <-unstructuredCh: - if !ok { - // Channel is closed. - return - } + for ue := range unstructuredCh { + unstructuredObj, ok := ue.Object.(*unstructured.Unstructured) + if !ok { + // If it isn't an unstructured object, then forward the + // event as-is. This is likely to happen when the event's + // Type is an Error. + structuredCh <- ue + continue + } + structuredObj := obj.DeepCopyObject() - unstructuredObj, ok := ue.Object.(*unstructured.Unstructured) - if !ok { - // If it isn't an unstructured object, then forward the - // event as-is. This is likely to happen when the event's - // Type is an Error. - structuredCh <- ue - continue - } - structuredObj := obj.DeepCopyObject() - - err := FromUnstructured(unstructuredObj, structuredObj) - if err != nil { - // Pass back an error indicating that the object we got - // was invalid. - structuredCh <- watch.Event{ - Type: watch.Error, - Object: &metav1.Status{ - Status: metav1.StatusFailure, - Code: http.StatusUnprocessableEntity, - Reason: metav1.StatusReasonInvalid, - Message: err.Error(), - }, - } - continue - } - // Send the structured event. + err := FromUnstructured(unstructuredObj, structuredObj) + if err != nil { + // Pass back an error indicating that the object we got + // was invalid. structuredCh <- watch.Event{ - Type: ue.Type, - Object: structuredObj, + Type: watch.Error, + Object: &metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusUnprocessableEntity, + Reason: metav1.StatusReasonInvalid, + Message: err.Error(), + }, } + continue + } + // Send the structured event. + structuredCh <- watch.Event{ + Type: ue.Type, + Object: structuredObj, } } }() diff --git a/vendor/github.com/knative/pkg/apis/duck/unstructured.go b/vendor/knative.dev/pkg/apis/duck/unstructured.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/duck/unstructured.go rename to vendor/knative.dev/pkg/apis/duck/unstructured.go diff --git a/vendor/github.com/knative/pkg/apis/duck/v1alpha1/addressable_types.go b/vendor/knative.dev/pkg/apis/duck/v1alpha1/addressable_types.go similarity index 96% rename from vendor/github.com/knative/pkg/apis/duck/v1alpha1/addressable_types.go rename to vendor/knative.dev/pkg/apis/duck/v1alpha1/addressable_types.go index 75ab2f57..2b5fcbd9 100644 --- a/vendor/github.com/knative/pkg/apis/duck/v1alpha1/addressable_types.go +++ b/vendor/knative.dev/pkg/apis/duck/v1alpha1/addressable_types.go @@ -20,9 +20,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "github.com/knative/pkg/apis" - "github.com/knative/pkg/apis/duck" - "github.com/knative/pkg/apis/duck/v1beta1" + "knative.dev/pkg/apis" + "knative.dev/pkg/apis/duck" + "knative.dev/pkg/apis/duck/v1beta1" ) // Addressable provides a generic mechanism for a custom resource diff --git a/vendor/github.com/knative/pkg/apis/duck/v1alpha1/condition_set.go b/vendor/knative.dev/pkg/apis/duck/v1alpha1/condition_set.go similarity index 99% rename from vendor/github.com/knative/pkg/apis/duck/v1alpha1/condition_set.go rename to vendor/knative.dev/pkg/apis/duck/v1alpha1/condition_set.go index 72d4bf60..490a5bb8 100644 --- a/vendor/github.com/knative/pkg/apis/duck/v1alpha1/condition_set.go +++ b/vendor/knative.dev/pkg/apis/duck/v1alpha1/condition_set.go @@ -23,7 +23,7 @@ import ( "fmt" - "github.com/knative/pkg/apis" + "knative.dev/pkg/apis" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/vendor/github.com/knative/pkg/apis/duck/v1alpha1/conditions_types.go b/vendor/knative.dev/pkg/apis/duck/v1alpha1/conditions_types.go similarity index 99% rename from vendor/github.com/knative/pkg/apis/duck/v1alpha1/conditions_types.go rename to vendor/knative.dev/pkg/apis/duck/v1alpha1/conditions_types.go index b82de3c4..12003a58 100644 --- a/vendor/github.com/knative/pkg/apis/duck/v1alpha1/conditions_types.go +++ b/vendor/knative.dev/pkg/apis/duck/v1alpha1/conditions_types.go @@ -23,8 +23,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "github.com/knative/pkg/apis" - "github.com/knative/pkg/apis/duck" + "knative.dev/pkg/apis" + "knative.dev/pkg/apis/duck" ) // Conditions is the schema for the conditions portion of the payload diff --git a/vendor/github.com/knative/pkg/apis/duck/v1alpha1/doc.go b/vendor/knative.dev/pkg/apis/duck/v1alpha1/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/duck/v1alpha1/doc.go rename to vendor/knative.dev/pkg/apis/duck/v1alpha1/doc.go diff --git a/vendor/github.com/knative/pkg/apis/duck/v1alpha1/legacy_targetable_types.go b/vendor/knative.dev/pkg/apis/duck/v1alpha1/legacy_targetable_types.go similarity index 97% rename from vendor/github.com/knative/pkg/apis/duck/v1alpha1/legacy_targetable_types.go rename to vendor/knative.dev/pkg/apis/duck/v1alpha1/legacy_targetable_types.go index 5e4d6f2e..27e7c3da 100644 --- a/vendor/github.com/knative/pkg/apis/duck/v1alpha1/legacy_targetable_types.go +++ b/vendor/knative.dev/pkg/apis/duck/v1alpha1/legacy_targetable_types.go @@ -20,8 +20,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "github.com/knative/pkg/apis" - "github.com/knative/pkg/apis/duck" + "knative.dev/pkg/apis" + "knative.dev/pkg/apis/duck" ) // LegacyTargetable left around until we migrate to Addressable in the diff --git a/vendor/github.com/knative/pkg/apis/duck/v1alpha1/register.go b/vendor/knative.dev/pkg/apis/duck/v1alpha1/register.go similarity index 98% rename from vendor/github.com/knative/pkg/apis/duck/v1alpha1/register.go rename to vendor/knative.dev/pkg/apis/duck/v1alpha1/register.go index 4bb344f2..51e3565c 100644 --- a/vendor/github.com/knative/pkg/apis/duck/v1alpha1/register.go +++ b/vendor/knative.dev/pkg/apis/duck/v1alpha1/register.go @@ -17,7 +17,7 @@ limitations under the License. package v1alpha1 import ( - "github.com/knative/pkg/apis/duck" + "knative.dev/pkg/apis/duck" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/vendor/github.com/knative/pkg/apis/duck/v1alpha1/retired_targetable_types.go b/vendor/knative.dev/pkg/apis/duck/v1alpha1/retired_targetable_types.go similarity index 97% rename from vendor/github.com/knative/pkg/apis/duck/v1alpha1/retired_targetable_types.go rename to vendor/knative.dev/pkg/apis/duck/v1alpha1/retired_targetable_types.go index 0e91aef8..9306336d 100644 --- a/vendor/github.com/knative/pkg/apis/duck/v1alpha1/retired_targetable_types.go +++ b/vendor/knative.dev/pkg/apis/duck/v1alpha1/retired_targetable_types.go @@ -20,8 +20,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "github.com/knative/pkg/apis" - "github.com/knative/pkg/apis/duck" + "knative.dev/pkg/apis" + "knative.dev/pkg/apis/duck" ) // Targetable is an earlier version of the Callable interface. diff --git a/vendor/github.com/knative/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go rename to vendor/knative.dev/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go diff --git a/vendor/github.com/knative/pkg/apis/duck/v1beta1/addressable_types.go b/vendor/knative.dev/pkg/apis/duck/v1beta1/addressable_types.go similarity index 97% rename from vendor/github.com/knative/pkg/apis/duck/v1beta1/addressable_types.go rename to vendor/knative.dev/pkg/apis/duck/v1beta1/addressable_types.go index 379098e7..817585a3 100644 --- a/vendor/github.com/knative/pkg/apis/duck/v1beta1/addressable_types.go +++ b/vendor/knative.dev/pkg/apis/duck/v1beta1/addressable_types.go @@ -20,8 +20,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "github.com/knative/pkg/apis" - "github.com/knative/pkg/apis/duck" + "knative.dev/pkg/apis" + "knative.dev/pkg/apis/duck" ) // Addressable provides a generic mechanism for a custom resource diff --git a/vendor/github.com/knative/pkg/apis/duck/v1beta1/doc.go b/vendor/knative.dev/pkg/apis/duck/v1beta1/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/duck/v1beta1/doc.go rename to vendor/knative.dev/pkg/apis/duck/v1beta1/doc.go diff --git a/vendor/github.com/knative/pkg/apis/duck/v1beta1/register.go b/vendor/knative.dev/pkg/apis/duck/v1beta1/register.go similarity index 97% rename from vendor/github.com/knative/pkg/apis/duck/v1beta1/register.go rename to vendor/knative.dev/pkg/apis/duck/v1beta1/register.go index c337e4a6..7d5ac1c4 100644 --- a/vendor/github.com/knative/pkg/apis/duck/v1beta1/register.go +++ b/vendor/knative.dev/pkg/apis/duck/v1beta1/register.go @@ -17,7 +17,7 @@ limitations under the License. package v1beta1 import ( - "github.com/knative/pkg/apis/duck" + "knative.dev/pkg/apis/duck" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/vendor/github.com/knative/pkg/apis/duck/v1beta1/status_types.go b/vendor/knative.dev/pkg/apis/duck/v1beta1/status_types.go similarity index 98% rename from vendor/github.com/knative/pkg/apis/duck/v1beta1/status_types.go rename to vendor/knative.dev/pkg/apis/duck/v1beta1/status_types.go index b999737a..7056b0d0 100644 --- a/vendor/github.com/knative/pkg/apis/duck/v1beta1/status_types.go +++ b/vendor/knative.dev/pkg/apis/duck/v1beta1/status_types.go @@ -24,8 +24,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "github.com/knative/pkg/apis" - "github.com/knative/pkg/apis/duck" + "knative.dev/pkg/apis" + "knative.dev/pkg/apis/duck" ) // Conditions is a simple wrapper around apis.Conditions to implement duck.Implementable. diff --git a/vendor/github.com/knative/pkg/apis/duck/v1beta1/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/apis/duck/v1beta1/zz_generated.deepcopy.go similarity index 99% rename from vendor/github.com/knative/pkg/apis/duck/v1beta1/zz_generated.deepcopy.go rename to vendor/knative.dev/pkg/apis/duck/v1beta1/zz_generated.deepcopy.go index 791c06d9..329aabb6 100644 --- a/vendor/github.com/knative/pkg/apis/duck/v1beta1/zz_generated.deepcopy.go +++ b/vendor/knative.dev/pkg/apis/duck/v1beta1/zz_generated.deepcopy.go @@ -21,8 +21,8 @@ limitations under the License. package v1beta1 import ( - apis "github.com/knative/pkg/apis" runtime "k8s.io/apimachinery/pkg/runtime" + apis "knative.dev/pkg/apis" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/github.com/knative/pkg/apis/duck/verify.go b/vendor/knative.dev/pkg/apis/duck/verify.go similarity index 99% rename from vendor/github.com/knative/pkg/apis/duck/verify.go rename to vendor/knative.dev/pkg/apis/duck/verify.go index eb6bdebf..236a392c 100644 --- a/vendor/github.com/knative/pkg/apis/duck/verify.go +++ b/vendor/knative.dev/pkg/apis/duck/verify.go @@ -20,7 +20,7 @@ import ( "encoding/json" "fmt" - "github.com/knative/pkg/kmp" + "knative.dev/pkg/kmp" ) // Implementable is implemented by the Fooable duck type that consumers diff --git a/vendor/github.com/knative/pkg/apis/field_error.go b/vendor/knative.dev/pkg/apis/field_error.go similarity index 99% rename from vendor/github.com/knative/pkg/apis/field_error.go rename to vendor/knative.dev/pkg/apis/field_error.go index 8b56be97..59b281d6 100644 --- a/vendor/github.com/knative/pkg/apis/field_error.go +++ b/vendor/knative.dev/pkg/apis/field_error.go @@ -21,7 +21,7 @@ import ( "sort" "strings" - "github.com/knative/pkg/kmp" + "knative.dev/pkg/kmp" ) // CurrentField is a constant to supply as a fieldPath for when there is diff --git a/vendor/github.com/knative/pkg/apis/interfaces.go b/vendor/knative.dev/pkg/apis/interfaces.go similarity index 90% rename from vendor/github.com/knative/pkg/apis/interfaces.go rename to vendor/knative.dev/pkg/apis/interfaces.go index 601d083d..6b6c772d 100644 --- a/vendor/github.com/knative/pkg/apis/interfaces.go +++ b/vendor/knative.dev/pkg/apis/interfaces.go @@ -66,3 +66,10 @@ type Listable interface { // The webhook functionality for this has been turned down, which is why this // interface is empty. type Annotatable interface{} + +// HasSpec indicates that a particular type has a specification information +// and that information is retrievable. +type HasSpec interface { + // GetUntypedSpec returns the spec of the resource. + GetUntypedSpec() interface{} +} diff --git a/vendor/github.com/knative/pkg/apis/istio/authentication/register.go b/vendor/knative.dev/pkg/apis/istio/authentication/register.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/istio/authentication/register.go rename to vendor/knative.dev/pkg/apis/istio/authentication/register.go diff --git a/vendor/github.com/knative/pkg/apis/istio/authentication/v1alpha1/doc.go b/vendor/knative.dev/pkg/apis/istio/authentication/v1alpha1/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/istio/authentication/v1alpha1/doc.go rename to vendor/knative.dev/pkg/apis/istio/authentication/v1alpha1/doc.go diff --git a/vendor/github.com/knative/pkg/apis/istio/authentication/v1alpha1/policy_types.go b/vendor/knative.dev/pkg/apis/istio/authentication/v1alpha1/policy_types.go similarity index 99% rename from vendor/github.com/knative/pkg/apis/istio/authentication/v1alpha1/policy_types.go rename to vendor/knative.dev/pkg/apis/istio/authentication/v1alpha1/policy_types.go index 882b1fc3..11648a0c 100644 --- a/vendor/github.com/knative/pkg/apis/istio/authentication/v1alpha1/policy_types.go +++ b/vendor/knative.dev/pkg/apis/istio/authentication/v1alpha1/policy_types.go @@ -17,7 +17,7 @@ limitations under the License. package v1alpha1 import ( - "github.com/knative/pkg/apis/istio/common/v1alpha1" + "knative.dev/pkg/apis/istio/common/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/vendor/github.com/knative/pkg/apis/istio/authentication/v1alpha1/register.go b/vendor/knative.dev/pkg/apis/istio/authentication/v1alpha1/register.go similarity index 96% rename from vendor/github.com/knative/pkg/apis/istio/authentication/v1alpha1/register.go rename to vendor/knative.dev/pkg/apis/istio/authentication/v1alpha1/register.go index 7809d1cd..b96de764 100644 --- a/vendor/github.com/knative/pkg/apis/istio/authentication/v1alpha1/register.go +++ b/vendor/knative.dev/pkg/apis/istio/authentication/v1alpha1/register.go @@ -17,7 +17,7 @@ limitations under the License. package v1alpha1 import ( - "github.com/knative/pkg/apis/istio/authentication" + "knative.dev/pkg/apis/istio/authentication" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/vendor/github.com/knative/pkg/apis/istio/authentication/v1alpha1/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/apis/istio/authentication/v1alpha1/zz_generated.deepcopy.go similarity index 99% rename from vendor/github.com/knative/pkg/apis/istio/authentication/v1alpha1/zz_generated.deepcopy.go rename to vendor/knative.dev/pkg/apis/istio/authentication/v1alpha1/zz_generated.deepcopy.go index 20f900c9..19f95f30 100644 --- a/vendor/github.com/knative/pkg/apis/istio/authentication/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/knative.dev/pkg/apis/istio/authentication/v1alpha1/zz_generated.deepcopy.go @@ -21,8 +21,8 @@ limitations under the License. package v1alpha1 import ( - commonv1alpha1 "github.com/knative/pkg/apis/istio/common/v1alpha1" runtime "k8s.io/apimachinery/pkg/runtime" + commonv1alpha1 "knative.dev/pkg/apis/istio/common/v1alpha1" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/github.com/knative/pkg/apis/istio/common/v1alpha1/string.go b/vendor/knative.dev/pkg/apis/istio/common/v1alpha1/string.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/istio/common/v1alpha1/string.go rename to vendor/knative.dev/pkg/apis/istio/common/v1alpha1/string.go diff --git a/vendor/github.com/knative/pkg/apis/istio/register.go b/vendor/knative.dev/pkg/apis/istio/register.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/istio/register.go rename to vendor/knative.dev/pkg/apis/istio/register.go diff --git a/vendor/github.com/knative/pkg/apis/istio/v1alpha3/README.md b/vendor/knative.dev/pkg/apis/istio/v1alpha3/README.md similarity index 100% rename from vendor/github.com/knative/pkg/apis/istio/v1alpha3/README.md rename to vendor/knative.dev/pkg/apis/istio/v1alpha3/README.md diff --git a/vendor/github.com/knative/pkg/apis/istio/v1alpha3/destinationrule_types.go b/vendor/knative.dev/pkg/apis/istio/v1alpha3/destinationrule_types.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/istio/v1alpha3/destinationrule_types.go rename to vendor/knative.dev/pkg/apis/istio/v1alpha3/destinationrule_types.go diff --git a/vendor/github.com/knative/pkg/apis/istio/v1alpha3/doc.go b/vendor/knative.dev/pkg/apis/istio/v1alpha3/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/istio/v1alpha3/doc.go rename to vendor/knative.dev/pkg/apis/istio/v1alpha3/doc.go diff --git a/vendor/github.com/knative/pkg/apis/istio/v1alpha3/gateway_types.go b/vendor/knative.dev/pkg/apis/istio/v1alpha3/gateway_types.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/istio/v1alpha3/gateway_types.go rename to vendor/knative.dev/pkg/apis/istio/v1alpha3/gateway_types.go diff --git a/vendor/github.com/knative/pkg/apis/istio/v1alpha3/register.go b/vendor/knative.dev/pkg/apis/istio/v1alpha3/register.go similarity index 97% rename from vendor/github.com/knative/pkg/apis/istio/v1alpha3/register.go rename to vendor/knative.dev/pkg/apis/istio/v1alpha3/register.go index c2089e5c..5507b1f9 100644 --- a/vendor/github.com/knative/pkg/apis/istio/v1alpha3/register.go +++ b/vendor/knative.dev/pkg/apis/istio/v1alpha3/register.go @@ -17,7 +17,7 @@ limitations under the License. package v1alpha3 import ( - "github.com/knative/pkg/apis/istio" + "knative.dev/pkg/apis/istio" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/vendor/github.com/knative/pkg/apis/istio/v1alpha3/virtualservice_types.go b/vendor/knative.dev/pkg/apis/istio/v1alpha3/virtualservice_types.go similarity index 99% rename from vendor/github.com/knative/pkg/apis/istio/v1alpha3/virtualservice_types.go rename to vendor/knative.dev/pkg/apis/istio/v1alpha3/virtualservice_types.go index 8798cfa3..bd12f361 100644 --- a/vendor/github.com/knative/pkg/apis/istio/v1alpha3/virtualservice_types.go +++ b/vendor/knative.dev/pkg/apis/istio/v1alpha3/virtualservice_types.go @@ -17,7 +17,7 @@ limitations under the License. package v1alpha3 import ( - "github.com/knative/pkg/apis/istio/common/v1alpha1" + "knative.dev/pkg/apis/istio/common/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/vendor/github.com/knative/pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go similarity index 99% rename from vendor/github.com/knative/pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go rename to vendor/knative.dev/pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go index 67cf7212..b503c307 100644 --- a/vendor/github.com/knative/pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go +++ b/vendor/knative.dev/pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go @@ -21,8 +21,8 @@ limitations under the License. package v1alpha3 import ( - v1alpha1 "github.com/knative/pkg/apis/istio/common/v1alpha1" runtime "k8s.io/apimachinery/pkg/runtime" + v1alpha1 "knative.dev/pkg/apis/istio/common/v1alpha1" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/github.com/knative/pkg/apis/kind2resource.go b/vendor/knative.dev/pkg/apis/kind2resource.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/kind2resource.go rename to vendor/knative.dev/pkg/apis/kind2resource.go diff --git a/vendor/github.com/knative/pkg/apis/metadata_validation.go b/vendor/knative.dev/pkg/apis/metadata_validation.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/metadata_validation.go rename to vendor/knative.dev/pkg/apis/metadata_validation.go diff --git a/vendor/github.com/knative/pkg/apis/testing/conditions.go b/vendor/knative.dev/pkg/apis/testing/conditions.go similarity index 95% rename from vendor/github.com/knative/pkg/apis/testing/conditions.go rename to vendor/knative.dev/pkg/apis/testing/conditions.go index 5aee8880..19f102da 100644 --- a/vendor/github.com/knative/pkg/apis/testing/conditions.go +++ b/vendor/knative.dev/pkg/apis/testing/conditions.go @@ -19,8 +19,8 @@ import ( "fmt" "testing" - "github.com/knative/pkg/apis" - duckv1b1 "github.com/knative/pkg/apis/duck/v1beta1" + "knative.dev/pkg/apis" + duckv1b1 "knative.dev/pkg/apis/duck/v1beta1" corev1 "k8s.io/api/core/v1" ) diff --git a/vendor/github.com/knative/pkg/apis/url.go b/vendor/knative.dev/pkg/apis/url.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/url.go rename to vendor/knative.dev/pkg/apis/url.go diff --git a/vendor/github.com/knative/pkg/apis/volatile_time.go b/vendor/knative.dev/pkg/apis/volatile_time.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/volatile_time.go rename to vendor/knative.dev/pkg/apis/volatile_time.go diff --git a/vendor/github.com/knative/pkg/apis/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/apis/zz_generated.deepcopy.go similarity index 100% rename from vendor/github.com/knative/pkg/apis/zz_generated.deepcopy.go rename to vendor/knative.dev/pkg/apis/zz_generated.deepcopy.go diff --git a/vendor/github.com/knative/pkg/changeset/commit.go b/vendor/knative.dev/pkg/changeset/commit.go similarity index 100% rename from vendor/github.com/knative/pkg/changeset/commit.go rename to vendor/knative.dev/pkg/changeset/commit.go diff --git a/vendor/github.com/knative/pkg/changeset/doc.go b/vendor/knative.dev/pkg/changeset/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/changeset/doc.go rename to vendor/knative.dev/pkg/changeset/doc.go diff --git a/vendor/github.com/knative/pkg/changeset/testdata/HEAD b/vendor/knative.dev/pkg/changeset/testdata/HEAD similarity index 100% rename from vendor/github.com/knative/pkg/changeset/testdata/HEAD rename to vendor/knative.dev/pkg/changeset/testdata/HEAD diff --git a/vendor/github.com/knative/pkg/changeset/testdata/noncommitted/HEAD b/vendor/knative.dev/pkg/changeset/testdata/noncommitted/HEAD similarity index 100% rename from vendor/github.com/knative/pkg/changeset/testdata/noncommitted/HEAD rename to vendor/knative.dev/pkg/changeset/testdata/noncommitted/HEAD diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/clientset.go b/vendor/knative.dev/pkg/client/clientset/versioned/clientset.go similarity index 95% rename from vendor/github.com/knative/pkg/client/clientset/versioned/clientset.go rename to vendor/knative.dev/pkg/client/clientset/versioned/clientset.go index 5c00fdb6..86121166 100644 --- a/vendor/github.com/knative/pkg/client/clientset/versioned/clientset.go +++ b/vendor/knative.dev/pkg/client/clientset/versioned/clientset.go @@ -19,11 +19,11 @@ limitations under the License. package versioned import ( - authenticationv1alpha1 "github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1" - networkingv1alpha3 "github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" + authenticationv1alpha1 "knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1" + networkingv1alpha3 "knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3" ) type Interface interface { diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/doc.go b/vendor/knative.dev/pkg/client/clientset/versioned/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/client/clientset/versioned/doc.go rename to vendor/knative.dev/pkg/client/clientset/versioned/doc.go diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/fake/clientset_generated.go b/vendor/knative.dev/pkg/client/clientset/versioned/fake/clientset_generated.go similarity index 86% rename from vendor/github.com/knative/pkg/client/clientset/versioned/fake/clientset_generated.go rename to vendor/knative.dev/pkg/client/clientset/versioned/fake/clientset_generated.go index df8348fc..e2657088 100644 --- a/vendor/github.com/knative/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/vendor/knative.dev/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -19,16 +19,16 @@ limitations under the License. package fake import ( - clientset "github.com/knative/pkg/client/clientset/versioned" - authenticationv1alpha1 "github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1" - fakeauthenticationv1alpha1 "github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake" - networkingv1alpha3 "github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3" - fakenetworkingv1alpha3 "github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" fakediscovery "k8s.io/client-go/discovery/fake" "k8s.io/client-go/testing" + clientset "knative.dev/pkg/client/clientset/versioned" + authenticationv1alpha1 "knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1" + fakeauthenticationv1alpha1 "knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake" + networkingv1alpha3 "knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3" + fakenetworkingv1alpha3 "knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake" ) // NewSimpleClientset returns a clientset that will respond with the provided objects. diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/fake/doc.go b/vendor/knative.dev/pkg/client/clientset/versioned/fake/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/client/clientset/versioned/fake/doc.go rename to vendor/knative.dev/pkg/client/clientset/versioned/fake/doc.go diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/fake/register.go b/vendor/knative.dev/pkg/client/clientset/versioned/fake/register.go similarity index 92% rename from vendor/github.com/knative/pkg/client/clientset/versioned/fake/register.go rename to vendor/knative.dev/pkg/client/clientset/versioned/fake/register.go index f00f2c9f..ee498aad 100644 --- a/vendor/github.com/knative/pkg/client/clientset/versioned/fake/register.go +++ b/vendor/knative.dev/pkg/client/clientset/versioned/fake/register.go @@ -19,13 +19,13 @@ limitations under the License. package fake import ( - authenticationv1alpha1 "github.com/knative/pkg/apis/istio/authentication/v1alpha1" - networkingv1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" + authenticationv1alpha1 "knative.dev/pkg/apis/istio/authentication/v1alpha1" + networkingv1alpha3 "knative.dev/pkg/apis/istio/v1alpha3" ) var scheme = runtime.NewScheme() diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/scheme/doc.go b/vendor/knative.dev/pkg/client/clientset/versioned/scheme/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/client/clientset/versioned/scheme/doc.go rename to vendor/knative.dev/pkg/client/clientset/versioned/scheme/doc.go diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/scheme/register.go b/vendor/knative.dev/pkg/client/clientset/versioned/scheme/register.go similarity index 92% rename from vendor/github.com/knative/pkg/client/clientset/versioned/scheme/register.go rename to vendor/knative.dev/pkg/client/clientset/versioned/scheme/register.go index cca6f278..192e1e3d 100644 --- a/vendor/github.com/knative/pkg/client/clientset/versioned/scheme/register.go +++ b/vendor/knative.dev/pkg/client/clientset/versioned/scheme/register.go @@ -19,13 +19,13 @@ limitations under the License. package scheme import ( - authenticationv1alpha1 "github.com/knative/pkg/apis/istio/authentication/v1alpha1" - networkingv1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" + authenticationv1alpha1 "knative.dev/pkg/apis/istio/authentication/v1alpha1" + networkingv1alpha3 "knative.dev/pkg/apis/istio/v1alpha3" ) var Scheme = runtime.NewScheme() diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go b/vendor/knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go similarity index 95% rename from vendor/github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go rename to vendor/knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go index 918f9cd7..caedb2ea 100644 --- a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go +++ b/vendor/knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go @@ -19,10 +19,10 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "github.com/knative/pkg/apis/istio/authentication/v1alpha1" - "github.com/knative/pkg/client/clientset/versioned/scheme" serializer "k8s.io/apimachinery/pkg/runtime/serializer" rest "k8s.io/client-go/rest" + v1alpha1 "knative.dev/pkg/apis/istio/authentication/v1alpha1" + "knative.dev/pkg/client/clientset/versioned/scheme" ) type AuthenticationV1alpha1Interface interface { diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1/doc.go b/vendor/knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1/doc.go rename to vendor/knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1/doc.go diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/doc.go b/vendor/knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/doc.go rename to vendor/knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/doc.go diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go b/vendor/knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go similarity index 92% rename from vendor/github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go rename to vendor/knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go index f947ca53..4cfd5204 100644 --- a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go +++ b/vendor/knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go @@ -19,9 +19,9 @@ limitations under the License. package fake import ( - v1alpha1 "github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" + v1alpha1 "knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1" ) type FakeAuthenticationV1alpha1 struct { diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/fake_policy.go b/vendor/knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/fake_policy.go similarity index 98% rename from vendor/github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/fake_policy.go rename to vendor/knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/fake_policy.go index f5d54444..ab10fcd4 100644 --- a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/fake_policy.go +++ b/vendor/knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/fake_policy.go @@ -19,13 +19,13 @@ limitations under the License. package fake import ( - v1alpha1 "github.com/knative/pkg/apis/istio/authentication/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" + v1alpha1 "knative.dev/pkg/apis/istio/authentication/v1alpha1" ) // FakePolicies implements PolicyInterface diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1/generated_expansion.go b/vendor/knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1/generated_expansion.go similarity index 100% rename from vendor/github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1/generated_expansion.go rename to vendor/knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1/generated_expansion.go diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1/policy.go b/vendor/knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1/policy.go similarity index 97% rename from vendor/github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1/policy.go rename to vendor/knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1/policy.go index 961aaf00..2d6dd5ec 100644 --- a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/authentication/v1alpha1/policy.go +++ b/vendor/knative.dev/pkg/client/clientset/versioned/typed/authentication/v1alpha1/policy.go @@ -19,12 +19,12 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "github.com/knative/pkg/apis/istio/authentication/v1alpha1" - scheme "github.com/knative/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" + v1alpha1 "knative.dev/pkg/apis/istio/authentication/v1alpha1" + scheme "knative.dev/pkg/client/clientset/versioned/scheme" ) // PoliciesGetter has a method to return a PolicyInterface. diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/destinationrule.go b/vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/destinationrule.go similarity index 97% rename from vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/destinationrule.go rename to vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/destinationrule.go index 242f213f..d4b6e435 100644 --- a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/destinationrule.go +++ b/vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/destinationrule.go @@ -19,12 +19,12 @@ limitations under the License. package v1alpha3 import ( - v1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" - scheme "github.com/knative/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" + v1alpha3 "knative.dev/pkg/apis/istio/v1alpha3" + scheme "knative.dev/pkg/client/clientset/versioned/scheme" ) // DestinationRulesGetter has a method to return a DestinationRuleInterface. diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/doc.go b/vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/doc.go rename to vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/doc.go diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/doc.go b/vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/doc.go rename to vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/doc.go diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_destinationrule.go b/vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_destinationrule.go similarity index 98% rename from vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_destinationrule.go rename to vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_destinationrule.go index e493908e..471c9a42 100644 --- a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_destinationrule.go +++ b/vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_destinationrule.go @@ -19,13 +19,13 @@ limitations under the License. package fake import ( - v1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" + v1alpha3 "knative.dev/pkg/apis/istio/v1alpha3" ) // FakeDestinationRules implements DestinationRuleInterface diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_gateway.go b/vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_gateway.go similarity index 98% rename from vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_gateway.go rename to vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_gateway.go index 24941494..1b202fa5 100644 --- a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_gateway.go +++ b/vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_gateway.go @@ -19,13 +19,13 @@ limitations under the License. package fake import ( - v1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" + v1alpha3 "knative.dev/pkg/apis/istio/v1alpha3" ) // FakeGateways implements GatewayInterface diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_istio_client.go b/vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_istio_client.go similarity index 94% rename from vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_istio_client.go rename to vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_istio_client.go index fddb1d47..4f3cbd6e 100644 --- a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_istio_client.go +++ b/vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_istio_client.go @@ -19,9 +19,9 @@ limitations under the License. package fake import ( - v1alpha3 "github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" + v1alpha3 "knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3" ) type FakeNetworkingV1alpha3 struct { diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_virtualservice.go b/vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_virtualservice.go similarity index 98% rename from vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_virtualservice.go rename to vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_virtualservice.go index 98b25259..a4a3000b 100644 --- a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_virtualservice.go +++ b/vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/fake/fake_virtualservice.go @@ -19,13 +19,13 @@ limitations under the License. package fake import ( - v1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" + v1alpha3 "knative.dev/pkg/apis/istio/v1alpha3" ) // FakeVirtualServices implements VirtualServiceInterface diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/gateway.go b/vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/gateway.go similarity index 97% rename from vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/gateway.go rename to vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/gateway.go index 151bfef4..6e81a459 100644 --- a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/gateway.go +++ b/vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/gateway.go @@ -19,12 +19,12 @@ limitations under the License. package v1alpha3 import ( - v1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" - scheme "github.com/knative/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" + v1alpha3 "knative.dev/pkg/apis/istio/v1alpha3" + scheme "knative.dev/pkg/client/clientset/versioned/scheme" ) // GatewaysGetter has a method to return a GatewayInterface. diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/generated_expansion.go b/vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/generated_expansion.go similarity index 100% rename from vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/generated_expansion.go rename to vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/generated_expansion.go diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/istio_client.go b/vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/istio_client.go similarity index 96% rename from vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/istio_client.go rename to vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/istio_client.go index 33bda021..fe641979 100644 --- a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/istio_client.go +++ b/vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/istio_client.go @@ -19,10 +19,10 @@ limitations under the License. package v1alpha3 import ( - v1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" - "github.com/knative/pkg/client/clientset/versioned/scheme" serializer "k8s.io/apimachinery/pkg/runtime/serializer" rest "k8s.io/client-go/rest" + v1alpha3 "knative.dev/pkg/apis/istio/v1alpha3" + "knative.dev/pkg/client/clientset/versioned/scheme" ) type NetworkingV1alpha3Interface interface { diff --git a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/virtualservice.go b/vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/virtualservice.go similarity index 97% rename from vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/virtualservice.go rename to vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/virtualservice.go index 11bbb624..ba461807 100644 --- a/vendor/github.com/knative/pkg/client/clientset/versioned/typed/istio/v1alpha3/virtualservice.go +++ b/vendor/knative.dev/pkg/client/clientset/versioned/typed/istio/v1alpha3/virtualservice.go @@ -19,12 +19,12 @@ limitations under the License. package v1alpha3 import ( - v1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" - scheme "github.com/knative/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" + v1alpha3 "knative.dev/pkg/apis/istio/v1alpha3" + scheme "knative.dev/pkg/client/clientset/versioned/scheme" ) // VirtualServicesGetter has a method to return a VirtualServiceInterface. diff --git a/vendor/github.com/knative/pkg/client/informers/externalversions/authentication/interface.go b/vendor/knative.dev/pkg/client/informers/externalversions/authentication/interface.go similarity index 88% rename from vendor/github.com/knative/pkg/client/informers/externalversions/authentication/interface.go rename to vendor/knative.dev/pkg/client/informers/externalversions/authentication/interface.go index 2c0a8ce8..ae708422 100644 --- a/vendor/github.com/knative/pkg/client/informers/externalversions/authentication/interface.go +++ b/vendor/knative.dev/pkg/client/informers/externalversions/authentication/interface.go @@ -19,8 +19,8 @@ limitations under the License. package authentication import ( - v1alpha1 "github.com/knative/pkg/client/informers/externalversions/authentication/v1alpha1" - internalinterfaces "github.com/knative/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "knative.dev/pkg/client/informers/externalversions/authentication/v1alpha1" + internalinterfaces "knative.dev/pkg/client/informers/externalversions/internalinterfaces" ) // Interface provides access to each of this group's versions. diff --git a/vendor/github.com/knative/pkg/client/informers/externalversions/authentication/v1alpha1/interface.go b/vendor/knative.dev/pkg/client/informers/externalversions/authentication/v1alpha1/interface.go similarity index 93% rename from vendor/github.com/knative/pkg/client/informers/externalversions/authentication/v1alpha1/interface.go rename to vendor/knative.dev/pkg/client/informers/externalversions/authentication/v1alpha1/interface.go index a46940a9..fe0057fd 100644 --- a/vendor/github.com/knative/pkg/client/informers/externalversions/authentication/v1alpha1/interface.go +++ b/vendor/knative.dev/pkg/client/informers/externalversions/authentication/v1alpha1/interface.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha1 import ( - internalinterfaces "github.com/knative/pkg/client/informers/externalversions/internalinterfaces" + internalinterfaces "knative.dev/pkg/client/informers/externalversions/internalinterfaces" ) // Interface provides access to all the informers in this group version. diff --git a/vendor/github.com/knative/pkg/client/informers/externalversions/authentication/v1alpha1/policy.go b/vendor/knative.dev/pkg/client/informers/externalversions/authentication/v1alpha1/policy.go similarity index 91% rename from vendor/github.com/knative/pkg/client/informers/externalversions/authentication/v1alpha1/policy.go rename to vendor/knative.dev/pkg/client/informers/externalversions/authentication/v1alpha1/policy.go index 912860c9..e59af59c 100644 --- a/vendor/github.com/knative/pkg/client/informers/externalversions/authentication/v1alpha1/policy.go +++ b/vendor/knative.dev/pkg/client/informers/externalversions/authentication/v1alpha1/policy.go @@ -21,14 +21,14 @@ package v1alpha1 import ( time "time" - authenticationv1alpha1 "github.com/knative/pkg/apis/istio/authentication/v1alpha1" - versioned "github.com/knative/pkg/client/clientset/versioned" - internalinterfaces "github.com/knative/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/knative/pkg/client/listers/authentication/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" + authenticationv1alpha1 "knative.dev/pkg/apis/istio/authentication/v1alpha1" + versioned "knative.dev/pkg/client/clientset/versioned" + internalinterfaces "knative.dev/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "knative.dev/pkg/client/listers/authentication/v1alpha1" ) // PolicyInformer provides access to a shared informer and lister for diff --git a/vendor/github.com/knative/pkg/client/informers/externalversions/factory.go b/vendor/knative.dev/pkg/client/informers/externalversions/factory.go similarity index 95% rename from vendor/github.com/knative/pkg/client/informers/externalversions/factory.go rename to vendor/knative.dev/pkg/client/informers/externalversions/factory.go index a8e88a5b..0044e9ae 100644 --- a/vendor/github.com/knative/pkg/client/informers/externalversions/factory.go +++ b/vendor/knative.dev/pkg/client/informers/externalversions/factory.go @@ -23,14 +23,14 @@ import ( sync "sync" time "time" - versioned "github.com/knative/pkg/client/clientset/versioned" - authentication "github.com/knative/pkg/client/informers/externalversions/authentication" - internalinterfaces "github.com/knative/pkg/client/informers/externalversions/internalinterfaces" - istio "github.com/knative/pkg/client/informers/externalversions/istio" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" + versioned "knative.dev/pkg/client/clientset/versioned" + authentication "knative.dev/pkg/client/informers/externalversions/authentication" + internalinterfaces "knative.dev/pkg/client/informers/externalversions/internalinterfaces" + istio "knative.dev/pkg/client/informers/externalversions/istio" ) // SharedInformerOption defines the functional option type for SharedInformerFactory. diff --git a/vendor/github.com/knative/pkg/client/informers/externalversions/generic.go b/vendor/knative.dev/pkg/client/informers/externalversions/generic.go similarity index 95% rename from vendor/github.com/knative/pkg/client/informers/externalversions/generic.go rename to vendor/knative.dev/pkg/client/informers/externalversions/generic.go index 2a152461..18a4d1b2 100644 --- a/vendor/github.com/knative/pkg/client/informers/externalversions/generic.go +++ b/vendor/knative.dev/pkg/client/informers/externalversions/generic.go @@ -21,10 +21,10 @@ package externalversions import ( "fmt" - v1alpha1 "github.com/knative/pkg/apis/istio/authentication/v1alpha1" - v1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" + v1alpha1 "knative.dev/pkg/apis/istio/authentication/v1alpha1" + v1alpha3 "knative.dev/pkg/apis/istio/v1alpha3" ) // GenericInformer is type of SharedIndexInformer which will locate and delegate to other diff --git a/vendor/github.com/knative/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/vendor/knative.dev/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go similarity index 94% rename from vendor/github.com/knative/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go rename to vendor/knative.dev/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go index 3cd3cb32..356bd645 100644 --- a/vendor/github.com/knative/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/vendor/knative.dev/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -21,10 +21,10 @@ package internalinterfaces import ( time "time" - versioned "github.com/knative/pkg/client/clientset/versioned" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" cache "k8s.io/client-go/tools/cache" + versioned "knative.dev/pkg/client/clientset/versioned" ) type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer diff --git a/vendor/github.com/knative/pkg/client/informers/externalversions/istio/interface.go b/vendor/knative.dev/pkg/client/informers/externalversions/istio/interface.go similarity index 88% rename from vendor/github.com/knative/pkg/client/informers/externalversions/istio/interface.go rename to vendor/knative.dev/pkg/client/informers/externalversions/istio/interface.go index d7db9d27..79a62b88 100644 --- a/vendor/github.com/knative/pkg/client/informers/externalversions/istio/interface.go +++ b/vendor/knative.dev/pkg/client/informers/externalversions/istio/interface.go @@ -19,8 +19,8 @@ limitations under the License. package networking import ( - internalinterfaces "github.com/knative/pkg/client/informers/externalversions/internalinterfaces" - v1alpha3 "github.com/knative/pkg/client/informers/externalversions/istio/v1alpha3" + internalinterfaces "knative.dev/pkg/client/informers/externalversions/internalinterfaces" + v1alpha3 "knative.dev/pkg/client/informers/externalversions/istio/v1alpha3" ) // Interface provides access to each of this group's versions. diff --git a/vendor/github.com/knative/pkg/client/informers/externalversions/istio/v1alpha3/destinationrule.go b/vendor/knative.dev/pkg/client/informers/externalversions/istio/v1alpha3/destinationrule.go similarity index 92% rename from vendor/github.com/knative/pkg/client/informers/externalversions/istio/v1alpha3/destinationrule.go rename to vendor/knative.dev/pkg/client/informers/externalversions/istio/v1alpha3/destinationrule.go index d4a035b6..184fd358 100644 --- a/vendor/github.com/knative/pkg/client/informers/externalversions/istio/v1alpha3/destinationrule.go +++ b/vendor/knative.dev/pkg/client/informers/externalversions/istio/v1alpha3/destinationrule.go @@ -21,14 +21,14 @@ package v1alpha3 import ( time "time" - istiov1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" - versioned "github.com/knative/pkg/client/clientset/versioned" - internalinterfaces "github.com/knative/pkg/client/informers/externalversions/internalinterfaces" - v1alpha3 "github.com/knative/pkg/client/listers/istio/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" + istiov1alpha3 "knative.dev/pkg/apis/istio/v1alpha3" + versioned "knative.dev/pkg/client/clientset/versioned" + internalinterfaces "knative.dev/pkg/client/informers/externalversions/internalinterfaces" + v1alpha3 "knative.dev/pkg/client/listers/istio/v1alpha3" ) // DestinationRuleInformer provides access to a shared informer and lister for diff --git a/vendor/github.com/knative/pkg/client/informers/externalversions/istio/v1alpha3/gateway.go b/vendor/knative.dev/pkg/client/informers/externalversions/istio/v1alpha3/gateway.go similarity index 91% rename from vendor/github.com/knative/pkg/client/informers/externalversions/istio/v1alpha3/gateway.go rename to vendor/knative.dev/pkg/client/informers/externalversions/istio/v1alpha3/gateway.go index 844704d9..59d99e12 100644 --- a/vendor/github.com/knative/pkg/client/informers/externalversions/istio/v1alpha3/gateway.go +++ b/vendor/knative.dev/pkg/client/informers/externalversions/istio/v1alpha3/gateway.go @@ -21,14 +21,14 @@ package v1alpha3 import ( time "time" - istiov1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" - versioned "github.com/knative/pkg/client/clientset/versioned" - internalinterfaces "github.com/knative/pkg/client/informers/externalversions/internalinterfaces" - v1alpha3 "github.com/knative/pkg/client/listers/istio/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" + istiov1alpha3 "knative.dev/pkg/apis/istio/v1alpha3" + versioned "knative.dev/pkg/client/clientset/versioned" + internalinterfaces "knative.dev/pkg/client/informers/externalversions/internalinterfaces" + v1alpha3 "knative.dev/pkg/client/listers/istio/v1alpha3" ) // GatewayInformer provides access to a shared informer and lister for diff --git a/vendor/github.com/knative/pkg/client/informers/externalversions/istio/v1alpha3/interface.go b/vendor/knative.dev/pkg/client/informers/externalversions/istio/v1alpha3/interface.go similarity index 95% rename from vendor/github.com/knative/pkg/client/informers/externalversions/istio/v1alpha3/interface.go rename to vendor/knative.dev/pkg/client/informers/externalversions/istio/v1alpha3/interface.go index bd4808d7..a37a1c0f 100644 --- a/vendor/github.com/knative/pkg/client/informers/externalversions/istio/v1alpha3/interface.go +++ b/vendor/knative.dev/pkg/client/informers/externalversions/istio/v1alpha3/interface.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha3 import ( - internalinterfaces "github.com/knative/pkg/client/informers/externalversions/internalinterfaces" + internalinterfaces "knative.dev/pkg/client/informers/externalversions/internalinterfaces" ) // Interface provides access to all the informers in this group version. diff --git a/vendor/github.com/knative/pkg/client/informers/externalversions/istio/v1alpha3/virtualservice.go b/vendor/knative.dev/pkg/client/informers/externalversions/istio/v1alpha3/virtualservice.go similarity index 92% rename from vendor/github.com/knative/pkg/client/informers/externalversions/istio/v1alpha3/virtualservice.go rename to vendor/knative.dev/pkg/client/informers/externalversions/istio/v1alpha3/virtualservice.go index cecb442e..f0468e22 100644 --- a/vendor/github.com/knative/pkg/client/informers/externalversions/istio/v1alpha3/virtualservice.go +++ b/vendor/knative.dev/pkg/client/informers/externalversions/istio/v1alpha3/virtualservice.go @@ -21,14 +21,14 @@ package v1alpha3 import ( time "time" - istiov1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" - versioned "github.com/knative/pkg/client/clientset/versioned" - internalinterfaces "github.com/knative/pkg/client/informers/externalversions/internalinterfaces" - v1alpha3 "github.com/knative/pkg/client/listers/istio/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" + istiov1alpha3 "knative.dev/pkg/apis/istio/v1alpha3" + versioned "knative.dev/pkg/client/clientset/versioned" + internalinterfaces "knative.dev/pkg/client/informers/externalversions/internalinterfaces" + v1alpha3 "knative.dev/pkg/client/listers/istio/v1alpha3" ) // VirtualServiceInformer provides access to a shared informer and lister for diff --git a/vendor/github.com/knative/pkg/client/injection/client/client.go b/vendor/knative.dev/pkg/client/injection/client/client.go similarity index 89% rename from vendor/github.com/knative/pkg/client/injection/client/client.go rename to vendor/knative.dev/pkg/client/injection/client/client.go index 0eb12472..b4784b21 100644 --- a/vendor/github.com/knative/pkg/client/injection/client/client.go +++ b/vendor/knative.dev/pkg/client/injection/client/client.go @@ -21,10 +21,10 @@ package client import ( "context" - versioned "github.com/knative/pkg/client/clientset/versioned" - injection "github.com/knative/pkg/injection" - logging "github.com/knative/pkg/logging" rest "k8s.io/client-go/rest" + versioned "knative.dev/pkg/client/clientset/versioned" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" ) func init() { diff --git a/vendor/github.com/knative/pkg/client/injection/client/fake/fake.go b/vendor/knative.dev/pkg/client/injection/client/fake/fake.go similarity index 86% rename from vendor/github.com/knative/pkg/client/injection/client/fake/fake.go rename to vendor/knative.dev/pkg/client/injection/client/fake/fake.go index ae368890..d661247b 100644 --- a/vendor/github.com/knative/pkg/client/injection/client/fake/fake.go +++ b/vendor/knative.dev/pkg/client/injection/client/fake/fake.go @@ -21,12 +21,12 @@ package fake import ( "context" - fake "github.com/knative/pkg/client/clientset/versioned/fake" - client "github.com/knative/pkg/client/injection/client" - injection "github.com/knative/pkg/injection" - logging "github.com/knative/pkg/logging" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/rest" + fake "knative.dev/pkg/client/clientset/versioned/fake" + client "knative.dev/pkg/client/injection/client" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" ) func init() { diff --git a/vendor/github.com/knative/pkg/client/injection/informers/authentication/factory/authenticationfactory.go b/vendor/knative.dev/pkg/client/injection/informers/authentication/factory/authenticationfactory.go similarity index 83% rename from vendor/github.com/knative/pkg/client/injection/informers/authentication/factory/authenticationfactory.go rename to vendor/knative.dev/pkg/client/injection/informers/authentication/factory/authenticationfactory.go index 2be38cca..a90c27dc 100644 --- a/vendor/github.com/knative/pkg/client/injection/informers/authentication/factory/authenticationfactory.go +++ b/vendor/knative.dev/pkg/client/injection/informers/authentication/factory/authenticationfactory.go @@ -21,11 +21,11 @@ package authenticationfactory import ( "context" - externalversions "github.com/knative/pkg/client/informers/externalversions" - client "github.com/knative/pkg/client/injection/client" - controller "github.com/knative/pkg/controller" - injection "github.com/knative/pkg/injection" - logging "github.com/knative/pkg/logging" + externalversions "knative.dev/pkg/client/informers/externalversions" + client "knative.dev/pkg/client/injection/client" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" ) func init() { diff --git a/vendor/github.com/knative/pkg/client/injection/informers/istio/factory/fake/fake.go b/vendor/knative.dev/pkg/client/injection/informers/authentication/factory/fake/fake.go similarity index 76% rename from vendor/github.com/knative/pkg/client/injection/informers/istio/factory/fake/fake.go rename to vendor/knative.dev/pkg/client/injection/informers/authentication/factory/fake/fake.go index 8180c2e5..a7fabb7c 100644 --- a/vendor/github.com/knative/pkg/client/injection/informers/istio/factory/fake/fake.go +++ b/vendor/knative.dev/pkg/client/injection/informers/authentication/factory/fake/fake.go @@ -21,11 +21,11 @@ package fake import ( "context" - externalversions "github.com/knative/pkg/client/informers/externalversions" - fake "github.com/knative/pkg/client/injection/client/fake" - factory "github.com/knative/pkg/client/injection/informers/istio/factory" - controller "github.com/knative/pkg/controller" - injection "github.com/knative/pkg/injection" + externalversions "knative.dev/pkg/client/informers/externalversions" + fake "knative.dev/pkg/client/injection/client/fake" + factory "knative.dev/pkg/client/injection/informers/authentication/factory" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" ) var Get = factory.Get diff --git a/vendor/github.com/knative/pkg/client/injection/informers/authentication/v1alpha1/policy/fake/fake.go b/vendor/knative.dev/pkg/client/injection/informers/authentication/v1alpha1/policy/fake/fake.go similarity index 77% rename from vendor/github.com/knative/pkg/client/injection/informers/authentication/v1alpha1/policy/fake/fake.go rename to vendor/knative.dev/pkg/client/injection/informers/authentication/v1alpha1/policy/fake/fake.go index bd8c1e97..873623a1 100644 --- a/vendor/github.com/knative/pkg/client/injection/informers/authentication/v1alpha1/policy/fake/fake.go +++ b/vendor/knative.dev/pkg/client/injection/informers/authentication/v1alpha1/policy/fake/fake.go @@ -21,10 +21,10 @@ package fake import ( "context" - fake "github.com/knative/pkg/client/injection/informers/authentication/factory/fake" - policy "github.com/knative/pkg/client/injection/informers/authentication/v1alpha1/policy" - controller "github.com/knative/pkg/controller" - injection "github.com/knative/pkg/injection" + fake "knative.dev/pkg/client/injection/informers/authentication/factory/fake" + policy "knative.dev/pkg/client/injection/informers/authentication/v1alpha1/policy" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" ) var Get = policy.Get diff --git a/vendor/github.com/knative/pkg/client/injection/informers/authentication/v1alpha1/policy/policy.go b/vendor/knative.dev/pkg/client/injection/informers/authentication/v1alpha1/policy/policy.go similarity index 81% rename from vendor/github.com/knative/pkg/client/injection/informers/authentication/v1alpha1/policy/policy.go rename to vendor/knative.dev/pkg/client/injection/informers/authentication/v1alpha1/policy/policy.go index 449afb54..67c59a6c 100644 --- a/vendor/github.com/knative/pkg/client/injection/informers/authentication/v1alpha1/policy/policy.go +++ b/vendor/knative.dev/pkg/client/injection/informers/authentication/v1alpha1/policy/policy.go @@ -21,11 +21,11 @@ package policy import ( "context" - v1alpha1 "github.com/knative/pkg/client/informers/externalversions/authentication/v1alpha1" - factory "github.com/knative/pkg/client/injection/informers/authentication/factory" - controller "github.com/knative/pkg/controller" - injection "github.com/knative/pkg/injection" - logging "github.com/knative/pkg/logging" + v1alpha1 "knative.dev/pkg/client/informers/externalversions/authentication/v1alpha1" + factory "knative.dev/pkg/client/injection/informers/authentication/factory" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" ) func init() { diff --git a/vendor/github.com/knative/pkg/client/injection/informers/authentication/factory/fake/fake.go b/vendor/knative.dev/pkg/client/injection/informers/istio/factory/fake/fake.go similarity index 75% rename from vendor/github.com/knative/pkg/client/injection/informers/authentication/factory/fake/fake.go rename to vendor/knative.dev/pkg/client/injection/informers/istio/factory/fake/fake.go index 813706b9..00051861 100644 --- a/vendor/github.com/knative/pkg/client/injection/informers/authentication/factory/fake/fake.go +++ b/vendor/knative.dev/pkg/client/injection/informers/istio/factory/fake/fake.go @@ -21,11 +21,11 @@ package fake import ( "context" - externalversions "github.com/knative/pkg/client/informers/externalversions" - fake "github.com/knative/pkg/client/injection/client/fake" - factory "github.com/knative/pkg/client/injection/informers/authentication/factory" - controller "github.com/knative/pkg/controller" - injection "github.com/knative/pkg/injection" + externalversions "knative.dev/pkg/client/informers/externalversions" + fake "knative.dev/pkg/client/injection/client/fake" + factory "knative.dev/pkg/client/injection/informers/istio/factory" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" ) var Get = factory.Get diff --git a/vendor/github.com/knative/pkg/client/injection/informers/istio/factory/istiofactory.go b/vendor/knative.dev/pkg/client/injection/informers/istio/factory/istiofactory.go similarity index 83% rename from vendor/github.com/knative/pkg/client/injection/informers/istio/factory/istiofactory.go rename to vendor/knative.dev/pkg/client/injection/informers/istio/factory/istiofactory.go index 3dde0a3b..b0ec8095 100644 --- a/vendor/github.com/knative/pkg/client/injection/informers/istio/factory/istiofactory.go +++ b/vendor/knative.dev/pkg/client/injection/informers/istio/factory/istiofactory.go @@ -21,11 +21,11 @@ package istiofactory import ( "context" - externalversions "github.com/knative/pkg/client/informers/externalversions" - client "github.com/knative/pkg/client/injection/client" - controller "github.com/knative/pkg/controller" - injection "github.com/knative/pkg/injection" - logging "github.com/knative/pkg/logging" + externalversions "knative.dev/pkg/client/informers/externalversions" + client "knative.dev/pkg/client/injection/client" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" ) func init() { diff --git a/vendor/github.com/knative/pkg/client/injection/informers/istio/v1alpha3/destinationrule/destinationrule.go b/vendor/knative.dev/pkg/client/injection/informers/istio/v1alpha3/destinationrule/destinationrule.go similarity index 82% rename from vendor/github.com/knative/pkg/client/injection/informers/istio/v1alpha3/destinationrule/destinationrule.go rename to vendor/knative.dev/pkg/client/injection/informers/istio/v1alpha3/destinationrule/destinationrule.go index eca63acd..39167203 100644 --- a/vendor/github.com/knative/pkg/client/injection/informers/istio/v1alpha3/destinationrule/destinationrule.go +++ b/vendor/knative.dev/pkg/client/injection/informers/istio/v1alpha3/destinationrule/destinationrule.go @@ -21,11 +21,11 @@ package destinationrule import ( "context" - v1alpha3 "github.com/knative/pkg/client/informers/externalversions/istio/v1alpha3" - factory "github.com/knative/pkg/client/injection/informers/istio/factory" - controller "github.com/knative/pkg/controller" - injection "github.com/knative/pkg/injection" - logging "github.com/knative/pkg/logging" + v1alpha3 "knative.dev/pkg/client/informers/externalversions/istio/v1alpha3" + factory "knative.dev/pkg/client/injection/informers/istio/factory" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" ) func init() { diff --git a/vendor/github.com/knative/pkg/client/injection/informers/istio/v1alpha3/destinationrule/fake/fake.go b/vendor/knative.dev/pkg/client/injection/informers/istio/v1alpha3/destinationrule/fake/fake.go similarity index 78% rename from vendor/github.com/knative/pkg/client/injection/informers/istio/v1alpha3/destinationrule/fake/fake.go rename to vendor/knative.dev/pkg/client/injection/informers/istio/v1alpha3/destinationrule/fake/fake.go index 2df358ca..e7110ca1 100644 --- a/vendor/github.com/knative/pkg/client/injection/informers/istio/v1alpha3/destinationrule/fake/fake.go +++ b/vendor/knative.dev/pkg/client/injection/informers/istio/v1alpha3/destinationrule/fake/fake.go @@ -21,10 +21,10 @@ package fake import ( "context" - fake "github.com/knative/pkg/client/injection/informers/istio/factory/fake" - destinationrule "github.com/knative/pkg/client/injection/informers/istio/v1alpha3/destinationrule" - controller "github.com/knative/pkg/controller" - injection "github.com/knative/pkg/injection" + fake "knative.dev/pkg/client/injection/informers/istio/factory/fake" + destinationrule "knative.dev/pkg/client/injection/informers/istio/v1alpha3/destinationrule" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" ) var Get = destinationrule.Get diff --git a/vendor/github.com/knative/pkg/client/injection/informers/istio/v1alpha3/gateway/fake/fake.go b/vendor/knative.dev/pkg/client/injection/informers/istio/v1alpha3/gateway/fake/fake.go similarity index 78% rename from vendor/github.com/knative/pkg/client/injection/informers/istio/v1alpha3/gateway/fake/fake.go rename to vendor/knative.dev/pkg/client/injection/informers/istio/v1alpha3/gateway/fake/fake.go index b7ba4e9b..4fe670a9 100644 --- a/vendor/github.com/knative/pkg/client/injection/informers/istio/v1alpha3/gateway/fake/fake.go +++ b/vendor/knative.dev/pkg/client/injection/informers/istio/v1alpha3/gateway/fake/fake.go @@ -21,10 +21,10 @@ package fake import ( "context" - fake "github.com/knative/pkg/client/injection/informers/istio/factory/fake" - gateway "github.com/knative/pkg/client/injection/informers/istio/v1alpha3/gateway" - controller "github.com/knative/pkg/controller" - injection "github.com/knative/pkg/injection" + fake "knative.dev/pkg/client/injection/informers/istio/factory/fake" + gateway "knative.dev/pkg/client/injection/informers/istio/v1alpha3/gateway" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" ) var Get = gateway.Get diff --git a/vendor/github.com/knative/pkg/client/injection/informers/istio/v1alpha3/gateway/gateway.go b/vendor/knative.dev/pkg/client/injection/informers/istio/v1alpha3/gateway/gateway.go similarity index 81% rename from vendor/github.com/knative/pkg/client/injection/informers/istio/v1alpha3/gateway/gateway.go rename to vendor/knative.dev/pkg/client/injection/informers/istio/v1alpha3/gateway/gateway.go index b2400e2d..3829ebd9 100644 --- a/vendor/github.com/knative/pkg/client/injection/informers/istio/v1alpha3/gateway/gateway.go +++ b/vendor/knative.dev/pkg/client/injection/informers/istio/v1alpha3/gateway/gateway.go @@ -21,11 +21,11 @@ package gateway import ( "context" - v1alpha3 "github.com/knative/pkg/client/informers/externalversions/istio/v1alpha3" - factory "github.com/knative/pkg/client/injection/informers/istio/factory" - controller "github.com/knative/pkg/controller" - injection "github.com/knative/pkg/injection" - logging "github.com/knative/pkg/logging" + v1alpha3 "knative.dev/pkg/client/informers/externalversions/istio/v1alpha3" + factory "knative.dev/pkg/client/injection/informers/istio/factory" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" ) func init() { diff --git a/vendor/github.com/knative/pkg/client/injection/informers/istio/v1alpha3/virtualservice/fake/fake.go b/vendor/knative.dev/pkg/client/injection/informers/istio/v1alpha3/virtualservice/fake/fake.go similarity index 78% rename from vendor/github.com/knative/pkg/client/injection/informers/istio/v1alpha3/virtualservice/fake/fake.go rename to vendor/knative.dev/pkg/client/injection/informers/istio/v1alpha3/virtualservice/fake/fake.go index 7ad5cb34..689a33f9 100644 --- a/vendor/github.com/knative/pkg/client/injection/informers/istio/v1alpha3/virtualservice/fake/fake.go +++ b/vendor/knative.dev/pkg/client/injection/informers/istio/v1alpha3/virtualservice/fake/fake.go @@ -21,10 +21,10 @@ package fake import ( "context" - fake "github.com/knative/pkg/client/injection/informers/istio/factory/fake" - virtualservice "github.com/knative/pkg/client/injection/informers/istio/v1alpha3/virtualservice" - controller "github.com/knative/pkg/controller" - injection "github.com/knative/pkg/injection" + fake "knative.dev/pkg/client/injection/informers/istio/factory/fake" + virtualservice "knative.dev/pkg/client/injection/informers/istio/v1alpha3/virtualservice" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" ) var Get = virtualservice.Get diff --git a/vendor/github.com/knative/pkg/client/injection/informers/istio/v1alpha3/virtualservice/virtualservice.go b/vendor/knative.dev/pkg/client/injection/informers/istio/v1alpha3/virtualservice/virtualservice.go similarity index 82% rename from vendor/github.com/knative/pkg/client/injection/informers/istio/v1alpha3/virtualservice/virtualservice.go rename to vendor/knative.dev/pkg/client/injection/informers/istio/v1alpha3/virtualservice/virtualservice.go index 7206062f..6d3151ee 100644 --- a/vendor/github.com/knative/pkg/client/injection/informers/istio/v1alpha3/virtualservice/virtualservice.go +++ b/vendor/knative.dev/pkg/client/injection/informers/istio/v1alpha3/virtualservice/virtualservice.go @@ -21,11 +21,11 @@ package virtualservice import ( "context" - v1alpha3 "github.com/knative/pkg/client/informers/externalversions/istio/v1alpha3" - factory "github.com/knative/pkg/client/injection/informers/istio/factory" - controller "github.com/knative/pkg/controller" - injection "github.com/knative/pkg/injection" - logging "github.com/knative/pkg/logging" + v1alpha3 "knative.dev/pkg/client/informers/externalversions/istio/v1alpha3" + factory "knative.dev/pkg/client/injection/informers/istio/factory" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" ) func init() { diff --git a/vendor/github.com/knative/pkg/client/listers/authentication/v1alpha1/expansion_generated.go b/vendor/knative.dev/pkg/client/listers/authentication/v1alpha1/expansion_generated.go similarity index 100% rename from vendor/github.com/knative/pkg/client/listers/authentication/v1alpha1/expansion_generated.go rename to vendor/knative.dev/pkg/client/listers/authentication/v1alpha1/expansion_generated.go diff --git a/vendor/github.com/knative/pkg/client/listers/authentication/v1alpha1/policy.go b/vendor/knative.dev/pkg/client/listers/authentication/v1alpha1/policy.go similarity index 97% rename from vendor/github.com/knative/pkg/client/listers/authentication/v1alpha1/policy.go rename to vendor/knative.dev/pkg/client/listers/authentication/v1alpha1/policy.go index a8581d3e..e8c786d9 100644 --- a/vendor/github.com/knative/pkg/client/listers/authentication/v1alpha1/policy.go +++ b/vendor/knative.dev/pkg/client/listers/authentication/v1alpha1/policy.go @@ -19,10 +19,10 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "github.com/knative/pkg/apis/istio/authentication/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" + v1alpha1 "knative.dev/pkg/apis/istio/authentication/v1alpha1" ) // PolicyLister helps list Policies. diff --git a/vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/destinationrule.go b/vendor/knative.dev/pkg/client/listers/istio/v1alpha3/destinationrule.go similarity index 98% rename from vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/destinationrule.go rename to vendor/knative.dev/pkg/client/listers/istio/v1alpha3/destinationrule.go index ec1ff755..ae687a0a 100644 --- a/vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/destinationrule.go +++ b/vendor/knative.dev/pkg/client/listers/istio/v1alpha3/destinationrule.go @@ -19,10 +19,10 @@ limitations under the License. package v1alpha3 import ( - v1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" + v1alpha3 "knative.dev/pkg/apis/istio/v1alpha3" ) // DestinationRuleLister helps list DestinationRules. diff --git a/vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/expansion_generated.go b/vendor/knative.dev/pkg/client/listers/istio/v1alpha3/expansion_generated.go similarity index 100% rename from vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/expansion_generated.go rename to vendor/knative.dev/pkg/client/listers/istio/v1alpha3/expansion_generated.go diff --git a/vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/gateway.go b/vendor/knative.dev/pkg/client/listers/istio/v1alpha3/gateway.go similarity index 98% rename from vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/gateway.go rename to vendor/knative.dev/pkg/client/listers/istio/v1alpha3/gateway.go index 62a78893..5af2802a 100644 --- a/vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/gateway.go +++ b/vendor/knative.dev/pkg/client/listers/istio/v1alpha3/gateway.go @@ -19,10 +19,10 @@ limitations under the License. package v1alpha3 import ( - v1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" + v1alpha3 "knative.dev/pkg/apis/istio/v1alpha3" ) // GatewayLister helps list Gateways. diff --git a/vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/virtualservice.go b/vendor/knative.dev/pkg/client/listers/istio/v1alpha3/virtualservice.go similarity index 98% rename from vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/virtualservice.go rename to vendor/knative.dev/pkg/client/listers/istio/v1alpha3/virtualservice.go index 3284cda8..d7dcd2a5 100644 --- a/vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/virtualservice.go +++ b/vendor/knative.dev/pkg/client/listers/istio/v1alpha3/virtualservice.go @@ -19,10 +19,10 @@ limitations under the License. package v1alpha3 import ( - v1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" + v1alpha3 "knative.dev/pkg/apis/istio/v1alpha3" ) // VirtualServiceLister helps list VirtualServices. diff --git a/vendor/github.com/knative/pkg/cloudevents/README.md b/vendor/knative.dev/pkg/cloudevents/README.md similarity index 100% rename from vendor/github.com/knative/pkg/cloudevents/README.md rename to vendor/knative.dev/pkg/cloudevents/README.md diff --git a/vendor/github.com/knative/pkg/cloudevents/builder.go b/vendor/knative.dev/pkg/cloudevents/builder.go similarity index 100% rename from vendor/github.com/knative/pkg/cloudevents/builder.go rename to vendor/knative.dev/pkg/cloudevents/builder.go diff --git a/vendor/github.com/knative/pkg/cloudevents/client.go b/vendor/knative.dev/pkg/cloudevents/client.go similarity index 100% rename from vendor/github.com/knative/pkg/cloudevents/client.go rename to vendor/knative.dev/pkg/cloudevents/client.go diff --git a/vendor/github.com/knative/pkg/cloudevents/doc.go b/vendor/knative.dev/pkg/cloudevents/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/cloudevents/doc.go rename to vendor/knative.dev/pkg/cloudevents/doc.go diff --git a/vendor/github.com/knative/pkg/cloudevents/encoding_binary.go b/vendor/knative.dev/pkg/cloudevents/encoding_binary.go similarity index 100% rename from vendor/github.com/knative/pkg/cloudevents/encoding_binary.go rename to vendor/knative.dev/pkg/cloudevents/encoding_binary.go diff --git a/vendor/github.com/knative/pkg/cloudevents/encoding_structured.go b/vendor/knative.dev/pkg/cloudevents/encoding_structured.go similarity index 100% rename from vendor/github.com/knative/pkg/cloudevents/encoding_structured.go rename to vendor/knative.dev/pkg/cloudevents/encoding_structured.go diff --git a/vendor/github.com/knative/pkg/cloudevents/event.go b/vendor/knative.dev/pkg/cloudevents/event.go similarity index 100% rename from vendor/github.com/knative/pkg/cloudevents/event.go rename to vendor/knative.dev/pkg/cloudevents/event.go diff --git a/vendor/github.com/knative/pkg/cloudevents/event_v01.go b/vendor/knative.dev/pkg/cloudevents/event_v01.go similarity index 100% rename from vendor/github.com/knative/pkg/cloudevents/event_v01.go rename to vendor/knative.dev/pkg/cloudevents/event_v01.go diff --git a/vendor/github.com/knative/pkg/cloudevents/event_v02.go b/vendor/knative.dev/pkg/cloudevents/event_v02.go similarity index 100% rename from vendor/github.com/knative/pkg/cloudevents/event_v02.go rename to vendor/knative.dev/pkg/cloudevents/event_v02.go diff --git a/vendor/github.com/knative/pkg/cloudevents/handler.go b/vendor/knative.dev/pkg/cloudevents/handler.go similarity index 100% rename from vendor/github.com/knative/pkg/cloudevents/handler.go rename to vendor/knative.dev/pkg/cloudevents/handler.go diff --git a/vendor/github.com/knative/pkg/code-of-conduct.md b/vendor/knative.dev/pkg/code-of-conduct.md similarity index 100% rename from vendor/github.com/knative/pkg/code-of-conduct.md rename to vendor/knative.dev/pkg/code-of-conduct.md diff --git a/vendor/github.com/knative/pkg/codegen/cmd/injection-gen/args/args.go b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/args/args.go similarity index 100% rename from vendor/github.com/knative/pkg/codegen/cmd/injection-gen/args/args.go rename to vendor/knative.dev/pkg/codegen/cmd/injection-gen/args/args.go diff --git a/vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/client.go b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/client.go similarity index 96% rename from vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/client.go rename to vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/client.go index c2f4914f..0238b32f 100644 --- a/vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/client.go +++ b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/client.go @@ -18,6 +18,7 @@ package generators import ( "io" + "k8s.io/gengo/generator" "k8s.io/gengo/namer" "k8s.io/gengo/types" @@ -64,10 +65,10 @@ func (g *clientGenerator) GenerateType(c *generator.Context, t *types.Type, w io m := map[string]interface{}{ "clientSetNewForConfigOrDie": c.Universe.Function(types.Name{Package: g.clientSetPackage, Name: "NewForConfigOrDie"}), "clientSetInterface": c.Universe.Type(types.Name{Package: g.clientSetPackage, Name: "Interface"}), - "injectionRegisterClient": c.Universe.Function(types.Name{Package: "github.com/knative/pkg/injection", Name: "Default.RegisterClient"}), + "injectionRegisterClient": c.Universe.Function(types.Name{Package: "knative.dev/pkg/injection", Name: "Default.RegisterClient"}), "restConfig": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Config"}), "loggingFromContext": c.Universe.Function(types.Name{ - Package: "github.com/knative/pkg/logging", + Package: "knative.dev/pkg/logging", Name: "FromContext", }), } diff --git a/vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/factory.go b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/factory.go similarity index 93% rename from vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/factory.go rename to vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/factory.go index 52563340..a81bd2be 100644 --- a/vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/factory.go +++ b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/factory.go @@ -18,6 +18,7 @@ package generators import ( "io" + "k8s.io/gengo/generator" "k8s.io/gengo/namer" "k8s.io/gengo/types" @@ -66,10 +67,10 @@ func (g *factoryGenerator) GenerateType(c *generator.Context, t *types.Type, w i "cachingClientGet": c.Universe.Type(types.Name{Package: g.cachingClientSetPackage, Name: "Get"}), "informersNewSharedInformerFactory": c.Universe.Function(types.Name{Package: g.sharedInformerFactoryPackage, Name: "NewSharedInformerFactory"}), "informersSharedInformerFactory": c.Universe.Function(types.Name{Package: g.sharedInformerFactoryPackage, Name: "SharedInformerFactory"}), - "injectionRegisterInformerFactory": c.Universe.Type(types.Name{Package: "github.com/knative/pkg/injection", Name: "Default.RegisterInformerFactory"}), - "controllerGetResyncPeriod": c.Universe.Type(types.Name{Package: "github.com/knative/pkg/controller", Name: "GetResyncPeriod"}), + "injectionRegisterInformerFactory": c.Universe.Type(types.Name{Package: "knative.dev/pkg/injection", Name: "Default.RegisterInformerFactory"}), + "controllerGetResyncPeriod": c.Universe.Type(types.Name{Package: "knative.dev/pkg/controller", Name: "GetResyncPeriod"}), "loggingFromContext": c.Universe.Function(types.Name{ - Package: "github.com/knative/pkg/logging", + Package: "knative.dev/pkg/logging", Name: "FromContext", }), } diff --git a/vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/fakeclient.go b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/fakeclient.go similarity index 96% rename from vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/fakeclient.go rename to vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/fakeclient.go index 5ed53925..428c665b 100644 --- a/vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/fakeclient.go +++ b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/fakeclient.go @@ -18,6 +18,7 @@ package generators import ( "io" + "k8s.io/gengo/generator" "k8s.io/gengo/namer" "k8s.io/gengo/types" @@ -67,11 +68,11 @@ func (g *fakeClientGenerator) GenerateType(c *generator.Context, t *types.Type, "clientKey": c.Universe.Type(types.Name{Package: g.clientInjectionPkg, Name: "Key"}), "fakeClient": c.Universe.Type(types.Name{Package: g.fakeClientPkg, Name: "Clientset"}), "injectionRegisterClient": c.Universe.Function(types.Name{ - Package: "github.com/knative/pkg/injection", + Package: "knative.dev/pkg/injection", Name: "Fake.RegisterClient", }), "loggingFromContext": c.Universe.Function(types.Name{ - Package: "github.com/knative/pkg/logging", + Package: "knative.dev/pkg/logging", Name: "FromContext", }), } diff --git a/vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/fakefactory.go b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/fakefactory.go similarity index 96% rename from vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/fakefactory.go rename to vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/fakefactory.go index 5b131dae..9aa16d75 100644 --- a/vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/fakefactory.go +++ b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/fakefactory.go @@ -18,6 +18,7 @@ package generators import ( "io" + "k8s.io/gengo/generator" "k8s.io/gengo/namer" "k8s.io/gengo/types" @@ -70,10 +71,10 @@ func (g *fakeFactoryGenerator) GenerateType(c *generator.Context, t *types.Type, "clientGet": c.Universe.Function(types.Name{Package: g.fakeClientInjectionPkg, Name: "Get"}), "informersNewSharedInformerFactory": c.Universe.Function(types.Name{Package: g.sharedInformerFactoryPackage, Name: "NewSharedInformerFactory"}), "injectionRegisterInformerFactory": c.Universe.Function(types.Name{ - Package: "github.com/knative/pkg/injection", + Package: "knative.dev/pkg/injection", Name: "Fake.RegisterInformerFactory", }), - "controllerGetResyncPeriod": c.Universe.Type(types.Name{Package: "github.com/knative/pkg/controller", Name: "GetResyncPeriod"}), + "controllerGetResyncPeriod": c.Universe.Type(types.Name{Package: "knative.dev/pkg/controller", Name: "GetResyncPeriod"}), } sw.Do(injectionFakeInformerFactory, m) diff --git a/vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/fakeinformer.go b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/fakeinformer.go similarity index 95% rename from vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/fakeinformer.go rename to vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/fakeinformer.go index 14af5a20..9218c418 100644 --- a/vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/fakeinformer.go +++ b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/fakeinformer.go @@ -18,6 +18,7 @@ package generators import ( "io" + clientgentypes "k8s.io/code-generator/cmd/client-gen/types" "k8s.io/gengo/generator" "k8s.io/gengo/namer" @@ -86,9 +87,9 @@ func (g *fakeInformerGenerator) GenerateType(c *generator.Context, t *types.Type "group": namer.IC(g.groupGoName), "type": t, "version": namer.IC(g.groupVersion.Version.String()), - "controllerInformer": c.Universe.Type(types.Name{Package: "github.com/knative/pkg/controller", Name: "Informer"}), + "controllerInformer": c.Universe.Type(types.Name{Package: "knative.dev/pkg/controller", Name: "Informer"}), "injectionRegisterInformer": c.Universe.Function(types.Name{ - Package: "github.com/knative/pkg/injection", + Package: "knative.dev/pkg/injection", Name: "Fake.RegisterInformer", }), } diff --git a/vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/informer.go b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/informer.go similarity index 95% rename from vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/informer.go rename to vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/informer.go index ca8d88a7..e42eeb6e 100644 --- a/vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/informer.go +++ b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/informer.go @@ -18,6 +18,7 @@ package generators import ( "io" + clientgentypes "k8s.io/code-generator/cmd/client-gen/types" "k8s.io/gengo/generator" "k8s.io/gengo/namer" @@ -81,12 +82,12 @@ func (g *injectionGenerator) GenerateType(c *generator.Context, t *types.Type, w "group": namer.IC(g.groupGoName), "type": t, "version": namer.IC(g.groupVersion.Version.String()), - "injectionRegisterInformer": c.Universe.Type(types.Name{Package: "github.com/knative/pkg/injection", Name: "Default.RegisterInformer"}), - "controllerInformer": c.Universe.Type(types.Name{Package: "github.com/knative/pkg/controller", Name: "Informer"}), + "injectionRegisterInformer": c.Universe.Type(types.Name{Package: "knative.dev/pkg/injection", Name: "Default.RegisterInformer"}), + "controllerInformer": c.Universe.Type(types.Name{Package: "knative.dev/pkg/controller", Name: "Informer"}), "informersTypedInformer": c.Universe.Type(types.Name{Package: g.typedInformerPackage, Name: t.Name.Name + "Informer"}), "factoryGet": c.Universe.Type(types.Name{Package: g.groupInformerFactoryPackage, Name: "Get"}), "loggingFromContext": c.Universe.Function(types.Name{ - Package: "github.com/knative/pkg/logging", + Package: "knative.dev/pkg/logging", Name: "FromContext", }), } diff --git a/vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/namesystems.go b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/namesystems.go similarity index 100% rename from vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/namesystems.go rename to vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/namesystems.go diff --git a/vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/packages.go b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/packages.go similarity index 99% rename from vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/packages.go rename to vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/packages.go index f8359af9..f8866bde 100644 --- a/vendor/github.com/knative/pkg/codegen/cmd/injection-gen/generators/packages.go +++ b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/generators/packages.go @@ -30,7 +30,7 @@ import ( "k8s.io/gengo/types" "k8s.io/klog" - informergenargs "github.com/knative/pkg/codegen/cmd/injection-gen/args" + informergenargs "knative.dev/pkg/codegen/cmd/injection-gen/args" ) // Packages makes the client package definition. diff --git a/vendor/github.com/knative/pkg/codegen/cmd/injection-gen/main.go b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/main.go similarity index 91% rename from vendor/github.com/knative/pkg/codegen/cmd/injection-gen/main.go rename to vendor/knative.dev/pkg/codegen/cmd/injection-gen/main.go index 4120d65c..62bb30e0 100644 --- a/vendor/github.com/knative/pkg/codegen/cmd/injection-gen/main.go +++ b/vendor/knative.dev/pkg/codegen/cmd/injection-gen/main.go @@ -24,8 +24,8 @@ import ( "k8s.io/gengo/args" "k8s.io/klog" - generatorargs "github.com/knative/pkg/codegen/cmd/injection-gen/args" - "github.com/knative/pkg/codegen/cmd/injection-gen/generators" + generatorargs "knative.dev/pkg/codegen/cmd/injection-gen/args" + "knative.dev/pkg/codegen/cmd/injection-gen/generators" "github.com/spf13/pflag" ) diff --git a/vendor/github.com/knative/pkg/configmap/doc.go b/vendor/knative.dev/pkg/configmap/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/configmap/doc.go rename to vendor/knative.dev/pkg/configmap/doc.go diff --git a/vendor/github.com/knative/pkg/configmap/filter.go b/vendor/knative.dev/pkg/configmap/filter.go similarity index 100% rename from vendor/github.com/knative/pkg/configmap/filter.go rename to vendor/knative.dev/pkg/configmap/filter.go diff --git a/vendor/github.com/knative/pkg/configmap/informed_watcher.go b/vendor/knative.dev/pkg/configmap/informed_watcher.go similarity index 100% rename from vendor/github.com/knative/pkg/configmap/informed_watcher.go rename to vendor/knative.dev/pkg/configmap/informed_watcher.go diff --git a/vendor/github.com/knative/pkg/configmap/load.go b/vendor/knative.dev/pkg/configmap/load.go similarity index 100% rename from vendor/github.com/knative/pkg/configmap/load.go rename to vendor/knative.dev/pkg/configmap/load.go diff --git a/vendor/github.com/knative/pkg/configmap/manual_watcher.go b/vendor/knative.dev/pkg/configmap/manual_watcher.go similarity index 100% rename from vendor/github.com/knative/pkg/configmap/manual_watcher.go rename to vendor/knative.dev/pkg/configmap/manual_watcher.go diff --git a/vendor/github.com/knative/pkg/configmap/static_watcher.go b/vendor/knative.dev/pkg/configmap/static_watcher.go similarity index 100% rename from vendor/github.com/knative/pkg/configmap/static_watcher.go rename to vendor/knative.dev/pkg/configmap/static_watcher.go diff --git a/vendor/github.com/knative/pkg/configmap/store.go b/vendor/knative.dev/pkg/configmap/store.go similarity index 98% rename from vendor/github.com/knative/pkg/configmap/store.go rename to vendor/knative.dev/pkg/configmap/store.go index 612d0793..452830eb 100644 --- a/vendor/github.com/knative/pkg/configmap/store.go +++ b/vendor/knative.dev/pkg/configmap/store.go @@ -23,6 +23,9 @@ import ( corev1 "k8s.io/api/core/v1" ) +// ExampleKey signifies a given example configuration in a ConfigMap. +const ExampleKey = "_example" + // Logger is the interface that UntypedStore expects its logger to conform to. // UntypedStore will log when updates succeed or fail. type Logger interface { diff --git a/vendor/github.com/knative/pkg/configmap/testing/configmap.go b/vendor/knative.dev/pkg/configmap/testing/configmap.go similarity index 95% rename from vendor/github.com/knative/pkg/configmap/testing/configmap.go rename to vendor/knative.dev/pkg/configmap/testing/configmap.go index 57646a7f..5c67f8ff 100644 --- a/vendor/github.com/knative/pkg/configmap/testing/configmap.go +++ b/vendor/knative.dev/pkg/configmap/testing/configmap.go @@ -20,12 +20,11 @@ import ( "testing" "github.com/ghodss/yaml" + "knative.dev/pkg/configmap" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/sets" ) -const ExampleKey = "_example" - // ConfigMapFromTestFile creates a v1.ConfigMap from a YAML file // It loads the YAML file from the testdata folder. func ConfigMapFromTestFile(t *testing.T, name string, allowed ...string) *corev1.ConfigMap { @@ -57,7 +56,7 @@ func ConfigMapsFromTestFile(t *testing.T, name string, allowed ...string) (*core // We expect each of the allowed keys, and a key holding an example // configuration for us to validate. - allowed = append(allowed, ExampleKey) + allowed = append(allowed, configmap.ExampleKey) if len(orig.Data) != len(allowed) { // See here for why we only check in empty ConfigMaps: @@ -72,7 +71,7 @@ func ConfigMapsFromTestFile(t *testing.T, name string, allowed ...string) (*core } // With the length and membership checks, we know that the keyspace matches. - exampleBody := orig.Data[ExampleKey] + exampleBody := orig.Data[configmap.ExampleKey] // Check that exampleBody does not have lines that end in a trailing space, for i, line := range strings.Split(exampleBody, "\n") { if strings.HasSuffix(line, " ") { diff --git a/vendor/github.com/knative/pkg/configmap/watcher.go b/vendor/knative.dev/pkg/configmap/watcher.go similarity index 100% rename from vendor/github.com/knative/pkg/configmap/watcher.go rename to vendor/knative.dev/pkg/configmap/watcher.go diff --git a/vendor/github.com/knative/pkg/controller/controller.go b/vendor/knative.dev/pkg/controller/controller.go similarity index 94% rename from vendor/github.com/knative/pkg/controller/controller.go rename to vendor/knative.dev/pkg/controller/controller.go index b714432f..35543552 100644 --- a/vendor/github.com/knative/pkg/controller/controller.go +++ b/vendor/knative.dev/pkg/controller/controller.go @@ -29,11 +29,12 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/tools/cache" + "k8s.io/client-go/tools/record" "k8s.io/client-go/util/workqueue" - "github.com/knative/pkg/kmeta" - "github.com/knative/pkg/logging" - "github.com/knative/pkg/logging/logkey" + "knative.dev/pkg/kmeta" + "knative.dev/pkg/logging" + "knative.dev/pkg/logging/logkey" ) const ( @@ -452,3 +453,22 @@ func GetResyncPeriod(ctx context.Context) time.Duration { func GetTrackerLease(ctx context.Context) time.Duration { return 3 * GetResyncPeriod(ctx) } + +// erKey is used to associate record.EventRecorders with contexts. +type erKey struct{} + +// WithEventRecorder attaches the given record.EventRecorder to the provided context +// in the returned context. +func WithEventRecorder(ctx context.Context, er record.EventRecorder) context.Context { + return context.WithValue(ctx, erKey{}, er) +} + +// GetEventRecorder attempts to look up the record.EventRecorder on a given context. +// It may return null if none is found. +func GetEventRecorder(ctx context.Context) record.EventRecorder { + untyped := ctx.Value(erKey{}) + if untyped == nil { + return nil + } + return untyped.(record.EventRecorder) +} diff --git a/vendor/github.com/knative/pkg/controller/helper.go b/vendor/knative.dev/pkg/controller/helper.go similarity index 98% rename from vendor/github.com/knative/pkg/controller/helper.go rename to vendor/knative.dev/pkg/controller/helper.go index 887d715e..b326cc5b 100644 --- a/vendor/github.com/knative/pkg/controller/helper.go +++ b/vendor/knative.dev/pkg/controller/helper.go @@ -21,7 +21,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/tools/cache" - "github.com/knative/pkg/kmeta" + "knative.dev/pkg/kmeta" ) type Callback func(interface{}) diff --git a/vendor/github.com/knative/pkg/controller/stats_reporter.go b/vendor/knative.dev/pkg/controller/stats_reporter.go similarity index 99% rename from vendor/github.com/knative/pkg/controller/stats_reporter.go rename to vendor/knative.dev/pkg/controller/stats_reporter.go index 2dff988e..c2e74cba 100644 --- a/vendor/github.com/knative/pkg/controller/stats_reporter.go +++ b/vendor/knative.dev/pkg/controller/stats_reporter.go @@ -21,7 +21,7 @@ import ( "errors" "time" - "github.com/knative/pkg/metrics" + "knative.dev/pkg/metrics" "go.opencensus.io/stats" "go.opencensus.io/stats/view" "go.opencensus.io/tag" diff --git a/vendor/github.com/knative/pkg/controller/testing/fake_stats_reporter.go b/vendor/knative.dev/pkg/controller/testing/fake_stats_reporter.go similarity index 100% rename from vendor/github.com/knative/pkg/controller/testing/fake_stats_reporter.go rename to vendor/knative.dev/pkg/controller/testing/fake_stats_reporter.go diff --git a/vendor/github.com/knative/pkg/hack/boilerplate/boilerplate.go.txt b/vendor/knative.dev/pkg/hack/boilerplate/boilerplate.go.txt similarity index 100% rename from vendor/github.com/knative/pkg/hack/boilerplate/boilerplate.go.txt rename to vendor/knative.dev/pkg/hack/boilerplate/boilerplate.go.txt diff --git a/vendor/github.com/knative/pkg/hack/generate-knative.sh b/vendor/knative.dev/pkg/hack/generate-knative.sh similarity index 100% rename from vendor/github.com/knative/pkg/hack/generate-knative.sh rename to vendor/knative.dev/pkg/hack/generate-knative.sh diff --git a/vendor/github.com/knative/pkg/hack/update-codegen.sh b/vendor/knative.dev/pkg/hack/update-codegen.sh similarity index 88% rename from vendor/github.com/knative/pkg/hack/update-codegen.sh rename to vendor/knative.dev/pkg/hack/update-codegen.sh index ed4695d8..4adf2ead 100755 --- a/vendor/github.com/knative/pkg/hack/update-codegen.sh +++ b/vendor/knative.dev/pkg/hack/update-codegen.sh @@ -29,25 +29,25 @@ go install ./vendor/k8s.io/code-generator/cmd/deepcopy-gen # k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir # instead of the $GOPATH directly. For normal projects this can be dropped. ${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \ - github.com/knative/pkg/client github.com/knative/pkg/apis \ + knative.dev/pkg/client knative.dev/pkg/apis \ "istio:v1alpha3 istio/authentication:v1alpha1" \ --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt # Knative Injection ${REPO_ROOT_DIR}/hack/generate-knative.sh "injection" \ - github.com/knative/pkg/client github.com/knative/pkg/apis \ + knative.dev/pkg/client knative.dev/pkg/apis \ "istio:v1alpha3 istio/authentication:v1alpha1" \ --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt # Only deepcopy the Duck types, as they are not real resources. ${CODEGEN_PKG}/generate-groups.sh "deepcopy" \ - github.com/knative/pkg/client github.com/knative/pkg/apis \ + knative.dev/pkg/client knative.dev/pkg/apis \ "duck:v1alpha1,v1beta1" \ --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt # Depends on generate-groups.sh to install bin/deepcopy-gen ${GOPATH}/bin/deepcopy-gen --input-dirs \ - github.com/knative/pkg/apis,github.com/knative/pkg/logging,github.com/knative/pkg/testing \ + knative.dev/pkg/apis,knative.dev/pkg/logging,knative.dev/pkg/testing \ -O zz_generated.deepcopy \ --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt diff --git a/vendor/github.com/knative/pkg/hack/update-deps.sh b/vendor/knative.dev/pkg/hack/update-deps.sh similarity index 86% rename from vendor/github.com/knative/pkg/hack/update-deps.sh rename to vendor/knative.dev/pkg/hack/update-deps.sh index 2213d651..27e26454 100755 --- a/vendor/github.com/knative/pkg/hack/update-deps.sh +++ b/vendor/knative.dev/pkg/hack/update-deps.sh @@ -14,13 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +readonly ROOT_DIR=$(dirname $0)/.. +source ${ROOT_DIR}/vendor/github.com/knative/test-infra/scripts/library.sh + set -o errexit set -o nounset set -o pipefail -source $(dirname $0)/../vendor/github.com/knative/test-infra/scripts/library.sh - -cd ${REPO_ROOT_DIR} +cd ${ROOT_DIR} # Ensure we have everything we need under vendor/ dep ensure diff --git a/vendor/github.com/knative/pkg/hack/verify-codegen.sh b/vendor/knative.dev/pkg/hack/verify-codegen.sh similarity index 100% rename from vendor/github.com/knative/pkg/hack/verify-codegen.sh rename to vendor/knative.dev/pkg/hack/verify-codegen.sh diff --git a/vendor/github.com/knative/pkg/injection/README.md b/vendor/knative.dev/pkg/injection/README.md similarity index 75% rename from vendor/github.com/knative/pkg/injection/README.md rename to vendor/knative.dev/pkg/injection/README.md index 32f0a2df..fce4aefc 100644 --- a/vendor/github.com/knative/pkg/injection/README.md +++ b/vendor/knative.dev/pkg/injection/README.md @@ -1,12 +1,12 @@ # Knative Dependency Injection -This library supports the production of controller processes with -minimal boilerplate outside of the reconciler implementation. +This library supports the production of controller processes with minimal +boilerplate outside of the reconciler implementation. -## Registering Controllers +## Building Controllers -To adopt this model of controller construction, implementations -should start with the following controller constructor: +To adopt this model of controller construction, implementations should start +with the following controller constructor: ```go import ( @@ -14,7 +14,6 @@ import ( "github.com/knative/pkg/configmap" "github.com/knative/pkg/controller" - "github.com/knative/pkg/injection" "github.com/knative/pkg/logging" ) @@ -32,11 +31,6 @@ func NewController(ctx context.Context, cmw configmap.Watcher) *controller.Impl return impl } - -// Register our controller process. -func init() { - injection.Default.RegisterController(NewController) -} ``` ## Consuming Informers @@ -46,7 +40,7 @@ queue work, and pass the "listers" fed by the informers' caches to the nested "Reconciler" for accessing objects. Our controller constructor is passed a `context.Context` onto which we inject -any informers we access. The accessors for these informers are in little stub +any informers we access. The accessors for these informers are in little stub libraries, which we have hand rolled for Kubernetes (more on how to generate these below). @@ -81,16 +75,16 @@ func NewController(ctx context.Context, cmw configmap.Watcher) *controller.Impl ``` -> How it works: by importing the accessor for a client or informer we link -> it and trigger the `init()` method for its package to run at startup. -> Each of these libraries registers themselves similar to our `init()` and -> controller processes can leverage this to setup and inject all of the -> registered things onto a context to pass to your `NewController()`. +> How it works: by importing the accessor for a client or informer we link it +> and trigger the `init()` method for its package to run at startup. Each of +> these libraries registers themselves similar to our `init()` and controller +> processes can leverage this to setup and inject all of the registered things +> onto a context to pass to your `NewController()`. ## Testing Controllers -Similar to `injection.Default`, we also have `injection.Fake`. While linking -the normal accessors sets up the former, linking their fakes set up the latter. +Similar to `injection.Default`, we also have `injection.Fake`. While linking the +normal accessors sets up the former, linking their fakes set up the latter. ``` import ( @@ -152,36 +146,36 @@ func TestFoo(t *testing.T) { ## Starting controllers -By registering our controller with `injection.Default` via `init()` above we -enable our shared main method to bootstrap the entire container process. All -we do is link the controller packages containing the `init()` registering them -and this transitively links in all of the things it needs. Then our shared -main method sets it all up and runs our controllers. +All we do is import the controller packages and pass their constructors along +with a component name to our shared main. Then our shared main method sets it +all up and runs our controllers. ```go package main import ( // The set of controllers this process will run. - _ "github.com/knative/foo/pkg/reconciler/bar" - _ "github.com/knative/baz/pkg/reconciler/blah" + "github.com/knative/foo/pkg/reconciler/bar" + "github.com/knative/baz/pkg/reconciler/blah" // This defines the shared main for injected controllers. "github.com/knative/pkg/injection/sharedmain" ) func main() { - sharedmain.Main() + sharedmain.Main("component-name", + bar.NewController, + blah.NewController, + ) } ``` - ## Generating Injection Stubs. To make generating stubs simple, we have harnessed the Kubernetes -code-generation tooling to produce `injection-gen`. Similar to how -you might ordinarily run the other `foo-gen` processed: +code-generation tooling to produce `injection-gen`. Similar to how you might +ordinarily run the other `foo-gen` processed: ```shell CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${REPO_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)} @@ -192,7 +186,8 @@ ${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \ --go-header-file ${REPO_ROOT}/hack/boilerplate/boilerplate.go.txt ``` -To run `injection-gen` you run the following (replacing the import path and api group): +To run `injection-gen` you run the following (replacing the import path and api +group): ```shell @@ -205,7 +200,8 @@ ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh "injection" \ ``` -To ensure the appropriate tooling is vendored, add the following to `Gopkg.toml`: +To ensure the appropriate tooling is vendored, add the following to +`Gopkg.toml`: ```toml required = [ diff --git a/vendor/github.com/knative/pkg/injection/clients.go b/vendor/knative.dev/pkg/injection/clients.go similarity index 100% rename from vendor/github.com/knative/pkg/injection/clients.go rename to vendor/knative.dev/pkg/injection/clients.go diff --git a/vendor/knative.dev/pkg/injection/clients/apiextclient/apiext.go b/vendor/knative.dev/pkg/injection/clients/apiextclient/apiext.go new file mode 100644 index 00000000..212f4650 --- /dev/null +++ b/vendor/knative.dev/pkg/injection/clients/apiextclient/apiext.go @@ -0,0 +1,49 @@ +/* +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 apiextclient + +import ( + "context" + + "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" + "k8s.io/client-go/rest" + + "knative.dev/pkg/injection" + "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterClient(withClient) +} + +// Key is used as the key for associating information +// with a context.Context. +type Key struct{} + +func withClient(ctx context.Context, cfg *rest.Config) context.Context { + return context.WithValue(ctx, Key{}, clientset.NewForConfigOrDie(cfg)) +} + +// Get extracts the Kubernetes Api Extensions client from the context. +func Get(ctx context.Context) clientset.Interface { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (clientset.Interface)(nil)) + } + return untyped.(clientset.Interface) +} diff --git a/vendor/knative.dev/pkg/injection/clients/apiextclient/fake/fake.go b/vendor/knative.dev/pkg/injection/clients/apiextclient/fake/fake.go new file mode 100644 index 00000000..4cacf618 --- /dev/null +++ b/vendor/knative.dev/pkg/injection/clients/apiextclient/fake/fake.go @@ -0,0 +1,53 @@ +/* +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 fake + +import ( + "context" + + "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/rest" + + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/clients/apiextclient" + "knative.dev/pkg/logging" +) + +func init() { + injection.Fake.RegisterClient(withClient) +} + +func withClient(ctx context.Context, cfg *rest.Config) context.Context { + ctx, _ = With(ctx) + return ctx +} + +func With(ctx context.Context, objects ...runtime.Object) (context.Context, *fake.Clientset) { + cs := fake.NewSimpleClientset(objects...) + return context.WithValue(ctx, apiextclient.Key{}, cs), cs +} + +// Get extracts the Kubernetes Api Extensions client from the context. +func Get(ctx context.Context) *fake.Clientset { + untyped := ctx.Value(apiextclient.Key{}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (*fake.Clientset)(nil)) + } + return untyped.(*fake.Clientset) +} diff --git a/vendor/github.com/knative/pkg/injection/clients/dynamicclient/dynamicclient.go b/vendor/knative.dev/pkg/injection/clients/dynamicclient/dynamicclient.go similarity index 88% rename from vendor/github.com/knative/pkg/injection/clients/dynamicclient/dynamicclient.go rename to vendor/knative.dev/pkg/injection/clients/dynamicclient/dynamicclient.go index 84eba3f0..19b4674b 100644 --- a/vendor/github.com/knative/pkg/injection/clients/dynamicclient/dynamicclient.go +++ b/vendor/knative.dev/pkg/injection/clients/dynamicclient/dynamicclient.go @@ -22,7 +22,8 @@ import ( "k8s.io/client-go/dynamic" "k8s.io/client-go/rest" - "github.com/knative/pkg/injection" + "knative.dev/pkg/injection" + "knative.dev/pkg/logging" ) func init() { @@ -41,7 +42,8 @@ func withClient(ctx context.Context, cfg *rest.Config) context.Context { func Get(ctx context.Context) dynamic.Interface { untyped := ctx.Value(Key{}) if untyped == nil { - return nil + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (dynamic.Interface)(nil)) } return untyped.(dynamic.Interface) } diff --git a/vendor/github.com/knative/pkg/injection/clients/dynamicclient/fake/fake.go b/vendor/knative.dev/pkg/injection/clients/dynamicclient/fake/fake.go similarity index 86% rename from vendor/github.com/knative/pkg/injection/clients/dynamicclient/fake/fake.go rename to vendor/knative.dev/pkg/injection/clients/dynamicclient/fake/fake.go index fd201c95..12670edd 100644 --- a/vendor/github.com/knative/pkg/injection/clients/dynamicclient/fake/fake.go +++ b/vendor/knative.dev/pkg/injection/clients/dynamicclient/fake/fake.go @@ -23,8 +23,9 @@ import ( "k8s.io/client-go/dynamic/fake" "k8s.io/client-go/rest" - "github.com/knative/pkg/injection" - "github.com/knative/pkg/injection/clients/dynamicclient" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/clients/dynamicclient" + "knative.dev/pkg/logging" ) func init() { @@ -45,7 +46,8 @@ func With(ctx context.Context, scheme *runtime.Scheme, objects ...runtime.Object func Get(ctx context.Context) *fake.FakeDynamicClient { untyped := ctx.Value(dynamicclient.Key{}) if untyped == nil { - return nil + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (*fake.FakeDynamicClient)(nil)) } return untyped.(*fake.FakeDynamicClient) } diff --git a/vendor/github.com/knative/pkg/injection/clients/kubeclient/fake/fake.go b/vendor/knative.dev/pkg/injection/clients/kubeclient/fake/fake.go similarity index 86% rename from vendor/github.com/knative/pkg/injection/clients/kubeclient/fake/fake.go rename to vendor/knative.dev/pkg/injection/clients/kubeclient/fake/fake.go index 02be6d38..269839bc 100644 --- a/vendor/github.com/knative/pkg/injection/clients/kubeclient/fake/fake.go +++ b/vendor/knative.dev/pkg/injection/clients/kubeclient/fake/fake.go @@ -23,8 +23,9 @@ import ( "k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/rest" - "github.com/knative/pkg/injection" - "github.com/knative/pkg/injection/clients/kubeclient" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/clients/kubeclient" + "knative.dev/pkg/logging" ) func init() { @@ -45,7 +46,8 @@ func With(ctx context.Context, objects ...runtime.Object) (context.Context, *fak func Get(ctx context.Context) *fake.Clientset { untyped := ctx.Value(kubeclient.Key{}) if untyped == nil { - return nil + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (*fake.Clientset)(nil)) } return untyped.(*fake.Clientset) } diff --git a/vendor/github.com/knative/pkg/injection/clients/kubeclient/kubeclient.go b/vendor/knative.dev/pkg/injection/clients/kubeclient/kubeclient.go similarity index 88% rename from vendor/github.com/knative/pkg/injection/clients/kubeclient/kubeclient.go rename to vendor/knative.dev/pkg/injection/clients/kubeclient/kubeclient.go index b12a9b32..6b60663f 100644 --- a/vendor/github.com/knative/pkg/injection/clients/kubeclient/kubeclient.go +++ b/vendor/knative.dev/pkg/injection/clients/kubeclient/kubeclient.go @@ -22,7 +22,8 @@ import ( "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" - "github.com/knative/pkg/injection" + "knative.dev/pkg/injection" + "knative.dev/pkg/logging" ) func init() { @@ -41,7 +42,8 @@ func withClient(ctx context.Context, cfg *rest.Config) context.Context { func Get(ctx context.Context) kubernetes.Interface { untyped := ctx.Value(Key{}) if untyped == nil { - return nil + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (kubernetes.Interface)(nil)) } return untyped.(kubernetes.Interface) } diff --git a/vendor/github.com/knative/pkg/injection/doc.go b/vendor/knative.dev/pkg/injection/doc.go similarity index 64% rename from vendor/github.com/knative/pkg/injection/doc.go rename to vendor/knative.dev/pkg/injection/doc.go index ca4e8ed2..0a18a8fd 100644 --- a/vendor/github.com/knative/pkg/injection/doc.go +++ b/vendor/knative.dev/pkg/injection/doc.go @@ -25,9 +25,9 @@ limitations under the License. // import ( // // Simply linking this triggers the injection of the informer, which links // // the factory triggering its injection, and which links the client, -// // triggering its injection. -// deployinformer "github.com/knative/pkg/injection/informers/kubeinformers/appsv1/deployment" -// "github.com/knative/pkg/injection" +// // triggering its injection. All you need to know is that it works :) +// deployinformer "knative.dev/pkg/injection/informers/kubeinformers/appsv1/deployment" +// "knative.dev/pkg/injection" // ) // // func NewController(ctx context.Context) *controller.Impl { @@ -38,28 +38,31 @@ limitations under the License. // ... // } // -// func init() { -// injection.Default.RegisterController(NewController) -// } -// // Then in `package main` the entire controller process can be set up via: // // package main // // import ( // // The set of controllers this controller process runs. -// // Linking these will register the controllers and their transitive -// // dependencies, after which the shared main can set up the rest. -// _ "github.com/knative/foo/pkg/reconciler/matt" -// _ "github.com/knative/foo/pkg/reconciler/scott" -// _ "github.com/knative/foo/pkg/reconciler/ville" -// _ "github.com/knative/foo/pkg/reconciler/dave" +// // Linking these will register their transitive dependencies, after +// // which the shared main can set up the rest. +// "github.com/knative/foo/pkg/reconciler/matt" +// "github.com/knative/foo/pkg/reconciler/scott" +// "github.com/knative/foo/pkg/reconciler/ville" +// "github.com/knative/foo/pkg/reconciler/dave" // // // This defines the shared main for injected controllers. -// "github.com/knative/pkg/injection/sharedmain" +// "knative.dev/pkg/injection/sharedmain" // ) // // func main() { -// sharedmain.Main() +// sharedmain.Main("my-component", +// // We pass in the list of controllers to construct, and that's it! +// // If we forget to add this, go will complain about the unused import. +// matt.NewController, +// scott.NewController, +// ville.NewController, +// dave.NewController, +// ) // } package injection diff --git a/vendor/github.com/knative/pkg/injection/factories.go b/vendor/knative.dev/pkg/injection/factories.go similarity index 100% rename from vendor/github.com/knative/pkg/injection/factories.go rename to vendor/knative.dev/pkg/injection/factories.go diff --git a/vendor/github.com/knative/pkg/injection/informers.go b/vendor/knative.dev/pkg/injection/informers.go similarity index 98% rename from vendor/github.com/knative/pkg/injection/informers.go rename to vendor/knative.dev/pkg/injection/informers.go index 0425ae49..2da9ad2c 100644 --- a/vendor/github.com/knative/pkg/injection/informers.go +++ b/vendor/knative.dev/pkg/injection/informers.go @@ -21,7 +21,7 @@ import ( "k8s.io/client-go/rest" - "github.com/knative/pkg/controller" + "knative.dev/pkg/controller" ) // InformerInjector holds the type of a callback that attaches a particular diff --git a/vendor/knative.dev/pkg/injection/informers/apiextinformers/apiextensionsv1beta1/crd/crd.go b/vendor/knative.dev/pkg/injection/informers/apiextinformers/apiextensionsv1beta1/crd/crd.go new file mode 100644 index 00000000..312180ed --- /dev/null +++ b/vendor/knative.dev/pkg/injection/informers/apiextinformers/apiextensionsv1beta1/crd/crd.go @@ -0,0 +1,52 @@ +/* +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 crd + +import ( + "context" + + apiextv1beta1 "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions/apiextensions/v1beta1" + + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/apiextinformers/factory" + "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterInformer(withInformer) +} + +// Key is used as the key for associating information +// with a context.Context. +type Key struct{} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := factory.Get(ctx) + inf := f.Apiextensions().V1beta1().CustomResourceDefinitions() + return context.WithValue(ctx, Key{}, inf), inf.Informer() +} + +// Get extracts the Kubernetes Deployment informer from the context. +func Get(ctx context.Context) apiextv1beta1.CustomResourceDefinitionInformer { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (apiextv1beta1.CustomResourceDefinitionInformer)(nil)) + } + return untyped.(apiextv1beta1.CustomResourceDefinitionInformer) +} diff --git a/vendor/knative.dev/pkg/injection/informers/apiextinformers/apiextensionsv1beta1/crd/fake/fake.go b/vendor/knative.dev/pkg/injection/informers/apiextinformers/apiextensionsv1beta1/crd/fake/fake.go new file mode 100644 index 00000000..60aa8690 --- /dev/null +++ b/vendor/knative.dev/pkg/injection/informers/apiextinformers/apiextensionsv1beta1/crd/fake/fake.go @@ -0,0 +1,38 @@ +/* +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 fake + +import ( + "context" + + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/apiextinformers/apiextensionsv1beta1/crd" + "knative.dev/pkg/injection/informers/apiextinformers/factory/fake" +) + +var Get = crd.Get + +func init() { + injection.Fake.RegisterInformer(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := fake.Get(ctx) + inf := f.Apiextensions().V1beta1().CustomResourceDefinitions() + return context.WithValue(ctx, crd.Key{}, inf), inf.Informer() +} diff --git a/vendor/knative.dev/pkg/injection/informers/apiextinformers/factory/factory.go b/vendor/knative.dev/pkg/injection/informers/apiextinformers/factory/factory.go new file mode 100644 index 00000000..ba8a1c71 --- /dev/null +++ b/vendor/knative.dev/pkg/injection/informers/apiextinformers/factory/factory.go @@ -0,0 +1,53 @@ +/* +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 factory + +import ( + "context" + + "knative.dev/pkg/logging" + + informers "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions" + + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/clients/apiextclient" +) + +func init() { + injection.Default.RegisterInformerFactory(withInformerFactory) +} + +// Key is used as the key for associating information +// with a context.Context. +type Key struct{} + +func withInformerFactory(ctx context.Context) context.Context { + axc := apiextclient.Get(ctx) + return context.WithValue(ctx, Key{}, + informers.NewSharedInformerFactory(axc, controller.GetResyncPeriod(ctx))) +} + +// Get extracts the Kubernetes Api Extensions InformerFactory from the context. +func Get(ctx context.Context) informers.SharedInformerFactory { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (informers.SharedInformerFactory)(nil)) + } + return untyped.(informers.SharedInformerFactory) +} diff --git a/vendor/knative.dev/pkg/injection/informers/apiextinformers/factory/fake/fake.go b/vendor/knative.dev/pkg/injection/informers/apiextinformers/factory/fake/fake.go new file mode 100644 index 00000000..d814fed5 --- /dev/null +++ b/vendor/knative.dev/pkg/injection/informers/apiextinformers/factory/fake/fake.go @@ -0,0 +1,40 @@ +/* +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 fake + +import ( + "context" + + informers "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions" + + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/clients/apiextclient/fake" + "knative.dev/pkg/injection/informers/apiextinformers/factory" +) + +var Get = factory.Get + +func init() { + injection.Fake.RegisterInformerFactory(withInformerFactory) +} + +func withInformerFactory(ctx context.Context) context.Context { + kc := fake.Get(ctx) + return context.WithValue(ctx, factory.Key{}, + informers.NewSharedInformerFactory(kc, controller.GetResyncPeriod(ctx))) +} diff --git a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/appsv1/deployment/deployment.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/appsv1/deployment/deployment.go similarity index 83% rename from vendor/github.com/knative/pkg/injection/informers/kubeinformers/appsv1/deployment/deployment.go rename to vendor/knative.dev/pkg/injection/informers/kubeinformers/appsv1/deployment/deployment.go index a79e4435..ce9a5366 100644 --- a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/appsv1/deployment/deployment.go +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/appsv1/deployment/deployment.go @@ -21,9 +21,10 @@ import ( appsv1 "k8s.io/client-go/informers/apps/v1" - "github.com/knative/pkg/controller" - "github.com/knative/pkg/injection" - "github.com/knative/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/logging" ) func init() { @@ -44,7 +45,8 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { func Get(ctx context.Context) appsv1.DeploymentInformer { untyped := ctx.Value(Key{}) if untyped == nil { - return nil + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (appsv1.DeploymentInformer)(nil)) } return untyped.(appsv1.DeploymentInformer) } diff --git a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/appsv1/deployment/fake/fake.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/appsv1/deployment/fake/fake.go similarity index 80% rename from vendor/github.com/knative/pkg/injection/informers/kubeinformers/appsv1/deployment/fake/fake.go rename to vendor/knative.dev/pkg/injection/informers/kubeinformers/appsv1/deployment/fake/fake.go index 51cebf9e..1fa3fb26 100644 --- a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/appsv1/deployment/fake/fake.go +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/appsv1/deployment/fake/fake.go @@ -19,10 +19,10 @@ package fake import ( "context" - "github.com/knative/pkg/controller" - "github.com/knative/pkg/injection" - "github.com/knative/pkg/injection/informers/kubeinformers/appsv1/deployment" - "github.com/knative/pkg/injection/informers/kubeinformers/factory/fake" + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/appsv1/deployment" + "knative.dev/pkg/injection/informers/kubeinformers/factory/fake" ) var Get = deployment.Get diff --git a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/autoscalingv1/hpa/fake/fake.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/autoscalingv1/hpa/fake/fake.go similarity index 80% rename from vendor/github.com/knative/pkg/injection/informers/kubeinformers/autoscalingv1/hpa/fake/fake.go rename to vendor/knative.dev/pkg/injection/informers/kubeinformers/autoscalingv1/hpa/fake/fake.go index 4e33caed..c7e8818f 100644 --- a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/autoscalingv1/hpa/fake/fake.go +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/autoscalingv1/hpa/fake/fake.go @@ -19,10 +19,10 @@ package fake import ( "context" - "github.com/knative/pkg/controller" - "github.com/knative/pkg/injection" - "github.com/knative/pkg/injection/informers/kubeinformers/autoscalingv1/hpa" - "github.com/knative/pkg/injection/informers/kubeinformers/factory/fake" + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/autoscalingv1/hpa" + "knative.dev/pkg/injection/informers/kubeinformers/factory/fake" ) var Get = hpa.Get diff --git a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/autoscalingv1/hpa/hpa.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/autoscalingv1/hpa/hpa.go similarity index 82% rename from vendor/github.com/knative/pkg/injection/informers/kubeinformers/autoscalingv1/hpa/hpa.go rename to vendor/knative.dev/pkg/injection/informers/kubeinformers/autoscalingv1/hpa/hpa.go index ab1ceaa0..bc07cae8 100644 --- a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/autoscalingv1/hpa/hpa.go +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/autoscalingv1/hpa/hpa.go @@ -21,9 +21,10 @@ import ( autoscalingv1 "k8s.io/client-go/informers/autoscaling/v1" - "github.com/knative/pkg/controller" - "github.com/knative/pkg/injection" - "github.com/knative/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/logging" ) func init() { @@ -44,7 +45,8 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { func Get(ctx context.Context) autoscalingv1.HorizontalPodAutoscalerInformer { untyped := ctx.Value(Key{}) if untyped == nil { - return nil + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (autoscalingv1.HorizontalPodAutoscalerInformer)(nil)) } return untyped.(autoscalingv1.HorizontalPodAutoscalerInformer) } diff --git a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/autoscalingv2beta1/hpa/fake/fake.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/autoscalingv2beta1/hpa/fake/fake.go similarity index 79% rename from vendor/github.com/knative/pkg/injection/informers/kubeinformers/autoscalingv2beta1/hpa/fake/fake.go rename to vendor/knative.dev/pkg/injection/informers/kubeinformers/autoscalingv2beta1/hpa/fake/fake.go index 5a9fabd0..73955058 100644 --- a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/autoscalingv2beta1/hpa/fake/fake.go +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/autoscalingv2beta1/hpa/fake/fake.go @@ -19,10 +19,10 @@ package fake import ( "context" - "github.com/knative/pkg/controller" - "github.com/knative/pkg/injection" - "github.com/knative/pkg/injection/informers/kubeinformers/autoscalingv2beta1/hpa" - "github.com/knative/pkg/injection/informers/kubeinformers/factory/fake" + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/autoscalingv2beta1/hpa" + "knative.dev/pkg/injection/informers/kubeinformers/factory/fake" ) var Get = hpa.Get diff --git a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/autoscalingv2beta1/hpa/hpa.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/autoscalingv2beta1/hpa/hpa.go similarity index 82% rename from vendor/github.com/knative/pkg/injection/informers/kubeinformers/autoscalingv2beta1/hpa/hpa.go rename to vendor/knative.dev/pkg/injection/informers/kubeinformers/autoscalingv2beta1/hpa/hpa.go index e5666cd7..0e3a4dc8 100644 --- a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/autoscalingv2beta1/hpa/hpa.go +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/autoscalingv2beta1/hpa/hpa.go @@ -21,9 +21,10 @@ import ( autoscalingv2beta1 "k8s.io/client-go/informers/autoscaling/v2beta1" - "github.com/knative/pkg/controller" - "github.com/knative/pkg/injection" - "github.com/knative/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/logging" ) func init() { @@ -44,7 +45,8 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { func Get(ctx context.Context) autoscalingv2beta1.HorizontalPodAutoscalerInformer { untyped := ctx.Value(Key{}) if untyped == nil { - return nil + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (autoscalingv2beta1.HorizontalPodAutoscalerInformer)(nil)) } return untyped.(autoscalingv2beta1.HorizontalPodAutoscalerInformer) } diff --git a/vendor/knative.dev/pkg/injection/informers/kubeinformers/batchv1/job/fake/fake.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/batchv1/job/fake/fake.go new file mode 100644 index 00000000..12bf7808 --- /dev/null +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/batchv1/job/fake/fake.go @@ -0,0 +1,38 @@ +/* +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 fake + +import ( + "context" + + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/batchv1/job" + "knative.dev/pkg/injection/informers/kubeinformers/factory/fake" +) + +var Get = job.Get + +func init() { + injection.Fake.RegisterInformer(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := fake.Get(ctx) + inf := f.Batch().V1().Jobs() + return context.WithValue(ctx, job.Key{}, inf), inf.Informer() +} diff --git a/vendor/knative.dev/pkg/injection/informers/kubeinformers/batchv1/job/job.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/batchv1/job/job.go new file mode 100644 index 00000000..926e945b --- /dev/null +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/batchv1/job/job.go @@ -0,0 +1,52 @@ +/* +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 job + +import ( + "context" + + batchv1 "k8s.io/client-go/informers/batch/v1" + + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterInformer(withInformer) +} + +// Key is used as the key for associating information +// with a context.Context. +type Key struct{} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := factory.Get(ctx) + inf := f.Batch().V1().Jobs() + return context.WithValue(ctx, Key{}, inf), inf.Informer() +} + +// Get extracts the Kubernetes Job informer from the context. +func Get(ctx context.Context) batchv1.JobInformer { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (batchv1.JobInformer)(nil)) + } + return untyped.(batchv1.JobInformer) +} diff --git a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/configmap/configmap.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/configmap/configmap.go similarity index 83% rename from vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/configmap/configmap.go rename to vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/configmap/configmap.go index cfd596ce..44394d83 100644 --- a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/configmap/configmap.go +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/configmap/configmap.go @@ -21,9 +21,10 @@ import ( corev1 "k8s.io/client-go/informers/core/v1" - "github.com/knative/pkg/controller" - "github.com/knative/pkg/injection" - "github.com/knative/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/logging" ) func init() { @@ -44,7 +45,8 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { func Get(ctx context.Context) corev1.ConfigMapInformer { untyped := ctx.Value(Key{}) if untyped == nil { - return nil + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (corev1.ConfigMapInformer)(nil)) } return untyped.(corev1.ConfigMapInformer) } diff --git a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/configmap/fake/fake.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/configmap/fake/fake.go similarity index 80% rename from vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/configmap/fake/fake.go rename to vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/configmap/fake/fake.go index 089cb95f..841b78ea 100644 --- a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/configmap/fake/fake.go +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/configmap/fake/fake.go @@ -19,10 +19,10 @@ package fake import ( "context" - "github.com/knative/pkg/controller" - "github.com/knative/pkg/injection" - "github.com/knative/pkg/injection/informers/kubeinformers/corev1/configmap" - "github.com/knative/pkg/injection/informers/kubeinformers/factory/fake" + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/corev1/configmap" + "knative.dev/pkg/injection/informers/kubeinformers/factory/fake" ) var Get = configmap.Get diff --git a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/endpoints/endpoints.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/endpoints/endpoints.go similarity index 83% rename from vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/endpoints/endpoints.go rename to vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/endpoints/endpoints.go index 27cc7a01..985261a9 100644 --- a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/endpoints/endpoints.go +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/endpoints/endpoints.go @@ -21,9 +21,10 @@ import ( corev1 "k8s.io/client-go/informers/core/v1" - "github.com/knative/pkg/controller" - "github.com/knative/pkg/injection" - "github.com/knative/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/logging" ) func init() { @@ -44,7 +45,8 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { func Get(ctx context.Context) corev1.EndpointsInformer { untyped := ctx.Value(Key{}) if untyped == nil { - return nil + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (corev1.EndpointsInformer)(nil)) } return untyped.(corev1.EndpointsInformer) } diff --git a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/endpoints/fake/fake.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/endpoints/fake/fake.go similarity index 80% rename from vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/endpoints/fake/fake.go rename to vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/endpoints/fake/fake.go index 2504c1bd..3c24196d 100644 --- a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/endpoints/fake/fake.go +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/endpoints/fake/fake.go @@ -19,10 +19,10 @@ package fake import ( "context" - "github.com/knative/pkg/controller" - "github.com/knative/pkg/injection" - "github.com/knative/pkg/injection/informers/kubeinformers/corev1/endpoints" - "github.com/knative/pkg/injection/informers/kubeinformers/factory/fake" + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/corev1/endpoints" + "knative.dev/pkg/injection/informers/kubeinformers/factory/fake" ) var Get = endpoints.Get diff --git a/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/namespace/fake/fake.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/namespace/fake/fake.go new file mode 100644 index 00000000..a13eed7a --- /dev/null +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/namespace/fake/fake.go @@ -0,0 +1,38 @@ +/* +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 fake + +import ( + "context" + + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/corev1/namespace" + "knative.dev/pkg/injection/informers/kubeinformers/factory/fake" +) + +var Get = namespace.Get + +func init() { + injection.Fake.RegisterInformer(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := fake.Get(ctx) + inf := f.Core().V1().Namespaces() + return context.WithValue(ctx, namespace.Key{}, inf), inf.Informer() +} diff --git a/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/namespace/namespace.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/namespace/namespace.go new file mode 100644 index 00000000..95ec1d60 --- /dev/null +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/namespace/namespace.go @@ -0,0 +1,52 @@ +/* +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 namespace + +import ( + "context" + + corev1 "k8s.io/client-go/informers/core/v1" + + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterInformer(withInformer) +} + +// Key is used as the key for associating information +// with a context.Context. +type Key struct{} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := factory.Get(ctx) + inf := f.Core().V1().Namespaces() + return context.WithValue(ctx, Key{}, inf), inf.Informer() +} + +// Get extracts the Kubernetes Namespace informer from the context. +func Get(ctx context.Context) corev1.NamespaceInformer { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (corev1.NamespaceInformer)(nil)) + } + return untyped.(corev1.NamespaceInformer) +} diff --git a/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/pod/fake/fake.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/pod/fake/fake.go new file mode 100644 index 00000000..36d9b7eb --- /dev/null +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/pod/fake/fake.go @@ -0,0 +1,38 @@ +/* +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 fake + +import ( + "context" + + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/corev1/pod" + "knative.dev/pkg/injection/informers/kubeinformers/factory/fake" +) + +var Get = pod.Get + +func init() { + injection.Fake.RegisterInformer(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := fake.Get(ctx) + inf := f.Core().V1().Pods() + return context.WithValue(ctx, pod.Key{}, inf), inf.Informer() +} diff --git a/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/pod/pod.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/pod/pod.go new file mode 100644 index 00000000..a454764e --- /dev/null +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/pod/pod.go @@ -0,0 +1,52 @@ +/* +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 pod + +import ( + "context" + + corev1 "k8s.io/client-go/informers/core/v1" + + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterInformer(withInformer) +} + +// Key is used as the key for associating information +// with a context.Context. +type Key struct{} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := factory.Get(ctx) + inf := f.Core().V1().Pods() + return context.WithValue(ctx, Key{}, inf), inf.Informer() +} + +// Get extracts the Kubernetes Pod informer from the context. +func Get(ctx context.Context) corev1.PodInformer { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (corev1.PodInformer)(nil)) + } + return untyped.(corev1.PodInformer) +} diff --git a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/secret/fake/fake.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/secret/fake/fake.go similarity index 80% rename from vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/secret/fake/fake.go rename to vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/secret/fake/fake.go index 37a4a515..6e01b5d0 100644 --- a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/secret/fake/fake.go +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/secret/fake/fake.go @@ -19,10 +19,10 @@ package fake import ( "context" - "github.com/knative/pkg/controller" - "github.com/knative/pkg/injection" - "github.com/knative/pkg/injection/informers/kubeinformers/corev1/secret" - "github.com/knative/pkg/injection/informers/kubeinformers/factory/fake" + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/corev1/secret" + "knative.dev/pkg/injection/informers/kubeinformers/factory/fake" ) var Get = secret.Get diff --git a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/secret/secret.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/secret/secret.go similarity index 83% rename from vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/secret/secret.go rename to vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/secret/secret.go index 249f9d90..7c6efe0f 100644 --- a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/secret/secret.go +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/secret/secret.go @@ -21,9 +21,10 @@ import ( corev1 "k8s.io/client-go/informers/core/v1" - "github.com/knative/pkg/controller" - "github.com/knative/pkg/injection" - "github.com/knative/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/logging" ) func init() { @@ -44,7 +45,8 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { func Get(ctx context.Context) corev1.SecretInformer { untyped := ctx.Value(Key{}) if untyped == nil { - return nil + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (corev1.SecretInformer)(nil)) } return untyped.(corev1.SecretInformer) } diff --git a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/service/fake/fake.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/service/fake/fake.go similarity index 80% rename from vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/service/fake/fake.go rename to vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/service/fake/fake.go index 8c52d19a..449843c3 100644 --- a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/service/fake/fake.go +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/service/fake/fake.go @@ -19,10 +19,10 @@ package fake import ( "context" - "github.com/knative/pkg/controller" - "github.com/knative/pkg/injection" - "github.com/knative/pkg/injection/informers/kubeinformers/corev1/service" - "github.com/knative/pkg/injection/informers/kubeinformers/factory/fake" + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/corev1/service" + "knative.dev/pkg/injection/informers/kubeinformers/factory/fake" ) var Get = service.Get diff --git a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/service/service.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/service/service.go similarity index 83% rename from vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/service/service.go rename to vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/service/service.go index bae64aa4..946123d2 100644 --- a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/corev1/service/service.go +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/service/service.go @@ -21,9 +21,10 @@ import ( corev1 "k8s.io/client-go/informers/core/v1" - "github.com/knative/pkg/controller" - "github.com/knative/pkg/injection" - "github.com/knative/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/logging" ) func init() { @@ -44,7 +45,8 @@ func withInformer(ctx context.Context) (context.Context, controller.Informer) { func Get(ctx context.Context) corev1.ServiceInformer { untyped := ctx.Value(Key{}) if untyped == nil { - return nil + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (corev1.ServiceInformer)(nil)) } return untyped.(corev1.ServiceInformer) } diff --git a/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/serviceaccount/fake/fake.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/serviceaccount/fake/fake.go new file mode 100644 index 00000000..ef1456d3 --- /dev/null +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/serviceaccount/fake/fake.go @@ -0,0 +1,38 @@ +/* +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 fake + +import ( + "context" + + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/corev1/serviceaccount" + "knative.dev/pkg/injection/informers/kubeinformers/factory/fake" +) + +var Get = serviceaccount.Get + +func init() { + injection.Fake.RegisterInformer(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := fake.Get(ctx) + inf := f.Core().V1().ServiceAccounts() + return context.WithValue(ctx, serviceaccount.Key{}, inf), inf.Informer() +} diff --git a/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/serviceaccount/service.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/serviceaccount/service.go new file mode 100644 index 00000000..f9925011 --- /dev/null +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/corev1/serviceaccount/service.go @@ -0,0 +1,52 @@ +/* +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 serviceaccount + +import ( + "context" + + corev1 "k8s.io/client-go/informers/core/v1" + + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterInformer(withInformer) +} + +// Key is used as the key for associating information +// with a context.Context. +type Key struct{} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := factory.Get(ctx) + inf := f.Core().V1().ServiceAccounts() + return context.WithValue(ctx, Key{}, inf), inf.Informer() +} + +// Get extracts the Kubernetes Service Account informer from the context. +func Get(ctx context.Context) corev1.ServiceAccountInformer { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (corev1.ServiceAccountInformer)(nil)) + } + return untyped.(corev1.ServiceAccountInformer) +} diff --git a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/factory/factory.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/factory/factory.go similarity index 83% rename from vendor/github.com/knative/pkg/injection/informers/kubeinformers/factory/factory.go rename to vendor/knative.dev/pkg/injection/informers/kubeinformers/factory/factory.go index b3a93233..a72408be 100644 --- a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/factory/factory.go +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/factory/factory.go @@ -21,9 +21,10 @@ import ( "k8s.io/client-go/informers" - "github.com/knative/pkg/controller" - "github.com/knative/pkg/injection" - "github.com/knative/pkg/injection/clients/kubeclient" + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/clients/kubeclient" + "knative.dev/pkg/logging" ) func init() { @@ -44,7 +45,8 @@ func withInformerFactory(ctx context.Context) context.Context { func Get(ctx context.Context) informers.SharedInformerFactory { untyped := ctx.Value(Key{}) if untyped == nil { - return nil + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (informers.SharedInformerFactory)(nil)) } return untyped.(informers.SharedInformerFactory) } diff --git a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/factory/fake/fake.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/factory/fake/fake.go similarity index 82% rename from vendor/github.com/knative/pkg/injection/informers/kubeinformers/factory/fake/fake.go rename to vendor/knative.dev/pkg/injection/informers/kubeinformers/factory/fake/fake.go index 7588aec5..1432c6b6 100644 --- a/vendor/github.com/knative/pkg/injection/informers/kubeinformers/factory/fake/fake.go +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/factory/fake/fake.go @@ -21,10 +21,10 @@ import ( "k8s.io/client-go/informers" - "github.com/knative/pkg/controller" - "github.com/knative/pkg/injection" - "github.com/knative/pkg/injection/clients/kubeclient/fake" - "github.com/knative/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/clients/kubeclient/fake" + "knative.dev/pkg/injection/informers/kubeinformers/factory" ) var Get = factory.Get diff --git a/vendor/knative.dev/pkg/injection/informers/kubeinformers/rbacv1/role/fake/fake.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/rbacv1/role/fake/fake.go new file mode 100644 index 00000000..3171ad0b --- /dev/null +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/rbacv1/role/fake/fake.go @@ -0,0 +1,38 @@ +/* +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 fake + +import ( + "context" + + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/factory/fake" + "knative.dev/pkg/injection/informers/kubeinformers/rbacv1/role" +) + +var Get = role.Get + +func init() { + injection.Fake.RegisterInformer(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := fake.Get(ctx) + inf := f.Rbac().V1().Roles() + return context.WithValue(ctx, role.Key{}, inf), inf.Informer() +} diff --git a/vendor/knative.dev/pkg/injection/informers/kubeinformers/rbacv1/role/role.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/rbacv1/role/role.go new file mode 100644 index 00000000..a074d656 --- /dev/null +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/rbacv1/role/role.go @@ -0,0 +1,52 @@ +/* +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 role + +import ( + "context" + + rbacv1 "k8s.io/client-go/informers/rbac/v1" + + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterInformer(withInformer) +} + +// Key is used as the key for associating information +// with a context.Context. +type Key struct{} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := factory.Get(ctx) + inf := f.Rbac().V1().Roles() + return context.WithValue(ctx, Key{}, inf), inf.Informer() +} + +// Get extracts the Kubernetes Role Binding informer from the context. +func Get(ctx context.Context) rbacv1.RoleInformer { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (rbacv1.RoleInformer)(nil)) + } + return untyped.(rbacv1.RoleInformer) +} diff --git a/vendor/knative.dev/pkg/injection/informers/kubeinformers/rbacv1/rolebinding/fake/fake.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/rbacv1/rolebinding/fake/fake.go new file mode 100644 index 00000000..7c1ee8a8 --- /dev/null +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/rbacv1/rolebinding/fake/fake.go @@ -0,0 +1,38 @@ +/* +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 fake + +import ( + "context" + + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/factory/fake" + "knative.dev/pkg/injection/informers/kubeinformers/rbacv1/rolebinding" +) + +var Get = rolebinding.Get + +func init() { + injection.Fake.RegisterInformer(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := fake.Get(ctx) + inf := f.Rbac().V1().RoleBindings() + return context.WithValue(ctx, rolebinding.Key{}, inf), inf.Informer() +} diff --git a/vendor/knative.dev/pkg/injection/informers/kubeinformers/rbacv1/rolebinding/rolebinding.go b/vendor/knative.dev/pkg/injection/informers/kubeinformers/rbacv1/rolebinding/rolebinding.go new file mode 100644 index 00000000..f740b64a --- /dev/null +++ b/vendor/knative.dev/pkg/injection/informers/kubeinformers/rbacv1/rolebinding/rolebinding.go @@ -0,0 +1,52 @@ +/* +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 rolebinding + +import ( + "context" + + rbacv1 "k8s.io/client-go/informers/rbac/v1" + + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/informers/kubeinformers/factory" + "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterInformer(withInformer) +} + +// Key is used as the key for associating information +// with a context.Context. +type Key struct{} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := factory.Get(ctx) + inf := f.Rbac().V1().RoleBindings() + return context.WithValue(ctx, Key{}, inf), inf.Informer() +} + +// Get extracts the Kubernetes Role Binding informer from the context. +func Get(ctx context.Context) rbacv1.RoleBindingInformer { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch %T from context.", (rbacv1.RoleBindingInformer)(nil)) + } + return untyped.(rbacv1.RoleBindingInformer) +} diff --git a/vendor/github.com/knative/pkg/injection/interface.go b/vendor/knative.dev/pkg/injection/interface.go similarity index 83% rename from vendor/github.com/knative/pkg/injection/interface.go rename to vendor/knative.dev/pkg/injection/interface.go index 6a0df357..bf6e7eef 100644 --- a/vendor/github.com/knative/pkg/injection/interface.go +++ b/vendor/knative.dev/pkg/injection/interface.go @@ -22,7 +22,8 @@ import ( "k8s.io/client-go/rest" - "github.com/knative/pkg/controller" + "knative.dev/pkg/configmap" + "knative.dev/pkg/controller" ) // Interface is the interface for interacting with injection @@ -54,17 +55,11 @@ type Interface interface { // along with a list of the .Informer() for each of the injected informers, // which is suitable for passing to controller.StartInformers(). // This does not setup or start any controllers. - // TODO(mattmoor): Consider setting up and starting controllers? SetupInformers(context.Context, *rest.Config) (context.Context, []controller.Informer) - - // RegisterController registers a new injector callback for associating - // a new controller with a context. - RegisterController(ControllerInjector) - - // GetControllers fetches all of the registered controller injectors. - GetControllers() []ControllerInjector } +type ControllerConstructor func(context.Context, configmap.Watcher) *controller.Impl + var ( // Check that impl implements Interface _ Interface = (*impl)(nil) @@ -83,8 +78,7 @@ var ( type impl struct { m sync.RWMutex - clients []ClientInjector - factories []InformerFactoryInjector - informers []InformerInjector - controllers []ControllerInjector + clients []ClientInjector + factories []InformerFactoryInjector + informers []InformerInjector } diff --git a/vendor/github.com/knative/pkg/injection/sharedmain/main.go b/vendor/knative.dev/pkg/injection/sharedmain/main.go similarity index 74% rename from vendor/github.com/knative/pkg/injection/sharedmain/main.go rename to vendor/knative.dev/pkg/injection/sharedmain/main.go index 8463a5b6..677176c7 100644 --- a/vendor/github.com/knative/pkg/injection/sharedmain/main.go +++ b/vendor/knative.dev/pkg/injection/sharedmain/main.go @@ -24,31 +24,23 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" - // Uncomment the following line to load the gcp plugin (only required to authenticate against GKE clusters). - _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" - - "github.com/knative/pkg/configmap" - "github.com/knative/pkg/controller" - "github.com/knative/pkg/injection" - "github.com/knative/pkg/injection/clients/kubeclient" - "github.com/knative/pkg/logging" - "github.com/knative/pkg/metrics" - "github.com/knative/pkg/signals" - "github.com/knative/pkg/system" + "knative.dev/pkg/configmap" + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + "knative.dev/pkg/injection/clients/kubeclient" + "knative.dev/pkg/logging" + "knative.dev/pkg/metrics" + "knative.dev/pkg/signals" + "knative.dev/pkg/system" "go.uber.org/zap" ) -func Main() { - // The default component name is "controller" - MainWithComponent("controller") -} - -func MainWithComponent(component string) { +func Main(component string, ctors ...injection.ControllerConstructor) { // Set up signals so we handle the first shutdown signal gracefully. - MainWithContext(signals.NewContext(), component) + MainWithContext(signals.NewContext(), component, ctors...) } -func MainWithContext(ctx context.Context, component string) { +func MainWithContext(ctx context.Context, component string, ctors ...injection.ControllerConstructor) { var ( masterURL = flag.String("master", "", "The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster.") kubeconfig = flag.String("kubeconfig", "", "Path to a kubeconfig. Only required if out-of-cluster.") @@ -59,10 +51,10 @@ func MainWithContext(ctx context.Context, component string) { if err != nil { log.Fatal("Error building kubeconfig", err) } - MainWithConfig(ctx, component, cfg) + MainWithConfig(ctx, component, cfg, ctors...) } -func MainWithConfig(ctx context.Context, component string, cfg *rest.Config) { +func MainWithConfig(ctx context.Context, component string, cfg *rest.Config, ctors ...injection.ControllerConstructor) { // Set up our logger. loggingConfigMap, err := configmap.Load("/etc/config-logging") if err != nil { @@ -79,11 +71,11 @@ func MainWithConfig(ctx context.Context, component string, cfg *rest.Config) { logger.Infof("Registering %d clients", len(injection.Default.GetClients())) logger.Infof("Registering %d informer factories", len(injection.Default.GetInformerFactories())) logger.Infof("Registering %d informers", len(injection.Default.GetInformers())) - logger.Infof("Registering %d controllers", len(injection.Default.GetControllers())) + logger.Infof("Registering %d controllers", len(ctors)) // Adjust our client's rate limits based on the number of controller's we are running. - cfg.QPS = float32(len(injection.Default.GetControllers())) * rest.DefaultQPS - cfg.Burst = len(injection.Default.GetControllers()) * rest.DefaultBurst + cfg.QPS = float32(len(ctors)) * rest.DefaultQPS + cfg.Burst = len(ctors) * rest.DefaultBurst ctx, informers := injection.Default.SetupInformers(ctx, cfg) @@ -91,8 +83,8 @@ func MainWithConfig(ctx context.Context, component string, cfg *rest.Config) { cmw := configmap.NewInformedWatcher(kubeclient.Get(ctx), system.Namespace()) // Based on the reconcilers we have linked, build up the set of controllers to run. - controllers := make([]*controller.Impl, 0, len(injection.Default.GetControllers())) - for _, cf := range injection.Default.GetControllers() { + controllers := make([]*controller.Impl, 0, len(ctors)) + for _, cf := range ctors { controllers = append(controllers, cf(ctx, cmw)) } diff --git a/vendor/github.com/knative/pkg/kmeta/accessor.go b/vendor/knative.dev/pkg/kmeta/accessor.go similarity index 100% rename from vendor/github.com/knative/pkg/kmeta/accessor.go rename to vendor/knative.dev/pkg/kmeta/accessor.go diff --git a/vendor/github.com/knative/pkg/kmeta/doc.go b/vendor/knative.dev/pkg/kmeta/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/kmeta/doc.go rename to vendor/knative.dev/pkg/kmeta/doc.go diff --git a/vendor/github.com/knative/pkg/kmeta/labels.go b/vendor/knative.dev/pkg/kmeta/labels.go similarity index 100% rename from vendor/github.com/knative/pkg/kmeta/labels.go rename to vendor/knative.dev/pkg/kmeta/labels.go diff --git a/vendor/knative.dev/pkg/kmeta/names.go b/vendor/knative.dev/pkg/kmeta/names.go new file mode 100644 index 00000000..1efa7108 --- /dev/null +++ b/vendor/knative.dev/pkg/kmeta/names.go @@ -0,0 +1,41 @@ +/* +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 kmeta + +import ( + "crypto/md5" + "fmt" +) + +// The longest name supported by the K8s is 63. +// These constants +const ( + longest = 63 + md5Len = 32 + head = longest - md5Len +) + +// ChildName generates a name for the resource based upong the parent resource and suffix. +// If the concatenated name is longer than K8s permits the name is hashed and truncated to permit +// construction of the resource, but still keeps it unique. +func ChildName(parent, suffix string) string { + n := parent + if len(parent) > (longest - len(suffix)) { + n = fmt.Sprintf("%s%x", parent[:head-len(suffix)], md5.Sum([]byte(parent))) + } + return n + suffix +} diff --git a/vendor/github.com/knative/pkg/kmeta/owner_references.go b/vendor/knative.dev/pkg/kmeta/owner_references.go similarity index 100% rename from vendor/github.com/knative/pkg/kmeta/owner_references.go rename to vendor/knative.dev/pkg/kmeta/owner_references.go diff --git a/vendor/github.com/knative/pkg/kmp/diff.go b/vendor/knative.dev/pkg/kmp/diff.go similarity index 100% rename from vendor/github.com/knative/pkg/kmp/diff.go rename to vendor/knative.dev/pkg/kmp/diff.go diff --git a/vendor/github.com/knative/pkg/kmp/doc.go b/vendor/knative.dev/pkg/kmp/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/kmp/doc.go rename to vendor/knative.dev/pkg/kmp/doc.go diff --git a/vendor/github.com/knative/pkg/kmp/reporters.go b/vendor/knative.dev/pkg/kmp/reporters.go similarity index 100% rename from vendor/github.com/knative/pkg/kmp/reporters.go rename to vendor/knative.dev/pkg/kmp/reporters.go diff --git a/vendor/github.com/knative/pkg/logging/config.go b/vendor/knative.dev/pkg/logging/config.go similarity index 98% rename from vendor/github.com/knative/pkg/logging/config.go rename to vendor/knative.dev/pkg/logging/config.go index 236a4498..1a658fdc 100644 --- a/vendor/github.com/knative/pkg/logging/config.go +++ b/vendor/knative.dev/pkg/logging/config.go @@ -27,8 +27,8 @@ import ( "go.uber.org/zap/zapcore" corev1 "k8s.io/api/core/v1" - "github.com/knative/pkg/changeset" - "github.com/knative/pkg/logging/logkey" + "knative.dev/pkg/changeset" + "knative.dev/pkg/logging/logkey" ) const ConfigMapNameEnv = "CONFIG_LOGGING_NAME" diff --git a/vendor/github.com/knative/pkg/logging/logger.go b/vendor/knative.dev/pkg/logging/logger.go similarity index 100% rename from vendor/github.com/knative/pkg/logging/logger.go rename to vendor/knative.dev/pkg/logging/logger.go diff --git a/vendor/github.com/knative/pkg/logging/logkey/constants.go b/vendor/knative.dev/pkg/logging/logkey/constants.go similarity index 100% rename from vendor/github.com/knative/pkg/logging/logkey/constants.go rename to vendor/knative.dev/pkg/logging/logkey/constants.go diff --git a/vendor/github.com/knative/pkg/logging/testing/util.go b/vendor/knative.dev/pkg/logging/testing/util.go similarity index 97% rename from vendor/github.com/knative/pkg/logging/testing/util.go rename to vendor/knative.dev/pkg/logging/testing/util.go index 05179648..29daf993 100644 --- a/vendor/github.com/knative/pkg/logging/testing/util.go +++ b/vendor/knative.dev/pkg/logging/testing/util.go @@ -24,7 +24,7 @@ import ( "go.uber.org/zap" "go.uber.org/zap/zaptest" - "github.com/knative/pkg/logging" + "knative.dev/pkg/logging" ) var ( diff --git a/vendor/github.com/knative/pkg/logging/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/logging/zz_generated.deepcopy.go similarity index 100% rename from vendor/github.com/knative/pkg/logging/zz_generated.deepcopy.go rename to vendor/knative.dev/pkg/logging/zz_generated.deepcopy.go diff --git a/vendor/github.com/knative/pkg/metrics/config.go b/vendor/knative.dev/pkg/metrics/config.go similarity index 99% rename from vendor/github.com/knative/pkg/metrics/config.go rename to vendor/knative.dev/pkg/metrics/config.go index cdce9b53..627e064a 100644 --- a/vendor/github.com/knative/pkg/metrics/config.go +++ b/vendor/knative.dev/pkg/metrics/config.go @@ -288,6 +288,6 @@ If this is a Go unit test consuming metric.Domain() then it should add the following import: import ( - _ "github.com/knative/pkg/metrics/testing" + _ "knative.dev/pkg/metrics/testing" )`, DomainEnv, DomainEnv)) } diff --git a/vendor/github.com/knative/pkg/metrics/doc.go b/vendor/knative.dev/pkg/metrics/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/metrics/doc.go rename to vendor/knative.dev/pkg/metrics/doc.go diff --git a/vendor/github.com/knative/pkg/metrics/exporter.go b/vendor/knative.dev/pkg/metrics/exporter.go similarity index 100% rename from vendor/github.com/knative/pkg/metrics/exporter.go rename to vendor/knative.dev/pkg/metrics/exporter.go diff --git a/vendor/github.com/knative/pkg/metrics/gcp_metadata.go b/vendor/knative.dev/pkg/metrics/gcp_metadata.go similarity index 91% rename from vendor/github.com/knative/pkg/metrics/gcp_metadata.go rename to vendor/knative.dev/pkg/metrics/gcp_metadata.go index ed64fb73..5f33e3ea 100644 --- a/vendor/github.com/knative/pkg/metrics/gcp_metadata.go +++ b/vendor/knative.dev/pkg/metrics/gcp_metadata.go @@ -15,7 +15,7 @@ package metrics import ( "cloud.google.com/go/compute/metadata" - "github.com/knative/pkg/metrics/metricskey" + "knative.dev/pkg/metrics/metricskey" ) func retrieveGCPMetadata() *gcpMetadata { @@ -28,7 +28,7 @@ func retrieveGCPMetadata() *gcpMetadata { if err == nil && project != "" { gm.project = project } - location, err := metadata.Zone() + location, err := metadata.InstanceAttributeValue("cluster-location") if err == nil && location != "" { gm.location = location } diff --git a/vendor/github.com/knative/pkg/metrics/metricskey/constants.go b/vendor/knative.dev/pkg/metrics/metricskey/constants.go similarity index 100% rename from vendor/github.com/knative/pkg/metrics/metricskey/constants.go rename to vendor/knative.dev/pkg/metrics/metricskey/constants.go diff --git a/vendor/github.com/knative/pkg/metrics/monitored_resources.go b/vendor/knative.dev/pkg/metrics/monitored_resources.go similarity index 97% rename from vendor/github.com/knative/pkg/metrics/monitored_resources.go rename to vendor/knative.dev/pkg/metrics/monitored_resources.go index 295fb778..d8ab5d87 100644 --- a/vendor/github.com/knative/pkg/metrics/monitored_resources.go +++ b/vendor/knative.dev/pkg/metrics/monitored_resources.go @@ -14,7 +14,7 @@ limitations under the License. package metrics import ( - "github.com/knative/pkg/metrics/metricskey" + "knative.dev/pkg/metrics/metricskey" ) type gcpMetadata struct { diff --git a/vendor/github.com/knative/pkg/metrics/prometheus_exporter.go b/vendor/knative.dev/pkg/metrics/prometheus_exporter.go similarity index 100% rename from vendor/github.com/knative/pkg/metrics/prometheus_exporter.go rename to vendor/knative.dev/pkg/metrics/prometheus_exporter.go diff --git a/vendor/github.com/knative/pkg/metrics/record.go b/vendor/knative.dev/pkg/metrics/record.go similarity index 97% rename from vendor/github.com/knative/pkg/metrics/record.go rename to vendor/knative.dev/pkg/metrics/record.go index 98a007cf..6a35394f 100644 --- a/vendor/github.com/knative/pkg/metrics/record.go +++ b/vendor/knative.dev/pkg/metrics/record.go @@ -20,7 +20,7 @@ import ( "context" "path" - "github.com/knative/pkg/metrics/metricskey" + "knative.dev/pkg/metrics/metricskey" "go.opencensus.io/stats" ) diff --git a/vendor/github.com/knative/pkg/metrics/stackdriver_exporter.go b/vendor/knative.dev/pkg/metrics/stackdriver_exporter.go similarity index 99% rename from vendor/github.com/knative/pkg/metrics/stackdriver_exporter.go rename to vendor/knative.dev/pkg/metrics/stackdriver_exporter.go index 60bf1d5f..2275a57e 100644 --- a/vendor/github.com/knative/pkg/metrics/stackdriver_exporter.go +++ b/vendor/knative.dev/pkg/metrics/stackdriver_exporter.go @@ -18,7 +18,7 @@ import ( "contrib.go.opencensus.io/exporter/stackdriver" "contrib.go.opencensus.io/exporter/stackdriver/monitoredresource" - "github.com/knative/pkg/metrics/metricskey" + "knative.dev/pkg/metrics/metricskey" "go.opencensus.io/stats/view" "go.opencensus.io/tag" "go.uber.org/zap" diff --git a/vendor/github.com/knative/pkg/metrics/testing/config.go b/vendor/knative.dev/pkg/metrics/testing/config.go similarity index 95% rename from vendor/github.com/knative/pkg/metrics/testing/config.go rename to vendor/knative.dev/pkg/metrics/testing/config.go index 5b19816d..a0932f00 100644 --- a/vendor/github.com/knative/pkg/metrics/testing/config.go +++ b/vendor/knative.dev/pkg/metrics/testing/config.go @@ -19,7 +19,7 @@ package testing import ( "os" - "github.com/knative/pkg/metrics" + "knative.dev/pkg/metrics" ) func init() { diff --git a/vendor/github.com/knative/pkg/ptr/doc.go b/vendor/knative.dev/pkg/ptr/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/ptr/doc.go rename to vendor/knative.dev/pkg/ptr/doc.go diff --git a/vendor/github.com/knative/pkg/ptr/ptr.go b/vendor/knative.dev/pkg/ptr/ptr.go similarity index 100% rename from vendor/github.com/knative/pkg/ptr/ptr.go rename to vendor/knative.dev/pkg/ptr/ptr.go diff --git a/vendor/github.com/knative/pkg/reconciler/testing/actions.go b/vendor/knative.dev/pkg/reconciler/testing/actions.go similarity index 100% rename from vendor/github.com/knative/pkg/reconciler/testing/actions.go rename to vendor/knative.dev/pkg/reconciler/testing/actions.go diff --git a/vendor/github.com/knative/pkg/reconciler/testing/clock.go b/vendor/knative.dev/pkg/reconciler/testing/clock.go similarity index 100% rename from vendor/github.com/knative/pkg/reconciler/testing/clock.go rename to vendor/knative.dev/pkg/reconciler/testing/clock.go diff --git a/vendor/knative.dev/pkg/reconciler/testing/context.go b/vendor/knative.dev/pkg/reconciler/testing/context.go new file mode 100644 index 00000000..723c87ef --- /dev/null +++ b/vendor/knative.dev/pkg/reconciler/testing/context.go @@ -0,0 +1,35 @@ +/* +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" + "testing" + + "k8s.io/client-go/rest" + "k8s.io/client-go/tools/record" + + "knative.dev/pkg/controller" + "knative.dev/pkg/injection" + logtesting "knative.dev/pkg/logging/testing" +) + +func SetupFakeContext(t *testing.T) (context.Context, []controller.Informer) { + ctx := logtesting.TestContextWithLogger(t) + ctx = controller.WithEventRecorder(ctx, record.NewFakeRecorder(1000)) + return injection.Fake.SetupInformers(ctx, &rest.Config{}) +} diff --git a/vendor/github.com/knative/pkg/reconciler/testing/events.go b/vendor/knative.dev/pkg/reconciler/testing/events.go similarity index 100% rename from vendor/github.com/knative/pkg/reconciler/testing/events.go rename to vendor/knative.dev/pkg/reconciler/testing/events.go diff --git a/vendor/github.com/knative/pkg/reconciler/testing/generate_name_reactor.go b/vendor/knative.dev/pkg/reconciler/testing/generate_name_reactor.go similarity index 100% rename from vendor/github.com/knative/pkg/reconciler/testing/generate_name_reactor.go rename to vendor/knative.dev/pkg/reconciler/testing/generate_name_reactor.go diff --git a/vendor/github.com/knative/pkg/reconciler/testing/hooks.go b/vendor/knative.dev/pkg/reconciler/testing/hooks.go similarity index 100% rename from vendor/github.com/knative/pkg/reconciler/testing/hooks.go rename to vendor/knative.dev/pkg/reconciler/testing/hooks.go diff --git a/vendor/github.com/knative/pkg/reconciler/testing/reactions.go b/vendor/knative.dev/pkg/reconciler/testing/reactions.go similarity index 98% rename from vendor/github.com/knative/pkg/reconciler/testing/reactions.go rename to vendor/knative.dev/pkg/reconciler/testing/reactions.go index 9ce0e404..09caae76 100644 --- a/vendor/github.com/knative/pkg/reconciler/testing/reactions.go +++ b/vendor/knative.dev/pkg/reconciler/testing/reactions.go @@ -23,7 +23,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" clientgotesting "k8s.io/client-go/testing" - "github.com/knative/pkg/apis" + "knative.dev/pkg/apis" ) // InduceFailure is used in conjunction with TableTest's WithReactors field. diff --git a/vendor/github.com/knative/pkg/reconciler/testing/sorter.go b/vendor/knative.dev/pkg/reconciler/testing/sorter.go similarity index 100% rename from vendor/github.com/knative/pkg/reconciler/testing/sorter.go rename to vendor/knative.dev/pkg/reconciler/testing/sorter.go diff --git a/vendor/github.com/knative/pkg/reconciler/testing/stats.go b/vendor/knative.dev/pkg/reconciler/testing/stats.go similarity index 100% rename from vendor/github.com/knative/pkg/reconciler/testing/stats.go rename to vendor/knative.dev/pkg/reconciler/testing/stats.go diff --git a/vendor/github.com/knative/pkg/reconciler/testing/table.go b/vendor/knative.dev/pkg/reconciler/testing/table.go similarity index 98% rename from vendor/github.com/knative/pkg/reconciler/testing/table.go rename to vendor/knative.dev/pkg/reconciler/testing/table.go index 2d445cd0..0cf5b729 100644 --- a/vendor/github.com/knative/pkg/reconciler/testing/table.go +++ b/vendor/knative.dev/pkg/reconciler/testing/table.go @@ -25,9 +25,9 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/knative/pkg/controller" - "github.com/knative/pkg/kmeta" - _ "github.com/knative/pkg/system/testing" // Setup system.Namespace() + "knative.dev/pkg/controller" + "knative.dev/pkg/kmeta" + _ "knative.dev/pkg/system/testing" // Setup system.Namespace() "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/runtime" clientgotesting "k8s.io/client-go/testing" diff --git a/vendor/github.com/knative/pkg/reconciler/testing/tracker.go b/vendor/knative.dev/pkg/reconciler/testing/tracker.go similarity index 96% rename from vendor/github.com/knative/pkg/reconciler/testing/tracker.go rename to vendor/knative.dev/pkg/reconciler/testing/tracker.go index 893ba86a..48059893 100644 --- a/vendor/github.com/knative/pkg/reconciler/testing/tracker.go +++ b/vendor/knative.dev/pkg/reconciler/testing/tracker.go @@ -19,7 +19,7 @@ package testing import ( corev1 "k8s.io/api/core/v1" - "github.com/knative/pkg/tracker" + "knative.dev/pkg/tracker" ) // NullTracker implements Tracker. diff --git a/vendor/github.com/knative/pkg/reconciler/testing/util.go b/vendor/knative.dev/pkg/reconciler/testing/util.go similarity index 100% rename from vendor/github.com/knative/pkg/reconciler/testing/util.go rename to vendor/knative.dev/pkg/reconciler/testing/util.go diff --git a/vendor/github.com/knative/pkg/signals/signal.go b/vendor/knative.dev/pkg/signals/signal.go similarity index 100% rename from vendor/github.com/knative/pkg/signals/signal.go rename to vendor/knative.dev/pkg/signals/signal.go diff --git a/vendor/github.com/knative/pkg/signals/signal_posix.go b/vendor/knative.dev/pkg/signals/signal_posix.go similarity index 100% rename from vendor/github.com/knative/pkg/signals/signal_posix.go rename to vendor/knative.dev/pkg/signals/signal_posix.go diff --git a/vendor/github.com/knative/pkg/signals/signal_windows.go b/vendor/knative.dev/pkg/signals/signal_windows.go similarity index 100% rename from vendor/github.com/knative/pkg/signals/signal_windows.go rename to vendor/knative.dev/pkg/signals/signal_windows.go diff --git a/vendor/github.com/knative/pkg/system/clock.go b/vendor/knative.dev/pkg/system/clock.go similarity index 100% rename from vendor/github.com/knative/pkg/system/clock.go rename to vendor/knative.dev/pkg/system/clock.go diff --git a/vendor/github.com/knative/pkg/system/names.go b/vendor/knative.dev/pkg/system/names.go similarity index 96% rename from vendor/github.com/knative/pkg/system/names.go rename to vendor/knative.dev/pkg/system/names.go index fdd6a576..13a07c8e 100644 --- a/vendor/github.com/knative/pkg/system/names.go +++ b/vendor/knative.dev/pkg/system/names.go @@ -47,6 +47,6 @@ If this is a Go unit test consuming system.Namespace() then it should add the following import: import ( - _ "github.com/knative/pkg/system/testing" + _ "knative.dev/pkg/system/testing" )`, NamespaceEnvKey, NamespaceEnvKey)) } diff --git a/vendor/github.com/knative/pkg/system/testing/names.go b/vendor/knative.dev/pkg/system/testing/names.go similarity index 95% rename from vendor/github.com/knative/pkg/system/testing/names.go rename to vendor/knative.dev/pkg/system/testing/names.go index ac4945a9..6f674f16 100644 --- a/vendor/github.com/knative/pkg/system/testing/names.go +++ b/vendor/knative.dev/pkg/system/testing/names.go @@ -19,7 +19,7 @@ package testing import ( "os" - "github.com/knative/pkg/system" + "knative.dev/pkg/system" ) func init() { diff --git a/vendor/github.com/knative/pkg/test/README.md b/vendor/knative.dev/pkg/test/README.md similarity index 100% rename from vendor/github.com/knative/pkg/test/README.md rename to vendor/knative.dev/pkg/test/README.md diff --git a/vendor/github.com/knative/pkg/test/cleanup.go b/vendor/knative.dev/pkg/test/cleanup.go similarity index 96% rename from vendor/github.com/knative/pkg/test/cleanup.go rename to vendor/knative.dev/pkg/test/cleanup.go index aa2c860f..b3491726 100644 --- a/vendor/github.com/knative/pkg/test/cleanup.go +++ b/vendor/knative.dev/pkg/test/cleanup.go @@ -23,7 +23,7 @@ import ( "os" "os/signal" - "github.com/knative/pkg/test/logging" + "knative.dev/pkg/test/logging" ) // CleanupOnInterrupt will execute the function cleanup if an interrupt signal is caught diff --git a/vendor/github.com/knative/pkg/test/clients.go b/vendor/knative.dev/pkg/test/clients.go similarity index 98% rename from vendor/github.com/knative/pkg/test/clients.go rename to vendor/knative.dev/pkg/test/clients.go index fbd9e658..44f7532f 100644 --- a/vendor/github.com/knative/pkg/test/clients.go +++ b/vendor/knative.dev/pkg/test/clients.go @@ -22,8 +22,8 @@ import ( "fmt" "strings" - "github.com/knative/pkg/test/logging" - "github.com/knative/pkg/test/spoof" + "knative.dev/pkg/test/logging" + "knative.dev/pkg/test/spoof" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" diff --git a/vendor/github.com/knative/pkg/test/crd.go b/vendor/knative.dev/pkg/test/crd.go similarity index 100% rename from vendor/github.com/knative/pkg/test/crd.go rename to vendor/knative.dev/pkg/test/crd.go diff --git a/vendor/github.com/knative/pkg/test/e2e_flags.go b/vendor/knative.dev/pkg/test/e2e_flags.go similarity index 100% rename from vendor/github.com/knative/pkg/test/e2e_flags.go rename to vendor/knative.dev/pkg/test/e2e_flags.go diff --git a/vendor/github.com/knative/pkg/test/helpers/data.go b/vendor/knative.dev/pkg/test/helpers/data.go similarity index 100% rename from vendor/github.com/knative/pkg/test/helpers/data.go rename to vendor/knative.dev/pkg/test/helpers/data.go diff --git a/vendor/knative.dev/pkg/test/helpers/name.go b/vendor/knative.dev/pkg/test/helpers/name.go new file mode 100644 index 00000000..50ad03a8 --- /dev/null +++ b/vendor/knative.dev/pkg/test/helpers/name.go @@ -0,0 +1,36 @@ +/* +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 helpers + +import ( + "strings" + "testing" +) + +const ( + testNamePrefix = "Test" +) + +// ObjectPrefixForTest returns the name prefix for this test's random names. +func ObjectPrefixForTest(t *testing.T) string { + return MakeK8sNamePrefix(strings.TrimPrefix(t.Name(), testNamePrefix)) +} + +// ObjectNameForTest generates a random object name based on the test name. +func ObjectNameForTest(t *testing.T) string { + return AppendRandomString(ObjectPrefixForTest(t)) +} diff --git a/vendor/github.com/knative/pkg/test/ingress/ingress.go b/vendor/knative.dev/pkg/test/ingress/ingress.go similarity index 100% rename from vendor/github.com/knative/pkg/test/ingress/ingress.go rename to vendor/knative.dev/pkg/test/ingress/ingress.go diff --git a/vendor/github.com/knative/pkg/test/kube_checks.go b/vendor/knative.dev/pkg/test/kube_checks.go similarity index 99% rename from vendor/github.com/knative/pkg/test/kube_checks.go rename to vendor/knative.dev/pkg/test/kube_checks.go index 1b78914f..cf1b6cc4 100644 --- a/vendor/github.com/knative/pkg/test/kube_checks.go +++ b/vendor/knative.dev/pkg/test/kube_checks.go @@ -25,7 +25,7 @@ import ( "strings" "time" - "github.com/knative/pkg/test/logging" + "knative.dev/pkg/test/logging" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/vendor/github.com/knative/pkg/test/logging/logging.go b/vendor/knative.dev/pkg/test/logging/logging.go similarity index 99% rename from vendor/github.com/knative/pkg/test/logging/logging.go rename to vendor/knative.dev/pkg/test/logging/logging.go index 2c641bd7..13bd1d72 100644 --- a/vendor/github.com/knative/pkg/test/logging/logging.go +++ b/vendor/knative.dev/pkg/test/logging/logging.go @@ -28,7 +28,7 @@ import ( "github.com/davecgh/go-spew/spew" "github.com/golang/glog" - "github.com/knative/pkg/logging" + "knative.dev/pkg/logging" "go.opencensus.io/stats/view" "go.opencensus.io/trace" "go.uber.org/zap" diff --git a/vendor/knative.dev/pkg/test/logstream/doc.go b/vendor/knative.dev/pkg/test/logstream/doc.go new file mode 100644 index 00000000..ddad2c44 --- /dev/null +++ b/vendor/knative.dev/pkg/test/logstream/doc.go @@ -0,0 +1,21 @@ +/* +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 logstream lets end-to-end tests incorporate controller logs +// into the error output of tests. It is enabled by setting the +// SYSTEM_NAMESPACE environment variable, which tells this package +// what namespace to stream logs from. +package logstream diff --git a/vendor/knative.dev/pkg/test/logstream/interface.go b/vendor/knative.dev/pkg/test/logstream/interface.go new file mode 100644 index 00000000..6aadddc7 --- /dev/null +++ b/vendor/knative.dev/pkg/test/logstream/interface.go @@ -0,0 +1,52 @@ +/* +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 logstream + +import ( + "os" + "testing" + + "knative.dev/pkg/system" +) + +// Canceler is the type of a function returned when a logstream is started to be +// deferred so that the logstream can be stopped when the test is complete. +type Canceler func() + +// Start begins streaming the logs from system components with a `key:` matching +// `test.ObjectNameForTest(t)` to `t.Log`. It returns a Canceler, which must +// be called before the test completes. +func Start(t *testing.T) Canceler { + return stream.Start(t) +} + +type streamer interface { + Start(t *testing.T) Canceler +} + +var stream streamer + +func init() { + ns := os.Getenv(system.NamespaceEnvKey) + if ns != "" { + // If SYSTEM_NAMESPACE is set, then start the stream. + stream = &kubelogs{namespace: ns} + } else { + // Otherwise set up a null stream. + stream = &null{} + } +} diff --git a/vendor/knative.dev/pkg/test/logstream/kubelogs.go b/vendor/knative.dev/pkg/test/logstream/kubelogs.go new file mode 100644 index 00000000..b18a5f14 --- /dev/null +++ b/vendor/knative.dev/pkg/test/logstream/kubelogs.go @@ -0,0 +1,177 @@ +/* +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 logstream + +import ( + "bufio" + "encoding/json" + "fmt" + "strings" + "sync" + "testing" + "time" + + "golang.org/x/sync/errgroup" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "knative.dev/pkg/ptr" + "knative.dev/pkg/test" + "knative.dev/pkg/test/helpers" +) + +type kubelogs struct { + namespace string + + once sync.Once + m sync.RWMutex + keys map[string]logger + err error +} + +type logger func(string, ...interface{}) + +var _ streamer = (*kubelogs)(nil) + +// timeFormat defines a simple timestamp with millisecond granularity +const timeFormat = "15:04:05.000" + +func (k *kubelogs) init(t *testing.T) { + k.keys = make(map[string]logger) + + kc, err := test.NewKubeClient(test.Flags.Kubeconfig, test.Flags.Cluster) + if err != nil { + t.Errorf("Error loading client config: %v", err) + } + + // List the pods in the given namespace. + pl, err := kc.Kube.CoreV1().Pods(k.namespace).List(metav1.ListOptions{}) + if err != nil { + t.Errorf("Error listing pods: %v", err) + } + + eg := errgroup.Group{} + for _, pod := range pl.Items { + // Grab data from all containers in the pods. We need this in case + // an envoy sidecar is injected for mesh installs. This should be + // equivalent to --all-containers. + for _, container := range pod.Spec.Containers { + // Required for capture below. + pod, container := pod, container + eg.Go(func() error { + options := &corev1.PodLogOptions{ + Container: container.Name, + // Follow directs the api server to continuously stream logs back. + Follow: true, + // Only return new logs (this value is being used for "epsilon"). + SinceSeconds: ptr.Int64(1), + } + + req := kc.Kube.CoreV1().Pods(k.namespace).GetLogs(pod.Name, options) + stream, err := req.Stream() + if err != nil { + return err + } + defer stream.Close() + // Read this container's stream. + for scanner := bufio.NewScanner(stream); scanner.Scan(); { + k.handleLine(scanner.Text()) + } + return fmt.Errorf("logstream completed prematurely for: %s/%s", pod.Name, container.Name) + }) + } + } + + // Monitor the error group in the background and surface an error on the kubelogs + // in case anything had an active stream open. + go func() { + if err := eg.Wait(); err != nil { + k.m.Lock() + defer k.m.Unlock() + k.err = err + } + }() +} + +func (k *kubelogs) handleLine(l string) { + // This holds the standard structure of our logs. + var line struct { + Level string `json:"level"` + Timestamp time.Time `json:"ts"` + Controller string `json:"knative.dev/controller"` + Caller string `json:"caller"` + Key string `json:"knative.dev/key"` + Message string `json:"msg"` + Error string `json:"error"` + + // TODO(mattmoor): Parse out more context. + } + if err := json.Unmarshal([]byte(l), &line); err != nil { + // Ignore malformed lines. + return + } + if line.Key == "" { + return + } + + k.m.RLock() + defer k.m.RUnlock() + + for name, logf := range k.keys { + // TODO(mattmoor): Do a slightly smarter match. + if !strings.Contains(line.Key, name) { + continue + } + + // E 15:04:05.000 [route-controller] [default/testroute-xyz] this is my message + msg := fmt.Sprintf("%s %s [%s] [%s] %s", + strings.ToUpper(string(line.Level[0])), + line.Timestamp.Format(timeFormat), + line.Controller, + line.Key, + line.Message) + + if line.Error != "" { + msg += " err=" + line.Error + } + + logf(msg) + } +} + +// Start implements streamer +func (k *kubelogs) Start(t *testing.T) Canceler { + k.once.Do(func() { k.init(t) }) + + name := helpers.ObjectPrefixForTest(t) + + // Register a key + k.m.Lock() + defer k.m.Unlock() + k.keys[name] = t.Logf + + // Return a function that unregisters that key. + return func() { + k.m.Lock() + defer k.m.Unlock() + delete(k.keys, name) + + if k.err != nil { + t.Errorf("error during logstream: %v", k.err) + } + } +} diff --git a/vendor/knative.dev/pkg/test/logstream/null.go b/vendor/knative.dev/pkg/test/logstream/null.go new file mode 100644 index 00000000..bbc6cfd2 --- /dev/null +++ b/vendor/knative.dev/pkg/test/logstream/null.go @@ -0,0 +1,30 @@ +/* +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 logstream + +import ( + "testing" +) + +type null struct{} + +var _ streamer = (*null)(nil) + +// Start implements streamer +func (*null) Start(t *testing.T) Canceler { + return func() {} +} diff --git a/vendor/github.com/knative/pkg/test/monitoring/doc.go b/vendor/knative.dev/pkg/test/monitoring/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/test/monitoring/doc.go rename to vendor/knative.dev/pkg/test/monitoring/doc.go diff --git a/vendor/github.com/knative/pkg/test/monitoring/monitoring.go b/vendor/knative.dev/pkg/test/monitoring/monitoring.go similarity index 98% rename from vendor/github.com/knative/pkg/test/monitoring/monitoring.go rename to vendor/knative.dev/pkg/test/monitoring/monitoring.go index ccbad42b..ea593d62 100644 --- a/vendor/github.com/knative/pkg/test/monitoring/monitoring.go +++ b/vendor/knative.dev/pkg/test/monitoring/monitoring.go @@ -23,7 +23,7 @@ import ( "os/exec" "strings" - "github.com/knative/pkg/test/logging" + "knative.dev/pkg/test/logging" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" diff --git a/vendor/github.com/knative/pkg/test/presubmit-tests.sh b/vendor/knative.dev/pkg/test/presubmit-tests.sh similarity index 100% rename from vendor/github.com/knative/pkg/test/presubmit-tests.sh rename to vendor/knative.dev/pkg/test/presubmit-tests.sh diff --git a/vendor/github.com/knative/pkg/test/request.go b/vendor/knative.dev/pkg/test/request.go similarity index 87% rename from vendor/github.com/knative/pkg/test/request.go rename to vendor/knative.dev/pkg/test/request.go index 1735b607..462c857e 100644 --- a/vendor/github.com/knative/pkg/test/request.go +++ b/vendor/knative.dev/pkg/test/request.go @@ -26,10 +26,29 @@ import ( "strings" "time" - "github.com/knative/pkg/test/logging" - "github.com/knative/pkg/test/spoof" + "knative.dev/pkg/test/logging" + "knative.dev/pkg/test/spoof" ) +// RequestOption enables configuration of requests +// when polling for endpoint states. +type RequestOption func(*http.Request) + +// WithHeader will add the provided headers to the request. +func WithHeader(header http.Header) RequestOption { + return func(r *http.Request) { + if r.Header == nil { + r.Header = header + return + } + for key, values := range header { + for _, value := range values { + r.Header.Add(key, value) + } + } + } +} + // Retrying modifies a ResponseChecker to retry certain response codes. func Retrying(rc spoof.ResponseChecker, codes ...int) spoof.ResponseChecker { return func(resp *spoof.Response) (bool, error) { @@ -115,8 +134,8 @@ func MatchesAllOf(checkers ...spoof.ResponseChecker) spoof.ResponseChecker { // the domain in the request headers, otherwise it will make the request directly to domain. // desc will be used to name the metric that is emitted to track how long it took for the // domain to get into the state checked by inState. Commas in `desc` must be escaped. -func WaitForEndpointState(kubeClient *KubeClient, logf logging.FormatLogger, theURL string, inState spoof.ResponseChecker, desc string, resolvable bool) (*spoof.Response, error) { - return WaitForEndpointStateWithTimeout(kubeClient, logf, theURL, inState, desc, resolvable, spoof.RequestTimeout) +func WaitForEndpointState(kubeClient *KubeClient, logf logging.FormatLogger, theURL string, inState spoof.ResponseChecker, desc string, resolvable bool, opts ...RequestOption) (*spoof.Response, error) { + return WaitForEndpointStateWithTimeout(kubeClient, logf, theURL, inState, desc, resolvable, spoof.RequestTimeout, opts...) } // WaitForEndpointStateWithTimeout will poll an endpoint until inState indicates the state is achieved @@ -127,7 +146,7 @@ func WaitForEndpointState(kubeClient *KubeClient, logf logging.FormatLogger, the // domain to get into the state checked by inState. Commas in `desc` must be escaped. func WaitForEndpointStateWithTimeout( kubeClient *KubeClient, logf logging.FormatLogger, theURL string, inState spoof.ResponseChecker, - desc string, resolvable bool, timeout time.Duration) (*spoof.Response, error) { + desc string, resolvable bool, timeout time.Duration, opts ...RequestOption) (*spoof.Response, error) { defer logging.GetEmitableSpan(context.Background(), fmt.Sprintf("WaitForEndpointState/%s", desc)).End() // Try parsing the "theURL" with and without a scheme. @@ -144,6 +163,10 @@ func WaitForEndpointStateWithTimeout( return nil, err } + for _, opt := range opts { + opt(req) + } + client, err := NewSpoofingClient(kubeClient, logf, asURL.Hostname(), resolvable) if err != nil { return nil, err diff --git a/vendor/github.com/knative/pkg/test/spoof/error_checks.go b/vendor/knative.dev/pkg/test/spoof/error_checks.go similarity index 100% rename from vendor/github.com/knative/pkg/test/spoof/error_checks.go rename to vendor/knative.dev/pkg/test/spoof/error_checks.go diff --git a/vendor/github.com/knative/pkg/test/spoof/spoof.go b/vendor/knative.dev/pkg/test/spoof/spoof.go similarity index 98% rename from vendor/github.com/knative/pkg/test/spoof/spoof.go rename to vendor/knative.dev/pkg/test/spoof/spoof.go index f23d3049..37f83b6c 100644 --- a/vendor/github.com/knative/pkg/test/spoof/spoof.go +++ b/vendor/knative.dev/pkg/test/spoof/spoof.go @@ -24,9 +24,9 @@ import ( "net/http" "time" - ingress "github.com/knative/pkg/test/ingress" - "github.com/knative/pkg/test/logging" - "github.com/knative/pkg/test/zipkin" + ingress "knative.dev/pkg/test/ingress" + "knative.dev/pkg/test/logging" + "knative.dev/pkg/test/zipkin" "github.com/pkg/errors" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes" diff --git a/vendor/github.com/knative/pkg/test/zipkin/doc.go b/vendor/knative.dev/pkg/test/zipkin/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/test/zipkin/doc.go rename to vendor/knative.dev/pkg/test/zipkin/doc.go diff --git a/vendor/github.com/knative/pkg/test/zipkin/util.go b/vendor/knative.dev/pkg/test/zipkin/util.go similarity index 98% rename from vendor/github.com/knative/pkg/test/zipkin/util.go rename to vendor/knative.dev/pkg/test/zipkin/util.go index add07498..cbf3c7eb 100644 --- a/vendor/github.com/knative/pkg/test/zipkin/util.go +++ b/vendor/knative.dev/pkg/test/zipkin/util.go @@ -25,8 +25,8 @@ import ( "net/http" "sync" - "github.com/knative/pkg/test/logging" - "github.com/knative/pkg/test/monitoring" + "knative.dev/pkg/test/logging" + "knative.dev/pkg/test/monitoring" "go.opencensus.io/trace" "k8s.io/client-go/kubernetes" ) diff --git a/vendor/github.com/knative/pkg/testing/doc.go b/vendor/knative.dev/pkg/testing/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/testing/doc.go rename to vendor/knative.dev/pkg/testing/doc.go diff --git a/vendor/github.com/knative/pkg/testing/inner_default_resource.go b/vendor/knative.dev/pkg/testing/inner_default_resource.go similarity index 99% rename from vendor/github.com/knative/pkg/testing/inner_default_resource.go rename to vendor/knative.dev/pkg/testing/inner_default_resource.go index 5ee67564..be049128 100644 --- a/vendor/github.com/knative/pkg/testing/inner_default_resource.go +++ b/vendor/knative.dev/pkg/testing/inner_default_resource.go @@ -19,7 +19,7 @@ package testing import ( "context" - "github.com/knative/pkg/apis" + "knative.dev/pkg/apis" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/vendor/github.com/knative/pkg/testing/register.go b/vendor/knative.dev/pkg/testing/register.go similarity index 100% rename from vendor/github.com/knative/pkg/testing/register.go rename to vendor/knative.dev/pkg/testing/register.go diff --git a/vendor/github.com/knative/pkg/testing/resource.go b/vendor/knative.dev/pkg/testing/resource.go similarity index 73% rename from vendor/github.com/knative/pkg/testing/resource.go rename to vendor/knative.dev/pkg/testing/resource.go index d553f8d4..f29c80ab 100644 --- a/vendor/github.com/knative/pkg/testing/resource.go +++ b/vendor/knative.dev/pkg/testing/resource.go @@ -20,10 +20,7 @@ import ( "context" "fmt" - "github.com/knative/pkg/apis" - "github.com/knative/pkg/kmp" - - authenticationv1 "k8s.io/api/authentication/v1" + "knative.dev/pkg/apis" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) @@ -38,13 +35,6 @@ type Resource struct { Spec ResourceSpec `json:"spec,omitempty"` } -const ( - // CreatorAnnotation is the annotation that denotes the user that created the resource. - CreatorAnnotation = "testing.knative.dev/creator" - // UpdaterAnnotation is the annotation that denotes the user that last updated the resource. - UpdaterAnnotation = "testing.knative.dev/updater" -) - // Check that Resource may be validated and defaulted. var _ apis.Validatable = (*Resource)(nil) var _ apis.Defaultable = (*Resource)(nil) @@ -60,47 +50,14 @@ type ResourceSpec struct { FieldThatsImmutableWithDefault string `json:"fieldThatsImmutableWithDefault,omitempty"` } +// GetUntypedSpec returns the spec of the resource. +func (r *Resource) GetUntypedSpec() interface{} { + return r.Spec +} + // SetDefaults sets the defaults on the object. func (c *Resource) SetDefaults(ctx context.Context) { c.Spec.SetDefaults(ctx) - - if apis.IsInUpdate(ctx) { - old := apis.GetBaseline(ctx).(*Resource) - c.AnnotateUserInfo(ctx, old, apis.GetUserInfo(ctx)) - } else { - c.AnnotateUserInfo(ctx, nil, apis.GetUserInfo(ctx)) - } -} - -// AnnotateUserInfo satisfies the Annotatable interface. -func (c *Resource) AnnotateUserInfo(ctx context.Context, prev *Resource, ui *authenticationv1.UserInfo) { - a := c.ObjectMeta.GetAnnotations() - if a == nil { - a = map[string]string{} - } - userName := ui.Username - - // If previous is nil (i.e. this is `Create` operation), - // then we set both fields. - // Otherwise copy creator from the previous state. - if prev == nil { - a[CreatorAnnotation] = userName - } else { - // No spec update ==> bail out. - if ok, _ := kmp.SafeEqual(prev.Spec, c.Spec); ok { - if prev.ObjectMeta.GetAnnotations() != nil { - a[CreatorAnnotation] = prev.ObjectMeta.GetAnnotations()[CreatorAnnotation] - userName = prev.ObjectMeta.GetAnnotations()[UpdaterAnnotation] - } - } else { - if prev.ObjectMeta.GetAnnotations() != nil { - a[CreatorAnnotation] = prev.ObjectMeta.GetAnnotations()[CreatorAnnotation] - } - } - } - // Regardless of `old` set the updater. - a[UpdaterAnnotation] = userName - c.ObjectMeta.SetAnnotations(a) } func (c *Resource) Validate(ctx context.Context) *apis.FieldError { diff --git a/vendor/github.com/knative/pkg/testing/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/testing/zz_generated.deepcopy.go similarity index 100% rename from vendor/github.com/knative/pkg/testing/zz_generated.deepcopy.go rename to vendor/knative.dev/pkg/testing/zz_generated.deepcopy.go diff --git a/vendor/github.com/knative/pkg/tracing/config/doc.go b/vendor/knative.dev/pkg/tracing/config/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/tracing/config/doc.go rename to vendor/knative.dev/pkg/tracing/config/doc.go diff --git a/vendor/github.com/knative/pkg/tracing/config/tracing.go b/vendor/knative.dev/pkg/tracing/config/tracing.go similarity index 100% rename from vendor/github.com/knative/pkg/tracing/config/tracing.go rename to vendor/knative.dev/pkg/tracing/config/tracing.go diff --git a/vendor/github.com/knative/pkg/tracing/config/zz_generated.deepcopy.go b/vendor/knative.dev/pkg/tracing/config/zz_generated.deepcopy.go similarity index 100% rename from vendor/github.com/knative/pkg/tracing/config/zz_generated.deepcopy.go rename to vendor/knative.dev/pkg/tracing/config/zz_generated.deepcopy.go diff --git a/vendor/github.com/knative/pkg/tracing/http.go b/vendor/knative.dev/pkg/tracing/http.go similarity index 100% rename from vendor/github.com/knative/pkg/tracing/http.go rename to vendor/knative.dev/pkg/tracing/http.go diff --git a/vendor/github.com/knative/pkg/tracing/opencensus.go b/vendor/knative.dev/pkg/tracing/opencensus.go similarity index 98% rename from vendor/github.com/knative/pkg/tracing/opencensus.go rename to vendor/knative.dev/pkg/tracing/opencensus.go index e022164f..86f11e8d 100644 --- a/vendor/github.com/knative/pkg/tracing/opencensus.go +++ b/vendor/knative.dev/pkg/tracing/opencensus.go @@ -4,7 +4,7 @@ import ( "errors" "sync" - "github.com/knative/pkg/tracing/config" + "knative.dev/pkg/tracing/config" zipkinmodel "github.com/openzipkin/zipkin-go/model" zipkinreporter "github.com/openzipkin/zipkin-go/reporter" "go.opencensus.io/exporter/zipkin" diff --git a/vendor/github.com/knative/pkg/tracing/zipkin.go b/vendor/knative.dev/pkg/tracing/zipkin.go similarity index 96% rename from vendor/github.com/knative/pkg/tracing/zipkin.go rename to vendor/knative.dev/pkg/tracing/zipkin.go index c455c47e..330b3ae8 100644 --- a/vendor/github.com/knative/pkg/tracing/zipkin.go +++ b/vendor/knative.dev/pkg/tracing/zipkin.go @@ -20,7 +20,7 @@ import ( zipkinreporter "github.com/openzipkin/zipkin-go/reporter" httpreporter "github.com/openzipkin/zipkin-go/reporter/http" - "github.com/knative/pkg/tracing/config" + "knative.dev/pkg/tracing/config" ) // ZipkinReporterFactory is a factory function which creates a reporter given a config diff --git a/vendor/github.com/knative/pkg/tracker/doc.go b/vendor/knative.dev/pkg/tracker/doc.go similarity index 100% rename from vendor/github.com/knative/pkg/tracker/doc.go rename to vendor/knative.dev/pkg/tracker/doc.go diff --git a/vendor/github.com/knative/pkg/tracker/enqueue.go b/vendor/knative.dev/pkg/tracker/enqueue.go similarity index 99% rename from vendor/github.com/knative/pkg/tracker/enqueue.go rename to vendor/knative.dev/pkg/tracker/enqueue.go index ed225c0c..278fbc0a 100644 --- a/vendor/github.com/knative/pkg/tracker/enqueue.go +++ b/vendor/knative.dev/pkg/tracker/enqueue.go @@ -27,7 +27,7 @@ import ( "k8s.io/apimachinery/pkg/util/validation" "k8s.io/client-go/tools/cache" - "github.com/knative/pkg/kmeta" + "knative.dev/pkg/kmeta" ) // New returns an implementation of Interface that lets a Reconciler diff --git a/vendor/github.com/knative/pkg/tracker/interface.go b/vendor/knative.dev/pkg/tracker/interface.go similarity index 100% rename from vendor/github.com/knative/pkg/tracker/interface.go rename to vendor/knative.dev/pkg/tracker/interface.go diff --git a/vendor/github.com/knative/pkg/version/version.go b/vendor/knative.dev/pkg/version/version.go similarity index 100% rename from vendor/github.com/knative/pkg/version/version.go rename to vendor/knative.dev/pkg/version/version.go diff --git a/vendor/github.com/knative/pkg/webhook/certs.go b/vendor/knative.dev/pkg/webhook/certs.go similarity index 99% rename from vendor/github.com/knative/pkg/webhook/certs.go rename to vendor/knative.dev/pkg/webhook/certs.go index ba0ee739..1a034839 100644 --- a/vendor/github.com/knative/pkg/webhook/certs.go +++ b/vendor/knative.dev/pkg/webhook/certs.go @@ -29,7 +29,7 @@ import ( "go.uber.org/zap" - "github.com/knative/pkg/logging" + "knative.dev/pkg/logging" ) const ( diff --git a/vendor/knative.dev/pkg/webhook/user_info.go b/vendor/knative.dev/pkg/webhook/user_info.go new file mode 100644 index 00000000..24f5bd9e --- /dev/null +++ b/vendor/knative.dev/pkg/webhook/user_info.go @@ -0,0 +1,62 @@ +/* +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 webhook + +import ( + "context" + + "k8s.io/apimachinery/pkg/api/equality" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "knative.dev/pkg/apis" +) + +const ( + // CreatorAnnotationSuffix is the suffix of the annotation key to describe + // the user that created the resource. + CreatorAnnotationSuffix = "/creator" + + // UpdaterAnnotationSuffix is the suffix of the annotation key to describe + // the user who last modified the resource. + UpdaterAnnotationSuffix = "/updater" +) + +// SetUserInfoAnnotations sets creator and updater annotations on a resource. +func SetUserInfoAnnotations(resource apis.HasSpec, ctx context.Context, groupName string) { + if ui := apis.GetUserInfo(ctx); ui != nil { + objectMetaAccessor, ok := resource.(metav1.ObjectMetaAccessor) + if !ok { + return + } + + annotations := objectMetaAccessor.GetObjectMeta().GetAnnotations() + if annotations == nil { + annotations = map[string]string{} + defer objectMetaAccessor.GetObjectMeta().SetAnnotations(annotations) + } + + if apis.IsInUpdate(ctx) { + old := apis.GetBaseline(ctx).(apis.HasSpec) + if equality.Semantic.DeepEqual(old.GetUntypedSpec(), resource.GetUntypedSpec()) { + return + } + annotations[groupName+UpdaterAnnotationSuffix] = ui.Username + } else { + annotations[groupName+CreatorAnnotationSuffix] = ui.Username + annotations[groupName+UpdaterAnnotationSuffix] = ui.Username + } + } +} diff --git a/vendor/github.com/knative/pkg/webhook/webhook.go b/vendor/knative.dev/pkg/webhook/webhook.go similarity index 94% rename from vendor/github.com/knative/pkg/webhook/webhook.go rename to vendor/knative.dev/pkg/webhook/webhook.go index 3fc5342c..7f23b47e 100644 --- a/vendor/github.com/knative/pkg/webhook/webhook.go +++ b/vendor/knative.dev/pkg/webhook/webhook.go @@ -31,11 +31,11 @@ import ( "go.uber.org/zap" - "github.com/knative/pkg/apis" - "github.com/knative/pkg/apis/duck" - "github.com/knative/pkg/kmp" - "github.com/knative/pkg/logging" - "github.com/knative/pkg/logging/logkey" + "knative.dev/pkg/apis" + "knative.dev/pkg/apis/duck" + "knative.dev/pkg/kmp" + "knative.dev/pkg/logging" + "knative.dev/pkg/logging/logkey" "github.com/markbates/inflect" "github.com/mattbaird/jsonpatch" @@ -333,7 +333,7 @@ func (ac *AdmissionController) register( Rule: admissionregistrationv1beta1.Rule{ APIGroups: []string{gvk.Group}, APIVersions: []string{gvk.Version}, - Resources: []string{plural}, + Resources: []string{plural + "/*"}, }, }) } @@ -550,7 +550,16 @@ func (ac *AdmissionController) mutate(ctx context.Context, req *admissionv1beta1 oldObj = oldObj.DeepCopyObject().(GenericCRD) oldObj.SetDefaults(ctx) - ctx = apis.WithinUpdate(ctx, oldObj) + s, ok := oldObj.(apis.HasSpec) + if ok { + SetUserInfoAnnotations(s, ctx, req.Resource.Group) + } + + if req.SubResource == "" { + ctx = apis.WithinUpdate(ctx, oldObj) + } else { + ctx = apis.WithinSubResourceUpdate(ctx, oldObj, req.SubResource) + } } else { ctx = apis.WithinCreate(ctx) } @@ -564,6 +573,11 @@ func (ac *AdmissionController) mutate(ctx context.Context, req *admissionv1beta1 return nil, err } + if patches, err = ac.setUserInfoAnnotations(ctx, patches, newObj, req.Resource.Group); err != nil { + logger.Errorw("Failed the resource user info annotator", zap.Error(err)) + return nil, err + } + // None of the validators will accept a nil value for newObj. if newObj == nil { return nil, errMissingNewObject @@ -578,6 +592,26 @@ func (ac *AdmissionController) mutate(ctx context.Context, req *admissionv1beta1 return json.Marshal(patches) } +func (ac *AdmissionController) setUserInfoAnnotations(ctx context.Context, patches duck.JSONPatch, new GenericCRD, groupName string) (duck.JSONPatch, error) { + if new == nil { + return patches, nil + } + nh, ok := new.(apis.HasSpec) + if !ok { + return patches, nil + } + + b, a := new.DeepCopyObject().(apis.HasSpec), nh + + SetUserInfoAnnotations(nh, ctx, groupName) + + patch, err := duck.CreatePatch(b, a) + if err != nil { + return nil, err + } + return append(patches, patch...), nil +} + // roundTripPatch generates the JSONPatch that corresponds to round tripping the given bytes through // the Golang type (JSON -> Golang type -> JSON). Because it is not always true that // bytes == json.Marshal(json.Unmarshal(bytes)). diff --git a/vendor/github.com/knative/pkg/websocket/connection.go b/vendor/knative.dev/pkg/websocket/connection.go similarity index 100% rename from vendor/github.com/knative/pkg/websocket/connection.go rename to vendor/knative.dev/pkg/websocket/connection.go diff --git a/vendor/github.com/knative/pkg/websocket/hijack.go b/vendor/knative.dev/pkg/websocket/hijack.go similarity index 100% rename from vendor/github.com/knative/pkg/websocket/hijack.go rename to vendor/knative.dev/pkg/websocket/hijack.go