diff --git a/Gopkg.lock b/Gopkg.lock index 5fd48dab9cf..cb31b28128c 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -433,7 +433,7 @@ version = "v1.3.0" [[projects]] - digest = "1:57d04562d05dd4500ff1e7e47f2e62b9be0531388377a3b691a012ce70b210d5" + digest = "1:8cd04a6109f3a15c2481ff5cffcb15a57eb6e19dc14eb94006d1a20d8db2b20c" name = "github.com/knative/pkg" packages = [ "apis", @@ -452,7 +452,6 @@ "client/clientset/versioned/typed/authentication/v1alpha1/fake", "client/clientset/versioned/typed/istio/v1alpha3", "client/clientset/versioned/typed/istio/v1alpha3/fake", - "client/listers/istio/v1alpha3", "configmap", "controller", "kmeta", @@ -1388,9 +1387,7 @@ "github.com/knative/pkg/apis", "github.com/knative/pkg/apis/duck", "github.com/knative/pkg/apis/duck/v1alpha1", - "github.com/knative/pkg/apis/istio/v1alpha3", "github.com/knative/pkg/client/clientset/versioned/fake", - "github.com/knative/pkg/client/listers/istio/v1alpha3", "github.com/knative/pkg/configmap", "github.com/knative/pkg/controller", "github.com/knative/pkg/kmeta", diff --git a/config/100-namespace.yaml b/config/100-namespace.yaml index e57fdd07720..07781fa5b47 100644 --- a/config/100-namespace.yaml +++ b/config/100-namespace.yaml @@ -15,5 +15,3 @@ apiVersion: v1 kind: Namespace metadata: name: knative-eventing - labels: - istio-injection: enabled diff --git a/config/provisioners/in-memory-channel/in-memory-channel.yaml b/config/provisioners/in-memory-channel/in-memory-channel.yaml index d1b30298273..ed9472d863b 100644 --- a/config/provisioners/in-memory-channel/in-memory-channel.yaml +++ b/config/provisioners/in-memory-channel/in-memory-channel.yaml @@ -188,8 +188,6 @@ spec: role: dispatcher template: metadata: - annotations: - sidecar.istio.io/inject: "true" labels: *labels spec: serviceAccountName: in-memory-channel-dispatcher diff --git a/contrib/gcppubsub/config/gcppubsub.yaml b/contrib/gcppubsub/config/gcppubsub.yaml index a1807aa9851..8cf2dca10b8 100644 --- a/contrib/gcppubsub/config/gcppubsub.yaml +++ b/contrib/gcppubsub/config/gcppubsub.yaml @@ -195,8 +195,6 @@ spec: role: dispatcher template: metadata: - annotations: - sidecar.istio.io/inject: "true" labels: *labels spec: serviceAccountName: gcp-pubsub-channel-dispatcher @@ -233,20 +231,21 @@ spec: - protocol: TCP port: 80 targetPort: 8080 - --- -# Needed by the GCP PubSub Channel to communicate with GCP PubSub. -apiVersion: networking.istio.io/v1alpha3 -kind: ServiceEntry -metadata: - name: gcppubsub-bus-ext - namespace: knative-eventing -spec: - hosts: - - "*.googleapis.com" - - "accounts.google.com" - ports: - - number: 443 - name: https - protocol: HTTPS - location: MESH_EXTERNAL +# Needed by the GCP PubSub Channel to communicate with GCP PubSub. +# Please uncomment if ISTIO automatic sidecar injector is enabled on the cluster, and +# the GCP dispatcher pod in knative-eventing namespace runs with a ISTIO sidecar. +# apiVersion: networking.istio.io/v1alpha3 +# kind: ServiceEntry +# metadata: +# name: gcppubsub-bus-ext +# namespace: knative-eventing +# spec: +# hosts: +# - "*.googleapis.com" +# - "accounts.google.com" +# ports: +# - number: 443 +# name: https +# protocol: HTTPS +# location: MESH_EXTERNAL diff --git a/contrib/kafka/config/kafka.yaml b/contrib/kafka/config/kafka.yaml index 49882a5e158..6b89bbd68b5 100644 --- a/contrib/kafka/config/kafka.yaml +++ b/contrib/kafka/config/kafka.yaml @@ -199,8 +199,6 @@ spec: role: dispatcher template: metadata: - annotations: - sidecar.istio.io/inject: "true" labels: *labels spec: serviceAccountName: kafka-channel-dispatcher diff --git a/contrib/natss/config/broker/README.md b/contrib/natss/config/broker/README.md index cc81528710a..eb59553937f 100644 --- a/contrib/natss/config/broker/README.md +++ b/contrib/natss/config/broker/README.md @@ -4,7 +4,6 @@ ```sbtshell kubectl create namespace natss - kubectl label namespace natss istio-injection=enabled kubectl apply -n natss -f contrib/natss/config/broker/natss.yaml ``` diff --git a/contrib/natss/config/provisioner.yaml b/contrib/natss/config/provisioner.yaml index 6790bbe7b1d..d53f772ae8f 100644 --- a/contrib/natss/config/provisioner.yaml +++ b/contrib/natss/config/provisioner.yaml @@ -162,8 +162,6 @@ spec: role: dispatcher template: metadata: - annotations: - sidecar.istio.io/inject: "true" labels: *labels spec: serviceAccountName: natss-dispatcher diff --git a/docs/broker/README.md b/docs/broker/README.md index e95ca70422a..8b90d0b66fa 100644 --- a/docs/broker/README.md +++ b/docs/broker/README.md @@ -235,7 +235,7 @@ The `Broker`'s address is well known, it will always be `-broker..svc.`. In our case, it is `default-broker.default.svc.cluster.local`. -While SSHed into a `Pod` with the Istio sidecar, run: +While SSHed into a `Pod` and run: ```shell curl -v "http://default-broker.default.svc.cluster.local/" \ @@ -278,7 +278,7 @@ implmentation**. ### Namespace Namespaces are reconciled by the -[Namespace Reconciler](../../pkg/reconciler/v1alpha1/namespace). The +[Namespace Reconciler](../../pkg/reconciler/namespace). The `Namespace Reconciler` looks for all `namespace`s that have the label `knative-eventing-injection: enabled`. If that label is present, then the `Namespace Reconciler` reconciles: diff --git a/pkg/apis/eventing/v1alpha1/subscription_types.go b/pkg/apis/eventing/v1alpha1/subscription_types.go index 6e03585190e..e43377c021f 100644 --- a/pkg/apis/eventing/v1alpha1/subscription_types.go +++ b/pkg/apis/eventing/v1alpha1/subscription_types.go @@ -104,8 +104,7 @@ type SubscriptionSpec struct { // provide the resolved target of the action. // Currently we inspect the objects Status and see if there's a predefined // Status field that we will then use to dispatch events to be processed by -// the target. Currently must resolve to a k8s service or Istio virtual -// service. +// the target. Currently must resolve to a k8s service. // Note that in the future we should try to utilize subresources (/resolve ?) to // make this cleaner, but CRDs do not support subresources yet, so we need // to rely on a specified Status field today. By relying on this behaviour diff --git a/pkg/provisioners/channel_util.go b/pkg/provisioners/channel_util.go index df914bc8a6b..abf79f75598 100644 --- a/pkg/provisioners/channel_util.go +++ b/pkg/provisioners/channel_util.go @@ -7,7 +7,6 @@ import ( "k8s.io/apimachinery/pkg/labels" - istiov1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" corev1 "k8s.io/api/core/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -157,61 +156,6 @@ func createK8sService(ctx context.Context, client runtimeClient.Client, getSvc g return current, nil } -func getVirtualService(ctx context.Context, client runtimeClient.Client, c *eventingv1alpha1.Channel) (*istiov1alpha3.VirtualService, error) { - list := &istiov1alpha3.VirtualServiceList{} - opts := &runtimeClient.ListOptions{ - Namespace: c.Namespace, - // TODO After the full release start selecting on new set of labels by using virtualServiceLabels(c) - LabelSelector: labels.SelectorFromSet(virtualOldServiceLabels(c)), - // Set Raw because if we need to get more than one page, then we will put the continue token - // into opts.Raw.Continue. - Raw: &metav1.ListOptions{}, - } - - err := client.List(ctx, opts, list) - if err != nil { - return nil, err - } - for _, vs := range list.Items { - if metav1.IsControlledBy(&vs, c) { - return &vs, nil - } - } - - return nil, k8serrors.NewNotFound(schema.GroupResource{}, "") -} - -func CreateVirtualService(ctx context.Context, client runtimeClient.Client, channel *eventingv1alpha1.Channel, svc *corev1.Service) (*istiov1alpha3.VirtualService, error) { - virtualService, err := getVirtualService(ctx, client, channel) - - // If the resource doesn't exist, we'll create it - if k8serrors.IsNotFound(err) { - virtualService = newVirtualService(channel, svc) - err = client.Create(ctx, virtualService) - if err != nil { - return nil, err - } - return virtualService, nil - } else if err != nil { - return nil, err - } - - // Update VirtualService if it has changed. This is possible since in version 0.2.0, the destinationHost in - // spec.HTTP.Route for the dispatcher was changed from *-clusterbus to *-dispatcher. Even otherwise, this - // reconciliation is useful for the future mutations to the object. - expected := newVirtualService(channel, svc) - if !equality.Semantic.DeepDerivative(expected.Spec, virtualService.Spec) || - !expectedLabelsPresent(virtualService.ObjectMeta.Labels, expected.ObjectMeta.Labels) { - virtualService.Spec = expected.Spec - virtualService.ObjectMeta.Labels = addExpectedLabels(virtualService.ObjectMeta.Labels, expected.ObjectMeta.Labels) - err := client.Update(ctx, virtualService) - if err != nil { - return nil, err - } - } - return virtualService, nil -} - // checkExpectedLabels checks the presence of expected labels and its values and return true // if all labels are found. func expectedLabelsPresent(actual, expected map[string]string) bool { @@ -333,60 +277,6 @@ func k8sServiceLabels(c *eventingv1alpha1.Channel) map[string]string { } } -func virtualServiceLabels(c *eventingv1alpha1.Channel) map[string]string { - // Use the same labels as the K8s service. - return k8sServiceLabels(c) -} - -func virtualOldServiceLabels(c *eventingv1alpha1.Channel) map[string]string { - // Use the same labels as the K8s service. - return k8sOldServiceLabels(c) -} - -// newVirtualService creates a new VirtualService for a Channel resource. It also sets the -// appropriate OwnerReferences on the resource so handleObject can discover the Channel resource -// that 'owns' it. As well as being garbage collected when the Channel is deleted. -func newVirtualService(channel *eventingv1alpha1.Channel, svc *corev1.Service) *istiov1alpha3.VirtualService { - destinationHost := names.ServiceHostName(channelDispatcherServiceName(channel.Spec.Provisioner.Name), system.Namespace()) - return &istiov1alpha3.VirtualService{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: channelVirtualServiceName(channel.Name), - Namespace: channel.Namespace, - Labels: virtualServiceLabels(channel), - OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(channel, schema.GroupVersionKind{ - Group: eventingv1alpha1.SchemeGroupVersion.Group, - Version: eventingv1alpha1.SchemeGroupVersion.Version, - Kind: "Channel", - }), - }, - }, - Spec: istiov1alpha3.VirtualServiceSpec{ - Hosts: []string{ - names.ServiceHostName(svc.Name, channel.Namespace), - channelHostName(channel.Name, channel.Namespace), - }, - HTTP: []istiov1alpha3.HTTPRoute{{ - Rewrite: &istiov1alpha3.HTTPRewrite{ - Authority: channelHostName(channel.Name, channel.Namespace), - }, - Route: []istiov1alpha3.HTTPRouteDestination{{ - Destination: istiov1alpha3.Destination{ - Host: destinationHost, - Port: istiov1alpha3.PortSelector{ - Number: PortNumber, - }, - }}, - }}, - }, - }, - } -} - -func channelVirtualServiceName(channelName string) string { - return fmt.Sprintf("%s-channel-", channelName) -} - func channelServiceName(channelName string) string { return fmt.Sprintf("%s-channel-", channelName) } diff --git a/pkg/provisioners/channel_util_test.go b/pkg/provisioners/channel_util_test.go index 502c1fd5909..db35894106c 100644 --- a/pkg/provisioners/channel_util_test.go +++ b/pkg/provisioners/channel_util_test.go @@ -16,7 +16,6 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/knative/pkg/apis" - istiov1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" @@ -43,7 +42,6 @@ var ( func init() { // Add types to scheme. - istiov1alpha3.AddToScheme(scheme.Scheme) eventingv1alpha1.AddToScheme(scheme.Scheme) } @@ -67,35 +65,6 @@ func TestChannelUtils(t *testing.T) { return CreateK8sService(context.TODO(), client, getNewChannel()) }, want: makeK8sService(), - }, { - name: "CreateVirtualService", - f: func() (metav1.Object, error) { - client := fake.NewFakeClient() - return CreateVirtualService(context.TODO(), client, getNewChannel(), makeK8sService()) - }, - want: makeVirtualService(), - }, { - name: "CreateVirtualService_Existing", - f: func() (metav1.Object, error) { - existing := makeVirtualService() - client := fake.NewFakeClient(existing) - return CreateVirtualService(context.TODO(), client, getNewChannel(), makeK8sService()) - }, - want: makeVirtualService(), - }, { - name: "CreateVirtualService_ModifiedSpec", - f: func() (metav1.Object, error) { - existing := makeVirtualService() - destHost := fmt.Sprintf("%s-clusterbus.knative-eventing.svc.%s", clusterChannelProvisionerName, utils.GetClusterDomainName()) - existing.Spec.HTTP[0].Route[0].Destination.Host = destHost - client := fake.NewFakeClient(existing) - CreateVirtualService(context.TODO(), client, getNewChannel(), makeK8sService()) - - got := &istiov1alpha3.VirtualService{} - got, err := getVirtualService(context.TODO(), client, getNewChannel()) - return got, err - }, - want: makeVirtualService(), }, { name: "UpdateChannel", f: func() (metav1.Object, error) { @@ -255,125 +224,6 @@ func TestCreateK8sService(t *testing.T) { } } -func TestCreateVirtualService(t *testing.T) { - testCases := map[string]struct { - list controllertesting.MockList - create controllertesting.MockCreate - update controllertesting.MockUpdate - expected *istiov1alpha3.VirtualService - err error - }{ - "error getting svc": { - list: func(_ runtimeClient.Client, _ context.Context, _ *runtimeClient.ListOptions, _ runtime.Object) (controllertesting.MockHandled, error) { - return controllertesting.Handled, errTestInduced - }, - err: errTestInduced, - }, - "not found - create error": { - create: func(_ runtimeClient.Client, _ context.Context, _ runtime.Object) (controllertesting.MockHandled, error) { - return controllertesting.Handled, errTestInduced - }, - err: errTestInduced, - }, - "not found - create succeeds": { - create: func(_ runtimeClient.Client, _ context.Context, obj runtime.Object) (controllertesting.MockHandled, error) { - vs := obj.(*istiov1alpha3.VirtualService) - vs.Spec = makeTamperedVirtualService().Spec - return controllertesting.Handled, nil - }, - expected: makeTamperedVirtualService(), - }, - "different spec - update fails": { - list: func(_ runtimeClient.Client, _ context.Context, _ *runtimeClient.ListOptions, obj runtime.Object) (controllertesting.MockHandled, error) { - l := obj.(*istiov1alpha3.VirtualServiceList) - l.Items = []istiov1alpha3.VirtualService{ - { - ObjectMeta: metav1.ObjectMeta{ - OwnerReferences: []metav1.OwnerReference{ - { - Controller: &truePointer, - UID: channelUID, - }, - }, - }, - Spec: istiov1alpha3.VirtualServiceSpec{ - Gateways: []string{"set in get"}, - }, - }, - } - return controllertesting.Handled, nil - }, - update: func(_ runtimeClient.Client, _ context.Context, obj runtime.Object) (controllertesting.MockHandled, error) { - return controllertesting.Handled, errTestInduced - }, - err: errTestInduced, - }, - "different spec - update succeeds": { - list: func(_ runtimeClient.Client, _ context.Context, _ *runtimeClient.ListOptions, obj runtime.Object) (controllertesting.MockHandled, error) { - l := obj.(*istiov1alpha3.VirtualServiceList) - l.Items = []istiov1alpha3.VirtualService{ - { - ObjectMeta: metav1.ObjectMeta{ - OwnerReferences: []metav1.OwnerReference{ - { - Controller: &truePointer, - UID: channelUID, - }, - }, - }, - Spec: istiov1alpha3.VirtualServiceSpec{ - Gateways: []string{"set in get"}, - }, - }, - } - return controllertesting.Handled, nil - }, - update: func(_ runtimeClient.Client, _ context.Context, obj runtime.Object) (controllertesting.MockHandled, error) { - vs := obj.(*istiov1alpha3.VirtualService) - makeTamperedVirtualService().DeepCopyInto(vs) - return controllertesting.Handled, nil - }, - expected: makeTamperedVirtualService(), - }, - "found doesn't need altering": { - list: func(_ runtimeClient.Client, _ context.Context, _ *runtimeClient.ListOptions, obj runtime.Object) (controllertesting.MockHandled, error) { - l := obj.(*istiov1alpha3.VirtualServiceList) - l.Items = []istiov1alpha3.VirtualService{*makeVirtualService()} - return controllertesting.Handled, nil - }, - create: func(_ runtimeClient.Client, _ context.Context, _ runtime.Object) (controllertesting.MockHandled, error) { - return controllertesting.Handled, errors.New("create should not have been called") - }, - update: func(_ runtimeClient.Client, _ context.Context, _ runtime.Object) (controllertesting.MockHandled, error) { - return controllertesting.Handled, errors.New("update should not have been called") - }, - expected: makeVirtualService(), - }, - } - for n, tc := range testCases { - t.Run(n, func(t *testing.T) { - mocks := controllertesting.Mocks{} - if tc.list != nil { - mocks.MockLists = []controllertesting.MockList{tc.list} - } - if tc.create != nil { - mocks.MockCreates = []controllertesting.MockCreate{tc.create} - } - if tc.update != nil { - mocks.MockUpdates = []controllertesting.MockUpdate{tc.update} - } - client := controllertesting.NewMockClient(fake.NewFakeClient(), mocks) - vs, err := CreateVirtualService(context.TODO(), client, getNewChannel(), makeK8sService()) - if tc.err != err { - t.Fatalf("Unexpected error. Expected '%s', actual '%v'", tc.err, err) - } - if diff := cmp.Diff(tc.expected, vs); diff != "" { - t.Fatalf("Unexpected virtual service (-want +got): %s", diff) - } - }) - } -} - func TestAddFinalizer(t *testing.T) { testCases := map[string]struct { alreadyPresent bool @@ -439,12 +289,6 @@ func TestChannelNames(t *testing.T) { F func() string Want string }{{ - Name: "channelVirtualServiceName", - F: func() string { - return channelVirtualServiceName("foo") - }, - Want: "foo-channel-", - }, { Name: "channelServiceName", F: func() string { return channelServiceName("foo") @@ -642,57 +486,3 @@ func makeTamperedK8sService() *corev1.Service { } return svc } - -func makeVirtualService() *istiov1alpha3.VirtualService { - return &istiov1alpha3.VirtualService{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: fmt.Sprintf("%s-channel-", channelName), - Namespace: testNS, - Labels: map[string]string{ - EventingChannelLabel: channelName, - OldEventingChannelLabel: channelName, - EventingProvisionerLabel: clusterChannelProvisionerName, - OldEventingProvisionerLabel: clusterChannelProvisionerName, - }, - OwnerReferences: []metav1.OwnerReference{ - { - APIVersion: eventingv1alpha1.SchemeGroupVersion.String(), - Kind: "Channel", - Name: channelName, - UID: channelUID, - Controller: &truePointer, - BlockOwnerDeletion: &truePointer, - }, - }, - }, - Spec: istiov1alpha3.VirtualServiceSpec{ - Hosts: []string{ - // The fake client doesn't fill in a Name when GeneratedName is used, so the - // Channel's Name will be the empty string. - fmt.Sprintf("%s.%s.svc.%s", "", testNS, utils.GetClusterDomainName()), - fmt.Sprintf("%s.%s.channels.%s", channelName, testNS, utils.GetClusterDomainName()), - }, - HTTP: []istiov1alpha3.HTTPRoute{{ - Rewrite: &istiov1alpha3.HTTPRewrite{ - Authority: fmt.Sprintf("%s.%s.channels.%s", channelName, testNS, utils.GetClusterDomainName()), - }, - Route: []istiov1alpha3.HTTPRouteDestination{{ - Destination: istiov1alpha3.Destination{ - Host: fmt.Sprintf("%s-dispatcher.knative-testing.svc.%s", clusterChannelProvisionerName, utils.GetClusterDomainName()), - Port: istiov1alpha3.PortSelector{ - Number: PortNumber, - }, - }}, - }}, - }, - }, - } -} - -func makeTamperedVirtualService() *istiov1alpha3.VirtualService { - vs := makeVirtualService() - vs.Spec = istiov1alpha3.VirtualServiceSpec{ - Gateways: []string{"tamped by the unit tests"}, - } - return vs -} diff --git a/pkg/reconciler/containersource/containersource_test.go b/pkg/reconciler/containersource/containersource_test.go index eb5a9d8b02b..f27363ab259 100644 --- a/pkg/reconciler/containersource/containersource_test.go +++ b/pkg/reconciler/containersource/containersource_test.go @@ -444,13 +444,6 @@ func makeDeployment(source *sourcesv1alpha1.ContainerSource, replicas int32, lab args := append(source.Spec.Args, fmt.Sprintf("--sink=%s", sinkURI)) env := append(source.Spec.Env, corev1.EnvVar{Name: "SINK", Value: sinkURI}) - annos := map[string]string{ - "sidecar.istio.io/inject": "true", - } - for k, v := range annotations { - annos[k] = v - } - labs := map[string]string{ "eventing.knative.dev/source": source.Name, } @@ -476,7 +469,7 @@ func makeDeployment(source *sourcesv1alpha1.ContainerSource, replicas int32, lab }, Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Annotations: annos, + Annotations: annotations, Labels: labs, }, Spec: corev1.PodSpec{ diff --git a/pkg/reconciler/containersource/resources/deployment.go b/pkg/reconciler/containersource/resources/deployment.go index e84854bdfe3..efefb490ec4 100644 --- a/pkg/reconciler/containersource/resources/deployment.go +++ b/pkg/reconciler/containersource/resources/deployment.go @@ -61,9 +61,6 @@ func MakeDeployment(args ContainerArguments) *appsv1.Deployment { }, Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{ - "sidecar.istio.io/inject": "true", - }, Labels: map[string]string{ sourceLabelKey: args.Name, }, @@ -84,9 +81,11 @@ func MakeDeployment(args ContainerArguments) *appsv1.Deployment { }, } - // Then wire through any annotations from the source. Not a bug by allowing - // the container to override Istio injection. + // Then wire through any annotations from the source. if args.Annotations != nil { + if deploy.Spec.Template.ObjectMeta.Annotations == nil { + deploy.Spec.Template.ObjectMeta.Annotations = make(map[string]string, len(args.Annotations)) + } for k, v := range args.Annotations { deploy.Spec.Template.ObjectMeta.Annotations[k] = v } diff --git a/pkg/reconciler/containersource/resources/deployment_test.go b/pkg/reconciler/containersource/resources/deployment_test.go index f0f544187f2..833ad7ec2b3 100644 --- a/pkg/reconciler/containersource/resources/deployment_test.go +++ b/pkg/reconciler/containersource/resources/deployment_test.go @@ -185,9 +185,6 @@ func TestMakeDeployment_sink(t *testing.T) { }, Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{ - "sidecar.istio.io/inject": "true", - }, Labels: map[string]string{ "eventing.knative.dev/source": "test-name", }, @@ -255,7 +252,6 @@ func TestMakeDeployment_sinkinargs(t *testing.T) { ServiceAccountName: "test-service-account", SinkInArgs: true, Labels: map[string]string{"eventing.knative.dev/source": "test-name"}, - Annotations: map[string]string{"sidecar.istio.io/inject": "true"}, }) want := &appsv1.Deployment{ @@ -283,9 +279,6 @@ func TestMakeDeployment_sinkinargs(t *testing.T) { }, Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{ - "sidecar.istio.io/inject": "true", - }, Labels: map[string]string{ "eventing.knative.dev/source": "test-name", }, diff --git a/pkg/reconciler/cronjobsource/resources/receive_adapter.go b/pkg/reconciler/cronjobsource/resources/receive_adapter.go index f3aca93f50f..7dfee230ab8 100644 --- a/pkg/reconciler/cronjobsource/resources/receive_adapter.go +++ b/pkg/reconciler/cronjobsource/resources/receive_adapter.go @@ -57,9 +57,6 @@ func MakeReceiveAdapter(args *ReceiveAdapterArgs) *v1.Deployment { Replicas: &replicas, Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{ - "sidecar.istio.io/inject": "true", // TODO this might be removed. - }, Labels: args.Labels, }, Spec: corev1.PodSpec{ diff --git a/pkg/reconciler/cronjobsource/resources/receive_adapter_test.go b/pkg/reconciler/cronjobsource/resources/receive_adapter_test.go index e8b2c5fd1df..4c077bcd909 100644 --- a/pkg/reconciler/cronjobsource/resources/receive_adapter_test.go +++ b/pkg/reconciler/cronjobsource/resources/receive_adapter_test.go @@ -78,9 +78,6 @@ func TestMakeReceiveAdapter(t *testing.T) { Replicas: &one, Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{ - "sidecar.istio.io/inject": "true", - }, Labels: map[string]string{ "test-key1": "test-value1", "test-key2": "test-value2", diff --git a/pkg/reconciler/testing/listers.go b/pkg/reconciler/testing/listers.go index 7f7b896b6ab..9048d1f570c 100644 --- a/pkg/reconciler/testing/listers.go +++ b/pkg/reconciler/testing/listers.go @@ -22,9 +22,7 @@ import ( fakeeventingclientset "github.com/knative/eventing/pkg/client/clientset/versioned/fake" eventinglisters "github.com/knative/eventing/pkg/client/listers/eventing/v1alpha1" sourcelisters "github.com/knative/eventing/pkg/client/listers/sources/v1alpha1" - istiov1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" fakesharedclientset "github.com/knative/pkg/client/clientset/versioned/fake" - istiolisters "github.com/knative/pkg/client/listers/istio/v1alpha3" "github.com/knative/pkg/reconciler/testing" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" @@ -118,10 +116,6 @@ func (l *Listers) GetChannelLister() eventinglisters.ChannelLister { return eventinglisters.NewChannelLister(l.indexerFor(&eventingv1alpha1.Channel{})) } -func (l *Listers) GetVirtualServiceLister() istiolisters.VirtualServiceLister { - return istiolisters.NewVirtualServiceLister(l.indexerFor(&istiov1alpha3.VirtualService{})) -} - func (l *Listers) GetCronJobSourceLister() sourcelisters.CronJobSourceLister { return sourcelisters.NewCronJobSourceLister(l.indexerFor(&sourcesv1alpha1.CronJobSource{})) } @@ -134,11 +128,6 @@ func (l *Listers) GetContainerSourceLister() sourcelisters.ContainerSourceLister return sourcelisters.NewContainerSourceLister(l.indexerFor(&sourcesv1alpha1.ContainerSource{})) } -// GetGatewayLister gets lister for Istio Gateway resource. -func (l *Listers) GetGatewayLister() istiolisters.GatewayLister { - return istiolisters.NewGatewayLister(l.indexerFor(&istiov1alpha3.Gateway{})) -} - func (l *Listers) GetDeploymentLister() appsv1listers.DeploymentLister { return appsv1listers.NewDeploymentLister(l.indexerFor(&appsv1.Deployment{})) } diff --git a/pkg/reconciler/v1alpha1/broker/broker_test.go b/pkg/reconciler/v1alpha1/broker/broker_test.go index 524ce825420..9d260c9bf78 100644 --- a/pkg/reconciler/v1alpha1/broker/broker_test.go +++ b/pkg/reconciler/v1alpha1/broker/broker_test.go @@ -189,7 +189,6 @@ func TestReconcile(t *testing.T) { NewDeployment(filterDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.FilterLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(filterSA), WithDeploymentContainer(filterContainerName, filterImage, envVars(filterContainerName), nil)), }, @@ -222,7 +221,6 @@ func TestReconcile(t *testing.T) { NewDeployment(filterDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.FilterLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(filterSA), WithDeploymentContainer(filterContainerName, "some-other-image", envVars(filterContainerName), nil)), }, @@ -240,7 +238,6 @@ func TestReconcile(t *testing.T) { Object: NewDeployment(filterDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.FilterLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(filterSA), WithDeploymentContainer(filterContainerName, filterImage, envVars(filterContainerName), nil)), }}, @@ -266,7 +263,6 @@ func TestReconcile(t *testing.T) { NewDeployment(filterDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.FilterLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(filterSA), WithDeploymentContainer(filterContainerName, filterImage, envVars(filterContainerName), nil)), }, @@ -308,7 +304,6 @@ func TestReconcile(t *testing.T) { NewDeployment(filterDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.FilterLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(filterSA), WithDeploymentContainer(filterContainerName, filterImage, envVars(filterContainerName), nil)), NewService(filterServiceName, testNS, @@ -354,7 +349,6 @@ func TestReconcile(t *testing.T) { NewDeployment(filterDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.FilterLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(filterSA), WithDeploymentContainer(filterContainerName, filterImage, envVars(filterContainerName), nil)), NewService(filterServiceName, testNS, @@ -369,7 +363,6 @@ func TestReconcile(t *testing.T) { NewDeployment(ingressDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.IngressLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(ingressSA), WithDeploymentContainer(ingressContainerName, ingressImage, envVars(ingressContainerName), containerPorts(8080)), ), @@ -404,7 +397,6 @@ func TestReconcile(t *testing.T) { NewDeployment(filterDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.FilterLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(filterSA), WithDeploymentContainer(filterContainerName, filterImage, envVars(filterContainerName), nil)), NewService(filterServiceName, testNS, @@ -414,7 +406,6 @@ func TestReconcile(t *testing.T) { NewDeployment(ingressDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.IngressLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(ingressSA), WithDeploymentContainer(ingressContainerName, ingressImage, envVars(ingressContainerName), containerPorts(9090))), }, @@ -425,7 +416,6 @@ func TestReconcile(t *testing.T) { Object: NewDeployment(ingressDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.IngressLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(ingressSA), WithDeploymentContainer(ingressContainerName, ingressImage, envVars(ingressContainerName), containerPorts(8080))), }}, @@ -459,7 +449,6 @@ func TestReconcile(t *testing.T) { NewDeployment(filterDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.FilterLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(filterSA), WithDeploymentContainer(filterContainerName, filterImage, envVars(filterContainerName), nil)), NewService(filterServiceName, testNS, @@ -469,7 +458,6 @@ func TestReconcile(t *testing.T) { NewDeployment(ingressDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.IngressLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(ingressSA), WithDeploymentContainer(ingressContainerName, ingressImage, envVars(ingressContainerName), containerPorts(8080))), }, @@ -512,7 +500,6 @@ func TestReconcile(t *testing.T) { NewDeployment(filterDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.FilterLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(filterSA), WithDeploymentContainer(filterContainerName, filterImage, envVars(filterContainerName), nil)), NewService(filterServiceName, testNS, @@ -522,7 +509,6 @@ func TestReconcile(t *testing.T) { NewDeployment(ingressDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.IngressLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(ingressSA), WithDeploymentContainer(ingressContainerName, ingressImage, envVars(ingressContainerName), containerPorts(8080))), NewService(ingressServiceName, testNS, @@ -569,7 +555,6 @@ func TestReconcile(t *testing.T) { NewDeployment(filterDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.FilterLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(filterSA), WithDeploymentContainer(filterContainerName, filterImage, envVars(filterContainerName), nil)), NewService(filterServiceName, testNS, @@ -579,7 +564,6 @@ func TestReconcile(t *testing.T) { NewDeployment(ingressDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.IngressLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(ingressSA), WithDeploymentContainer(ingressContainerName, ingressImage, envVars(ingressContainerName), containerPorts(8080))), NewService(ingressServiceName, testNS, @@ -630,7 +614,6 @@ func TestReconcile(t *testing.T) { NewDeployment(filterDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.FilterLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(filterSA), WithDeploymentContainer(filterContainerName, filterImage, envVars(filterContainerName), nil)), NewService(filterServiceName, testNS, @@ -640,7 +623,6 @@ func TestReconcile(t *testing.T) { NewDeployment(ingressDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.IngressLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(ingressSA), WithDeploymentContainer(ingressContainerName, ingressImage, envVars(ingressContainerName), containerPorts(8080))), NewService(ingressServiceName, testNS, @@ -702,7 +684,6 @@ func TestReconcile(t *testing.T) { NewDeployment(filterDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.FilterLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(filterSA), WithDeploymentContainer(filterContainerName, filterImage, envVars(filterContainerName), nil)), NewService(filterServiceName, testNS, @@ -712,7 +693,6 @@ func TestReconcile(t *testing.T) { NewDeployment(ingressDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.IngressLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(ingressSA), WithDeploymentContainer(ingressContainerName, ingressImage, envVars(ingressContainerName), containerPorts(8080))), NewService(ingressServiceName, testNS, @@ -776,7 +756,6 @@ func TestReconcile(t *testing.T) { NewDeployment(filterDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.FilterLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(filterSA), WithDeploymentContainer(filterContainerName, filterImage, envVars(filterContainerName), nil)), NewService(filterServiceName, testNS, @@ -786,7 +765,6 @@ func TestReconcile(t *testing.T) { NewDeployment(ingressDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.IngressLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(ingressSA), WithDeploymentContainer(ingressContainerName, ingressImage, envVars(ingressContainerName), containerPorts(8080))), NewService(ingressServiceName, testNS, @@ -858,7 +836,6 @@ func TestReconcile(t *testing.T) { NewDeployment(filterDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.FilterLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(filterSA), WithDeploymentContainer(filterContainerName, filterImage, envVars(filterContainerName), nil)), NewService(filterServiceName, testNS, @@ -868,7 +845,6 @@ func TestReconcile(t *testing.T) { NewDeployment(ingressDeploymentName, testNS, WithDeploymentOwnerReferences(ownerReferences()), WithDeploymentLabels(resources.IngressLabels(brokerName)), - WithDeploymentAnnotations(annotations()), WithDeploymentServiceAccount(ingressSA), WithDeploymentContainer(ingressContainerName, ingressImage, envVars(ingressContainerName), containerPorts(8080))), NewService(ingressServiceName, testNS, @@ -939,13 +915,6 @@ func channelProvisioner(name string) *corev1.ObjectReference { } } -// TODO remove this once we get rid of istio. -func annotations() map[string]string { - return map[string]string{ - "sidecar.istio.io/inject": "true", - } -} - func envVars(containerName string) []corev1.EnvVar { switch containerName { case filterContainerName: diff --git a/pkg/reconciler/v1alpha1/broker/resources/filter.go b/pkg/reconciler/v1alpha1/broker/resources/filter.go index 74e641badd1..5f64e1370f7 100644 --- a/pkg/reconciler/v1alpha1/broker/resources/filter.go +++ b/pkg/reconciler/v1alpha1/broker/resources/filter.go @@ -57,10 +57,6 @@ func MakeFilterDeployment(args *FilterArgs) *appsv1.Deployment { Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: FilterLabels(args.Broker.Name), - // TODO remove this once we get rid of istio. - Annotations: map[string]string{ - "sidecar.istio.io/inject": "true", - }, }, Spec: corev1.PodSpec{ ServiceAccountName: args.ServiceAccountName, diff --git a/pkg/reconciler/v1alpha1/broker/resources/ingress.go b/pkg/reconciler/v1alpha1/broker/resources/ingress.go index 5721d5654a2..ccd38a58fd1 100644 --- a/pkg/reconciler/v1alpha1/broker/resources/ingress.go +++ b/pkg/reconciler/v1alpha1/broker/resources/ingress.go @@ -58,11 +58,6 @@ func MakeIngress(args *IngressArgs) *appsv1.Deployment { Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: IngressLabels(args.Broker.Name), - // TODO: Remove this annotation once all channels stop using istio virtual service - // https://github.com/knative/eventing/issues/294 - Annotations: map[string]string{ - "sidecar.istio.io/inject": "true", - }, }, Spec: corev1.PodSpec{ ServiceAccountName: args.ServiceAccountName, diff --git a/test/crd.go b/test/crd.go index 046532f5f7b..6d0fd111ad1 100644 --- a/test/crd.go +++ b/test/crd.go @@ -128,9 +128,8 @@ func EventSenderPod(name string, namespace string, sink string, event *CloudEven return &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - Annotations: map[string]string{"sidecar.istio.io/inject": "true"}, + Name: name, + Namespace: namespace, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{{ @@ -162,10 +161,9 @@ func EventSenderPod(name string, namespace string, sink string, event *CloudEven func EventLoggerPod(name string, namespace string, selector map[string]string) *corev1.Pod { return &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - Labels: selector, - Annotations: map[string]string{"sidecar.istio.io/inject": "true"}, + Name: name, + Namespace: namespace, + Labels: selector, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{{ @@ -182,10 +180,9 @@ func EventLoggerPod(name string, namespace string, selector map[string]string) * func EventTransformationPod(name string, namespace string, selector map[string]string, msgPostfix string) *corev1.Pod { return &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - Labels: selector, - Annotations: map[string]string{"sidecar.istio.io/inject": "true"}, + Name: name, + Namespace: namespace, + Labels: selector, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{{ diff --git a/test/e2e/single_event_test.go b/test/e2e/single_event_test.go index c6158cee871..9537f8a538b 100644 --- a/test/e2e/single_event_test.go +++ b/test/e2e/single_event_test.go @@ -85,7 +85,6 @@ func singleEvent(t *testing.T, encoding string) { if err := pkgTest.WaitForLogContent(clients.Kube, loggerPodName, loggerPod.Spec.Containers[0].Name, ns, body); err != nil { logPodLogsForDebugging(clients, loggerPodName, loggerPod.Spec.Containers[0].Name, ns, t.Logf) logPodLogsForDebugging(clients, senderName, "sendevent", ns, t.Logf) - logPodLogsForDebugging(clients, senderName, "istio-proxy", ns, t.Logf) t.Fatalf("String %q not found in logs of logger pod %q: %v", body, loggerPodName, err) } } diff --git a/vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/destinationrule.go b/vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/destinationrule.go deleted file mode 100644 index ec1ff75565a..00000000000 --- a/vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/destinationrule.go +++ /dev/null @@ -1,94 +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. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -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" -) - -// DestinationRuleLister helps list DestinationRules. -type DestinationRuleLister interface { - // List lists all DestinationRules in the indexer. - List(selector labels.Selector) (ret []*v1alpha3.DestinationRule, err error) - // DestinationRules returns an object that can list and get DestinationRules. - DestinationRules(namespace string) DestinationRuleNamespaceLister - DestinationRuleListerExpansion -} - -// destinationRuleLister implements the DestinationRuleLister interface. -type destinationRuleLister struct { - indexer cache.Indexer -} - -// NewDestinationRuleLister returns a new DestinationRuleLister. -func NewDestinationRuleLister(indexer cache.Indexer) DestinationRuleLister { - return &destinationRuleLister{indexer: indexer} -} - -// List lists all DestinationRules in the indexer. -func (s *destinationRuleLister) List(selector labels.Selector) (ret []*v1alpha3.DestinationRule, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha3.DestinationRule)) - }) - return ret, err -} - -// DestinationRules returns an object that can list and get DestinationRules. -func (s *destinationRuleLister) DestinationRules(namespace string) DestinationRuleNamespaceLister { - return destinationRuleNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// DestinationRuleNamespaceLister helps list and get DestinationRules. -type DestinationRuleNamespaceLister interface { - // List lists all DestinationRules in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha3.DestinationRule, err error) - // Get retrieves the DestinationRule from the indexer for a given namespace and name. - Get(name string) (*v1alpha3.DestinationRule, error) - DestinationRuleNamespaceListerExpansion -} - -// destinationRuleNamespaceLister implements the DestinationRuleNamespaceLister -// interface. -type destinationRuleNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all DestinationRules in the indexer for a given namespace. -func (s destinationRuleNamespaceLister) List(selector labels.Selector) (ret []*v1alpha3.DestinationRule, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha3.DestinationRule)) - }) - return ret, err -} - -// Get retrieves the DestinationRule from the indexer for a given namespace and name. -func (s destinationRuleNamespaceLister) Get(name string) (*v1alpha3.DestinationRule, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha3.Resource("destinationrule"), name) - } - return obj.(*v1alpha3.DestinationRule), nil -} diff --git a/vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/expansion_generated.go b/vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/expansion_generated.go deleted file mode 100644 index f3e2ec937f7..00000000000 --- a/vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/expansion_generated.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. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha3 - -// DestinationRuleListerExpansion allows custom methods to be added to -// DestinationRuleLister. -type DestinationRuleListerExpansion interface{} - -// DestinationRuleNamespaceListerExpansion allows custom methods to be added to -// DestinationRuleNamespaceLister. -type DestinationRuleNamespaceListerExpansion interface{} - -// GatewayListerExpansion allows custom methods to be added to -// GatewayLister. -type GatewayListerExpansion interface{} - -// GatewayNamespaceListerExpansion allows custom methods to be added to -// GatewayNamespaceLister. -type GatewayNamespaceListerExpansion interface{} - -// VirtualServiceListerExpansion allows custom methods to be added to -// VirtualServiceLister. -type VirtualServiceListerExpansion interface{} - -// VirtualServiceNamespaceListerExpansion allows custom methods to be added to -// VirtualServiceNamespaceLister. -type VirtualServiceNamespaceListerExpansion interface{} diff --git a/vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/gateway.go b/vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/gateway.go deleted file mode 100644 index 62a78893a63..00000000000 --- a/vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/gateway.go +++ /dev/null @@ -1,94 +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. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -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" -) - -// GatewayLister helps list Gateways. -type GatewayLister interface { - // List lists all Gateways in the indexer. - List(selector labels.Selector) (ret []*v1alpha3.Gateway, err error) - // Gateways returns an object that can list and get Gateways. - Gateways(namespace string) GatewayNamespaceLister - GatewayListerExpansion -} - -// gatewayLister implements the GatewayLister interface. -type gatewayLister struct { - indexer cache.Indexer -} - -// NewGatewayLister returns a new GatewayLister. -func NewGatewayLister(indexer cache.Indexer) GatewayLister { - return &gatewayLister{indexer: indexer} -} - -// List lists all Gateways in the indexer. -func (s *gatewayLister) List(selector labels.Selector) (ret []*v1alpha3.Gateway, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha3.Gateway)) - }) - return ret, err -} - -// Gateways returns an object that can list and get Gateways. -func (s *gatewayLister) Gateways(namespace string) GatewayNamespaceLister { - return gatewayNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// GatewayNamespaceLister helps list and get Gateways. -type GatewayNamespaceLister interface { - // List lists all Gateways in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha3.Gateway, err error) - // Get retrieves the Gateway from the indexer for a given namespace and name. - Get(name string) (*v1alpha3.Gateway, error) - GatewayNamespaceListerExpansion -} - -// gatewayNamespaceLister implements the GatewayNamespaceLister -// interface. -type gatewayNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Gateways in the indexer for a given namespace. -func (s gatewayNamespaceLister) List(selector labels.Selector) (ret []*v1alpha3.Gateway, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha3.Gateway)) - }) - return ret, err -} - -// Get retrieves the Gateway from the indexer for a given namespace and name. -func (s gatewayNamespaceLister) Get(name string) (*v1alpha3.Gateway, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha3.Resource("gateway"), name) - } - return obj.(*v1alpha3.Gateway), nil -} diff --git a/vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/virtualservice.go b/vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/virtualservice.go deleted file mode 100644 index 3284cda81bd..00000000000 --- a/vendor/github.com/knative/pkg/client/listers/istio/v1alpha3/virtualservice.go +++ /dev/null @@ -1,94 +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. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -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" -) - -// VirtualServiceLister helps list VirtualServices. -type VirtualServiceLister interface { - // List lists all VirtualServices in the indexer. - List(selector labels.Selector) (ret []*v1alpha3.VirtualService, err error) - // VirtualServices returns an object that can list and get VirtualServices. - VirtualServices(namespace string) VirtualServiceNamespaceLister - VirtualServiceListerExpansion -} - -// virtualServiceLister implements the VirtualServiceLister interface. -type virtualServiceLister struct { - indexer cache.Indexer -} - -// NewVirtualServiceLister returns a new VirtualServiceLister. -func NewVirtualServiceLister(indexer cache.Indexer) VirtualServiceLister { - return &virtualServiceLister{indexer: indexer} -} - -// List lists all VirtualServices in the indexer. -func (s *virtualServiceLister) List(selector labels.Selector) (ret []*v1alpha3.VirtualService, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha3.VirtualService)) - }) - return ret, err -} - -// VirtualServices returns an object that can list and get VirtualServices. -func (s *virtualServiceLister) VirtualServices(namespace string) VirtualServiceNamespaceLister { - return virtualServiceNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// VirtualServiceNamespaceLister helps list and get VirtualServices. -type VirtualServiceNamespaceLister interface { - // List lists all VirtualServices in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha3.VirtualService, err error) - // Get retrieves the VirtualService from the indexer for a given namespace and name. - Get(name string) (*v1alpha3.VirtualService, error) - VirtualServiceNamespaceListerExpansion -} - -// virtualServiceNamespaceLister implements the VirtualServiceNamespaceLister -// interface. -type virtualServiceNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VirtualServices in the indexer for a given namespace. -func (s virtualServiceNamespaceLister) List(selector labels.Selector) (ret []*v1alpha3.VirtualService, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha3.VirtualService)) - }) - return ret, err -} - -// Get retrieves the VirtualService from the indexer for a given namespace and name. -func (s virtualServiceNamespaceLister) Get(name string) (*v1alpha3.VirtualService, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha3.Resource("virtualservice"), name) - } - return obj.(*v1alpha3.VirtualService), nil -}