Skip to content
Merged
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
4 changes: 4 additions & 0 deletions cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import (
"knative.dev/eventing/pkg/reconciler/broker"
"knative.dev/eventing/pkg/reconciler/channel"
"knative.dev/eventing/pkg/reconciler/eventtype"
flowsparallel "knative.dev/eventing/pkg/reconciler/flowsparallel"
flowssequence "knative.dev/eventing/pkg/reconciler/flowssequence"
"knative.dev/eventing/pkg/reconciler/namespace"
"knative.dev/eventing/pkg/reconciler/parallel"
"knative.dev/eventing/pkg/reconciler/sequence"
Expand All @@ -42,5 +44,7 @@ func main() {
eventtype.NewController,
sequence.NewController,
parallel.NewController,
flowsparallel.NewController,
flowssequence.NewController,
)
}
9 changes: 7 additions & 2 deletions cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
eventingduckv1alpha1 "knative.dev/eventing/pkg/apis/duck/v1alpha1"
eventingv1alpha1 "knative.dev/eventing/pkg/apis/eventing/v1alpha1"
flowsv1alpha1 "knative.dev/eventing/pkg/apis/flows/v1alpha1"
messagingv1alpha1 "knative.dev/eventing/pkg/apis/messaging/v1alpha1"
sourcesv1alpha1 "knative.dev/eventing/pkg/apis/sources/v1alpha1"
"knative.dev/eventing/pkg/defaultchannel"
Expand Down Expand Up @@ -66,7 +67,7 @@ func NewResourceAdmissionController(ctx context.Context, cmw configmap.Watcher)

// The resources to validate and default.
map[schema.GroupVersionKind]resourcesemantics.GenericCRD{
// For group eventing.knative.dev,
// For group eventing.knative.dev.
eventingv1alpha1.SchemeGroupVersion.WithKind("Broker"): &eventingv1alpha1.Broker{},
eventingv1alpha1.SchemeGroupVersion.WithKind("Trigger"): &eventingv1alpha1.Trigger{},
eventingv1alpha1.SchemeGroupVersion.WithKind("EventType"): &eventingv1alpha1.EventType{},
Expand All @@ -78,10 +79,14 @@ func NewResourceAdmissionController(ctx context.Context, cmw configmap.Watcher)
messagingv1alpha1.SchemeGroupVersion.WithKind("Channel"): &messagingv1alpha1.Channel{},
messagingv1alpha1.SchemeGroupVersion.WithKind("Subscription"): &messagingv1alpha1.Subscription{},

// For group sources.eventing.knative.dev
// For group sources.eventing.knative.dev.
sourcesv1alpha1.SchemeGroupVersion.WithKind("ApiServerSource"): &sourcesv1alpha1.ApiServerSource{},
sourcesv1alpha1.SchemeGroupVersion.WithKind("ContainerSource"): &sourcesv1alpha1.ContainerSource{},
sourcesv1alpha1.SchemeGroupVersion.WithKind("CronJobSource"): &sourcesv1alpha1.CronJobSource{},

// For group flows.knative.dev
flowsv1alpha1.SchemeGroupVersion.WithKind("Parallel"): &flowsv1alpha1.Parallel{},
flowsv1alpha1.SchemeGroupVersion.WithKind("Sequence"): &flowsv1alpha1.Sequence{},
},

// A function that infuses the context passed to Validate/SetDefaults with custom metadata.
Expand Down
25 changes: 24 additions & 1 deletion config/200-addressable-resolvers-clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,27 @@ rules:
verbs:
- get
- list
- watch
- watch

---

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: flows-addressable-resolver
labels:
eventing.knative.dev/release: devel
duck.knative.dev/addressable: "true"
# Do not use this role directly. These rules will be added to the "addressable-resolver" role.
rules:
- apiGroups:
- flows.knative.dev
resources:
- sequences
- sequences/status
- parallels
- parallels/status
verbs:
- get
- list
- watch
10 changes: 10 additions & 0 deletions config/200-controller-clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ rules:
- "subscriptions/status"
verbs: *everything

