-
Notifications
You must be signed in to change notification settings - Fork 70
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
Enable Knative Kafka w/o upstream e2e tests and w/o smoke tests #587
Merged
openshift-merge-robot
merged 6 commits into
openshift-knative:master
from
aliok:001-enable-knative-kafka
Oct 22, 2020
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
54d28ef
Enable KnativeKafka
aliok 7f2fa40
Remove version statusDescriptor for KnativeKafka
aliok 5ccf152
Fix env vars in makefile
aliok 5a1e976
No errors.Wrapf(...)
aliok 14d7171
Install serverless operator before downstream tests
aliok 78b1665
Fix a problem when creating KnativeKafka in operator e2e tests
aliok File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Enable KnativeKafka
- Loading branch information
commit 54d28ef91e8cab8006d2aec63b30365a269b5bee
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
function install_strimzi { | ||
strimzi_version=`curl https://github.com/strimzi/strimzi-kafka-operator/releases/latest | awk -F 'tag/' '{print $2}' | awk -F '"' '{print $1}' 2>/dev/null` | ||
header "Strimzi install" | ||
oc create namespace kafka | ||
oc -n kafka apply --selector strimzi.io/crd-install=true -f "https://github.com/strimzi/strimzi-kafka-operator/releases/download/${strimzi_version}/strimzi-cluster-operator-${strimzi_version}.yaml" | ||
curl -L "https://github.com/strimzi/strimzi-kafka-operator/releases/download/${strimzi_version}/strimzi-cluster-operator-${strimzi_version}.yaml" \ | ||
| sed 's/namespace: .*/namespace: kafka/' \ | ||
| oc -n kafka apply -f - | ||
|
||
header "Applying Strimzi Cluster file" | ||
oc -n kafka apply -f "https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/${strimzi_version}/examples/kafka/kafka-persistent.yaml" | ||
|
||
header "Waiting for Strimzi to become ready" | ||
oc wait deployment --all --timeout=-1s --for=condition=Available -n kafka | ||
} | ||
|
||
function uninstall_strimzi { | ||
strimzi_version=`curl https://github.com/strimzi/strimzi-kafka-operator/releases/latest | awk -F 'tag/' '{print $2}' | awk -F '"' '{print $1}' 2>/dev/null` | ||
|
||
header "Deleting Kafka instance" | ||
oc -n kafka delete -f "https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/${strimzi_version}/examples/kafka/kafka-persistent.yaml" | ||
|
||
header "Waiting for Kafka to get deleted" | ||
timeout 600 "[[ \$(oc get kafkas -n kafka -o jsonpath='{.items}') != '[]' ]]" || return 2 | ||
|
||
header "Deleting Strimzi Cluster file" | ||
curl -L "https://github.com/strimzi/strimzi-kafka-operator/releases/download/${strimzi_version}/strimzi-cluster-operator-${strimzi_version}.yaml" \ | ||
| sed 's/namespace: .*/namespace: kafka/' \ | ||
| oc -n kafka delete -f - | ||
|
||
oc -n kafka delete --selector strimzi.io/crd-install=true -f "https://github.com/strimzi/strimzi-kafka-operator/releases/download/${strimzi_version}/strimzi-cluster-operator-${strimzi_version}.yaml" | ||
|
||
oc delete namespace kafka | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script can be used to install Strimzi and create a Kafka instance on cluster. | ||
# | ||
# shellcheck disable=SC1091,SC1090 | ||
source "$(dirname "${BASH_SOURCE[0]}")/lib/__sources__.bash" | ||
|
||
set -Eeuo pipefail | ||
|
||
if [[ $UNINSTALL_STRIMZI == "true" ]]; then | ||
uninstall_strimzi || exit 1 | ||
else | ||
install_strimzi || exit 2 | ||
fi | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
package controller | ||
|
||
//import ( | ||
// "github.com/openshift-knative/serverless-operator/knative-operator/pkg/controller/knativekafka" | ||
//) | ||
import ( | ||
"github.com/openshift-knative/serverless-operator/knative-operator/pkg/controller/knativekafka" | ||
) | ||
|
||
func init() { | ||
// AddToManagerFuncs is a list of functions to create controllers and add them to a manager. | ||
// TODO: temp change to disable KnativeKafka reconciliation | ||
// AddToManagerFuncs = append(AddToManagerFuncs, knativekafka.Add) | ||
AddToManagerFuncs = append(AddToManagerFuncs, knativekafka.Add) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
package webhook | ||
|
||
// | ||
//import ( | ||
// kk "github.com/openshift-knative/serverless-operator/knative-operator/pkg/webhook/knativekafka" | ||
//) | ||
// | ||
//func init() { | ||
// AddToManagerFuncs = append(AddToManagerFuncs, kk.ValidatingWebhook) | ||
//} | ||
import ( | ||
kk "github.com/openshift-knative/serverless-operator/knative-operator/pkg/webhook/knativekafka" | ||
) | ||
|
||
func init() { | ||
AddToManagerFuncs = append(AddToManagerFuncs, kk.ValidatingWebhook) | ||
} |
115 changes: 115 additions & 0 deletions
115
olm-catalog/serverless-operator/manifests/operator_v1alpha1_knativekafka_crd.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: knativekafkas.operator.serverless.openshift.io | ||
spec: | ||
group: operator.serverless.openshift.io | ||
names: | ||
kind: KnativeKafka | ||
listKind: KnativeKafkaList | ||
plural: knativekafkas | ||
singular: knativekafka | ||
scope: Namespaced | ||
subresources: | ||
status: {} | ||
validation: | ||
openAPIV3Schema: | ||
description: KnativeKafka is the Schema for the knativekafkas API | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation | ||
of an object. Servers should convert recognized schemas to the latest | ||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this | ||
object represents. Servers may infer this from the endpoint the client | ||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
properties: | ||
channel: | ||
description: Allows configuration for KafkaChannel installation | ||
properties: | ||
bootstrapServers: | ||
description: BootstrapServers is comma separated string of bootstrapservers | ||
that the KafkaChannels will use | ||
type: string | ||
enabled: | ||
description: Enabled defines if the KafkaChannel installation is | ||
enabled | ||
type: boolean | ||
required: | ||
- enabled | ||
type: object | ||
source: | ||
description: Allows configuration for KafkaSource installation | ||
properties: | ||
enabled: | ||
description: Enabled defines if the KafkaSource installation is | ||
enabled | ||
type: boolean | ||
required: | ||
- enabled | ||
type: object | ||
required: | ||
- channel | ||
- source | ||
type: object | ||
status: | ||
properties: | ||
annotations: | ||
additionalProperties: | ||
type: string | ||
description: Annotations is additional Status fields for the Resource | ||
to save some additional State as well as convey more information to | ||
the user. This is roughly akin to Annotations on any k8s resource, | ||
just the reconciler conveying richer information outwards. | ||
type: object | ||
conditions: | ||
description: Conditions the latest available observations of a resource's | ||
current state. +patchMergeKey=type +patchStrategy=merge | ||
items: | ||
properties: | ||
lastTransitionTime: | ||
description: LastTransitionTime is the last time the condition | ||
transitioned from one status to another. We use VolatileTime | ||
in place of metav1.Time to exclude this from creating equality.Semantic | ||
differences (all other things held constant). | ||
type: string | ||
message: | ||
description: A human readable message indicating details about | ||
the transition. | ||
type: string | ||
reason: | ||
description: The reason for the condition's last transition. | ||
type: string | ||
severity: | ||
description: Severity with which to treat failures of this type | ||
of condition. When this is not specified, it defaults to Error. | ||
type: string | ||
status: | ||
description: Status of the condition, one of True, False, Unknown. | ||
+required | ||
type: string | ||
type: | ||
description: Type of condition. +required | ||
type: string | ||
required: | ||
- type | ||
- status | ||
type: object | ||
type: array | ||
observedGeneration: | ||
description: ObservedGeneration is the 'Generation' of the Service that | ||
was last processed by the controller. | ||
format: int64 | ||
type: integer | ||
type: object | ||
version: v1alpha1 | ||
versions: | ||
- name: v1alpha1 | ||
served: true | ||
storage: true |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be the v1 based CRD?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on v1 CRD.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have moved my "old" PR for CRD_v1 now to Ali's brach:
aliok#5
See the old reference for the size of the DIFF - I've now closed my old CRD_v1 PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna merge that after CI reports success/fail here
Don't want to interrupt it. I want to see the results
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do this separately. I had trouble doing this. I received strange OLM errors. Perhaps unrelated.
Doing it in a separate PR makes more sense anyway since we already have the CRD with v1beta1 in master and that change is not in this PR's scope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did my PR for your branch not work @aliok ?
But I can do it later as separate PR 🤷🏻♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, let's do that separately once we merge this PR.