Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce new EventTypeDefinition API/CRD #6999

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"knative.dev/eventing/pkg/reconciler/channel"
"knative.dev/eventing/pkg/reconciler/containersource"
"knative.dev/eventing/pkg/reconciler/eventtype"
"knative.dev/eventing/pkg/reconciler/eventtypedefinition"
"knative.dev/eventing/pkg/reconciler/parallel"
"knative.dev/eventing/pkg/reconciler/pingsource"
"knative.dev/eventing/pkg/reconciler/sequence"
Expand Down Expand Up @@ -80,6 +81,7 @@ func main() {

// Eventing
eventtype.NewController,
eventtypedefinition.NewController,

// Flows
parallel.NewController,
Expand Down
3 changes: 3 additions & 0 deletions cmd/webhook/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*

Check failure on line 1 in cmd/webhook/main.go

View workflow job for this annotation

GitHub Actions / style / Golang / Auto-format and Check

Please run goimports. diff --git a/cmd/webhook/main.go b/cmd/webhook/main.go index a2b877d..8dac3a2 100644 --- a/cmd/webhook/main.go +++ b/cmd/webhook/main.go @@ -18,9 +18,10 @@ package main import ( "context" - eventingv1alpha1 "knative.dev/eventing/pkg/apis/eventing/v1alpha1" "os" + eventingv1alpha1 "knative.dev/eventing/pkg/apis/eventing/v1alpha1" + "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes/scheme"
Copyright 2018 The Knative Authors

Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -18,6 +18,7 @@

import (
"context"
eventingv1alpha1 "knative.dev/eventing/pkg/apis/eventing/v1alpha1"
"os"

"k8s.io/apimachinery/pkg/runtime/schema"
Expand Down Expand Up @@ -66,6 +67,8 @@

var ourTypes = map[schema.GroupVersionKind]resourcesemantics.GenericCRD{
// For group eventing.knative.dev.
// v1alpha1
eventingv1alpha1.SchemeGroupVersion.WithKind("EventTypeDefinition"): &eventingv1alpha1.EventTypeDefinition{},
// v1beta1
eventingv1beta1.SchemeGroupVersion.WithKind("EventType"): &eventingv1beta1.EventType{},
// v1beta2
Expand Down
1 change: 1 addition & 0 deletions config/300-eventtypedefinition.yaml
55 changes: 55 additions & 0 deletions config/core/resources/clustereventtypedefinition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright 2020 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.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: clustereventtypedefinitions.eventing.knative.dev
labels:
knative.dev/crd-install: "true"
app.kubernetes.io/version: devel
app.kubernetes.io/name: knative-eventing
spec:
group: eventing.knative.dev
versions:
- name: v1alpha1
served: true
storage: true
subresources:
status: {}
schema:
openAPIV3Schema:
type: object
x-kubernetes-preserve-unknown-fields: true
additionalPrinterColumns:
- name: Group
type: string
jsonPath: ".spec.group"
- name: SchemaURL
type: string
jsonPath: ".spec.schemaUrl"
- name: Ready
type: string
jsonPath: ".status.conditions[?(@.type==\"Ready\")].status"
- name: Reason
type: string
jsonPath: ".status.conditions[?(@.type==\"Ready\")].reason"
names:
kind: ClusterEventTypeDefinition
plural: clustereventtypedefinitions
singular: clustereventtypedefinition
categories:
- all
- knative
- eventing
scope: Cluster
55 changes: 55 additions & 0 deletions config/core/resources/eventtypedefinition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright 2020 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.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: eventtypedefinitions.eventing.knative.dev
labels:
knative.dev/crd-install: "true"
app.kubernetes.io/version: devel
app.kubernetes.io/name: knative-eventing
spec:
group: eventing.knative.dev
versions:
- name: v1alpha1
served: true
storage: true
subresources:
status: {}
schema:
openAPIV3Schema:
type: object
x-kubernetes-preserve-unknown-fields: true
additionalPrinterColumns:
- name: Group
type: string
jsonPath: ".spec.group"
- name: SchemaURL
type: string
jsonPath: ".spec.schemaUrl"
- name: Ready
type: string
jsonPath: ".status.conditions[?(@.type==\"Ready\")].status"
- name: Reason
type: string
jsonPath: ".status.conditions[?(@.type==\"Ready\")].reason"
names:
kind: EventTypeDefinition
plural: eventtypedefinitions
singular: eventtypedefinition
categories:
- all
- knative
- eventing
scope: Namespaced
2 changes: 2 additions & 0 deletions config/core/roles/controller-clusterroles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ rules:
- "triggers/status"
- "eventtypes"
- "eventtypes/status"
- "eventtypedefinitions"
- "eventtypedefinitions/status"
verbs: *everything

# Eventing resources and finalizers we care about.
Expand Down
3 changes: 3 additions & 0 deletions config/post-install/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ rules:
- "eventtypes"
- "eventtypes/finalizers"
- "eventtypes/status"
- "eventtypedefinitions"
- "eventtypedefinitions/finalizers"
- "eventtypedefinitions/status"
- "triggers"
- "triggers/finalizers"
- "triggers/status"
Expand Down
Loading
Loading