# Flow resources and statuses we care about.
- apiGroups:
- "flows.knative.dev"
resources:
- "sequences"
- "sequences/status"
- "parallels"
- "parallels/status"
verbs: *everything

# Messaging resources and finalizers we care about.
- apiGroups:
- "messaging.knative.dev"
Expand Down
209 changes: 209 additions & 0 deletions config/300-flows-parallel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
# 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.
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: parallels.flows.knative.dev
labels:
eventing.knative.dev/release: devel
knative.dev/crd-install: "true"
duck.knative.dev/addressable: "true"
spec:
group: flows.knative.dev
version: v1alpha1
names:
kind: Parallel
plural: parallels
singular: parallel
categories:
- all
- knative
- eventing
- flows
scope: Namespaced
subresources:
status: {}
additionalPrinterColumns:
- name: Ready
type: string
JSONPath: ".status.conditions[?(@.type==\"Ready\")].status"
- name: Reason
type: string
JSONPath: ".status.conditions[?(@.type==\"Ready\")].reason"
- name: URL
type: string
JSONPath: .status.address.url
- name: Age
type: date
JSONPath: .metadata.creationTimestamp
validation:
openAPIV3Schema:
properties:
spec:
required:
- branches
- channelTemplate
properties:
branches:
type: array
description: "the list of filter/subscribers pairs."
items:
type: object
required:
- subscriber
properties:
filter:
type: object
description: "the destination of the filter expression that is guarding the branch."
properties:
ref:
type: object
description: "a reference to a Kubernetes object from which to retrieve the target URI."
required:
- apiVersion
- kind
- name
properties:
apiVersion:
type: string
minLength: 1
kind:
type: string
minLength: 1
name:
type: string
minLength: 1
uri:
type: string
description: "the target URI or, if ref is provided, a relative URI reference that will be combined with ref to produce a target URI."
subscriber:
type: object
description: "the destination of the events if the filter passes."
properties:
ref:
type: object
description: "a reference to a Kubernetes object from which to retrieve the target URI."
required:
- apiVersion
- kind
- name
properties:
apiVersion:
type: string
minLength: 1
kind:
type: string
minLength: 1
name:
type: string
minLength: 1
uri:
type: string
description: "the target URI or, if ref is provided, a relative URI reference that will be combined with ref to produce a target URI."
reply:
description: "a reference to where the result of the subscriber of this branch gets sent to. If not specified, the result is sent to the Parallel reply."
anyOf:
- type: object
properties:
uri:
type: string
description: "the target URI or, if ref is provided, a relative URI reference that will be combined with ref to produce a target URI."
minLength: 1
- type: object
description: "a reference to a Kubernetes object from which to retrieve the target URI."
properties:
ref:
type: object
required:
- apiVersion
- kind
- name
properties:
apiVersion:
type: string
minLength: 1
kind:
type: string
minLength: 1
name:
type: string
minLength: 1
- type: object
description: "a reference to a Kubernetes object from which to retrieve the target URI."
properties:
apiVersion:
type: string
minLength: 1
kind:
type: string
minLength: 1
name:
type: string
minLength: 1
channelTemplate:
type: object
description: "specifies which Channel to use. If left unspecified, it is set to the default Channel for the namespace (or cluster, in case there are no defaults for the namespace)."
required:
- apiVersion
- kind
properties:
apiVersion:
type: string
minLength: 1
kind:
type: string
minLength: 1
spec:
type: object
reply:
type: object
description: "a reference to where the result of a branch subscriber gets sent to when the branch does not have a reply."
anyOf:
- type: object
properties:
uri:
type: string
description: "the target URI or, if ref is provided, a relative URI reference that will be combined with ref to produce a target URI."
minLength: 1
- type: object
description: "a reference to a Kubernetes object from which to retrieve the target URI."
properties:
ref:
type: object
required:
- apiVersion
- kind
- name
properties:
apiVersion:
type: string
minLength: 1
kind:
type: string
minLength: 1
name:
type: string
minLength: 1
- type: object
description: "a reference to a Kubernetes object from which to retrieve the target URI."
properties:
apiVersion:
type: string
minLength: 1
kind:
type: string
minLength: 1
name:
type: string
minLength: 1
Loading