Skip to content

Commit

Permalink
Migrate core interceptors to use InterceptorType CRD
Browse files Browse the repository at this point in the history
This commit does the following:
1. Add YAML definitions for installing each core interceptor using the
new InterceptorType CRD.
2. Modify the EventListener to use the InterceptorType CRD to find the
Interceptor's URL.

Fixes tektoncd#868

Signed-off-by: Dibyo Mukherjee <[email protected]>
  • Loading branch information
dibyom committed Mar 16, 2021
1 parent 052cf8c commit 5a032b7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
22 changes: 0 additions & 22 deletions pkg/interceptors/interceptors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,6 @@ func makeSecret(secretText string) *corev1.Secret {
}
}

func TestResolveToURL(t *testing.T) {
tests := []struct {
name string
getter interceptors.InterceptorGetter
itype string
want string
}{{
name: "ClusterInterceptor has status.address.url",
getter: func(n string) (*triggersv1.ClusterInterceptor, error) {
Expand All @@ -326,19 +320,6 @@ func TestResolveToURL(t *testing.T) {
itype: "cel",
want: "http://some-host/cel",
}, {
name: "ClusterInterceptor does not have a status",
getter: func(n string) (*triggersv1.ClusterInterceptor, error) {
return &triggersv1.ClusterInterceptor{
Spec: triggersv1.ClusterInterceptorSpec{
ClientConfig: triggersv1.ClientConfig{
URL: &apis.URL{
Scheme: "http",
Host: "some-host",
Path: n,
},
},
},
}, nil
},
itype: "cel",
want: "http://some-host/cel",
Expand Down Expand Up @@ -366,9 +347,6 @@ func TestResolveToURL(t *testing.T) {
},
}, nil
}
_, err := interceptors.ResolveToURL(fakeGetter, "cel")
if !errors.Is(err, triggersv1.ErrNilURL) {
t.Fatalf("ResolveToURL expected error to be %s but got %s", triggersv1.ErrNilURL, err)
}
})
}
Expand Down
1 change: 0 additions & 1 deletion pkg/reconciler/v1alpha1/clusterinterceptor/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"knative.dev/pkg/logging"
)

// NewController creates a new instance of an ClusterInterceptor controller.
func NewController() func(context.Context, configmap.Watcher) *controller.Impl {
return func(ctx context.Context, cmw configmap.Watcher) *controller.Impl {
logger := logging.FromContext(ctx)
Expand Down

0 comments on commit 5a032b7

Please sign in to comment.