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

Automate knativekafka manifest update in hack/update-manifests.sh, update knativekafka to v0.21.0 #831

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
1,013 changes: 1,013 additions & 0 deletions knative-operator/deploy/resources/knativekafka/1-channel-consolidated.yaml

Large diffs are not rendered by default.

608 changes: 608 additions & 0 deletions knative-operator/deploy/resources/knativekafka/2-source.yaml

Large diffs are not rendered by default.

15 changes: 0 additions & 15 deletions knative-operator/deploy/resources/knativekafka/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ func TestUnallowedResourcesInManifest(t *testing.T) {
path string
fails bool
}{{
path: "./kafkachannel-latest.yaml",
path: "./1-channel-consolidated.yaml",
fails: false,
}, {
path: "./kafkasource-latest.yaml",
path: "./2-source.yaml",
fails: false,
}, {
path: "./testdata/config-logging.yaml",
Expand All @@ -45,7 +45,7 @@ func TestUnallowedResourcesInManifest(t *testing.T) {
}
manifest = manifest.Filter(notAllowed)
if len(manifest.Resources()) > 0 && !test.fails {
t.Fatalf("Manifest at path '%s' has unallowed resources", test.path)
t.Fatalf("Manifest at path '%s' has unallowed resources: %+v", test.path, manifest.Resources())
}
if len(manifest.Resources()) == 0 && test.fails {
t.Fatalf("Manifest at path '%s' should have unallowed resources, but it does not. Perhaps the check for unallowed resources is not working?", test.path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ func TestKnativeKafkaReconcile(t *testing.T) {
t.Run(test.name, func(t *testing.T) {
cl := fake.NewClientBuilder().WithObjects(test.instance).Build()

kafkaChannelManifest, err := mf.ManifestFrom(mf.Path("testdata/kafkachannel-latest.yaml"))
kafkaChannelManifest, err := mf.ManifestFrom(mf.Path("testdata/1-channel-consolidated.yaml"))
if err != nil {
t.Fatalf("failed to load KafkaChannel manifest: %v", err)
}

kafkaSourceManifest, err := mf.ManifestFrom(mf.Path("testdata/kafkasource-latest.yaml"))
kafkaSourceManifest, err := mf.ManifestFrom(mf.Path("testdata/2-source.yaml"))
if err != nil {
t.Fatalf("failed to load KafkaSource manifest: %v", err)
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,9 @@ spec:
- name: KOURIER_MANIFEST_PATH
value: deploy/resources/kourier/kourier-latest.yaml
- name: KAFKACHANNEL_MANIFEST_PATH
value: deploy/resources/knativekafka/kafkachannel-latest.yaml
value: deploy/resources/knativekafka/1-channel-consolidated.yaml
- name: KAFKASOURCE_MANIFEST_PATH
value: deploy/resources/knativekafka/kafkasource-latest.yaml
value: deploy/resources/knativekafka/2-source.yaml
- name: QUICKSTART_MANIFEST_PATH
value: "deploy/resources/quickstart/serverless-application-quickstart.yaml"
- name: "IMAGE_queue-proxy"
Expand Down Expand Up @@ -506,17 +506,17 @@ spec:
- name: "IMAGE_KN_CLI_ARTIFACTS"
value: "registry.ci.openshift.org/openshift/knative-v0.20.0:kn-cli-artifacts"
- name: "KAFKA_IMAGE_kafka-controller-manager__manager"
value: "registry.ci.openshift.org/openshift/knative-v0.20.0:knative-eventing-kafka-source-controller"
value: "registry.ci.openshift.org/openshift/knative-v0.21.0:knative-eventing-kafka-source-controller"
- name: "KAFKA_IMAGE_KAFKA_RA_IMAGE"
value: "registry.ci.openshift.org/openshift/knative-v0.20.0:knative-eventing-kafka-receive-adapter"
value: "registry.ci.openshift.org/openshift/knative-v0.21.0:knative-eventing-kafka-receive-adapter"
- name: "KAFKA_IMAGE_kafka-ch-controller__controller"
value: "registry.ci.openshift.org/openshift/knative-v0.20.0:knative-eventing-kafka-consolidated-controller"
value: "registry.ci.openshift.org/openshift/knative-v0.21.0:knative-eventing-kafka-consolidated-controller"
- name: "KAFKA_IMAGE_DISPATCHER_IMAGE"
value: "registry.ci.openshift.org/openshift/knative-v0.20.0:knative-eventing-kafka-consolidated-dispatcher"
value: "registry.ci.openshift.org/openshift/knative-v0.21.0:knative-eventing-kafka-consolidated-dispatcher"
- name: "KAFKA_IMAGE_kafka-ch-dispatcher__dispatcher"
value: "registry.ci.openshift.org/openshift/knative-v0.20.0:knative-eventing-kafka-consolidated-dispatcher"
value: "registry.ci.openshift.org/openshift/knative-v0.21.0:knative-eventing-kafka-consolidated-dispatcher"
- name: "KAFKA_IMAGE_kafka-webhook__kafka-webhook"
value: "registry.ci.openshift.org/openshift/knative-v0.20.0:knative-eventing-kafka-webhook"
value: "registry.ci.openshift.org/openshift/knative-v0.21.0:knative-eventing-kafka-webhook"
- name: knative-openshift-ingress
spec:
replicas: 1
Expand Down Expand Up @@ -797,16 +797,16 @@ spec:
- name: "IMAGE_KN_CLI_ARTIFACTS"
image: "registry.ci.openshift.org/openshift/knative-v0.20.0:kn-cli-artifacts"
- name: "KAFKA_IMAGE_kafka-controller-manager__manager"
image: "registry.ci.openshift.org/openshift/knative-v0.20.0:knative-eventing-kafka-source-controller"
image: "registry.ci.openshift.org/openshift/knative-v0.21.0:knative-eventing-kafka-source-controller"
- name: "KAFKA_IMAGE_KAFKA_RA_IMAGE"
image: "registry.ci.openshift.org/openshift/knative-v0.20.0:knative-eventing-kafka-receive-adapter"
image: "registry.ci.openshift.org/openshift/knative-v0.21.0:knative-eventing-kafka-receive-adapter"
- name: "KAFKA_IMAGE_kafka-ch-controller__controller"
image: "registry.ci.openshift.org/openshift/knative-v0.20.0:knative-eventing-kafka-consolidated-controller"
image: "registry.ci.openshift.org/openshift/knative-v0.21.0:knative-eventing-kafka-consolidated-controller"
- name: "KAFKA_IMAGE_DISPATCHER_IMAGE"
image: "registry.ci.openshift.org/openshift/knative-v0.20.0:knative-eventing-kafka-consolidated-dispatcher"
image: "registry.ci.openshift.org/openshift/knative-v0.21.0:knative-eventing-kafka-consolidated-dispatcher"
- name: "KAFKA_IMAGE_kafka-ch-dispatcher__dispatcher"
image: "registry.ci.openshift.org/openshift/knative-v0.20.0:knative-eventing-kafka-consolidated-dispatcher"
image: "registry.ci.openshift.org/openshift/knative-v0.21.0:knative-eventing-kafka-consolidated-dispatcher"
- name: "KAFKA_IMAGE_kafka-webhook__kafka-webhook"
image: "registry.ci.openshift.org/openshift/knative-v0.20.0:knative-eventing-kafka-webhook"
image: "registry.ci.openshift.org/openshift/knative-v0.21.0:knative-eventing-kafka-webhook"
replaces: serverless-operator.v1.14.0
version: 1.15.0
2 changes: 1 addition & 1 deletion olm-catalog/serverless-operator/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ requirements:
dependencies:
serving: 0.21.0
eventing: 0.21.0
eventing_kafka: 0.20.0
eventing_kafka: 0.21.0
kourier: 0.21.0
cli: 0.20.0
maistra: 2.0.0
27 changes: 19 additions & 8 deletions openshift-knative-operator/hack/update-manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,41 @@ source "$root/hack/lib/__sources__.bash"
# be fairly stable.
serving_files=(serving-crds serving-core serving-hpa serving-domainmapping-crds serving-domainmapping serving-post-install-jobs)
eventing_files=(eventing-crds eventing-core in-memory-channel mt-channel-broker eventing-sugar-controller)
kafka_files=(channel-consolidated source)

function download {
component=$1
version=$2
org=$3
shift
shift
shift

files=("$@")
local component_dir=""
local target_dir=""
if [[ $component == "eventing-kafka" ]]; then
component_dir="$root/knative-operator/deploy/resources/knativekafka/"
target_dir="${component_dir}/"
else
component_dir="$root/openshift-knative-operator/cmd/operator/kodata/knative-${component}"
target_dir="${component_dir}/${version:1}"
rm -r "$component_dir"
mkdir -p "$target_dir"
fi

component_dir="$root/openshift-knative-operator/cmd/operator/kodata/knative-${component}"
target_dir="${component_dir}/${version:1}"
rm -r "$component_dir"
mkdir -p "$target_dir"

for (( i=0; i<${#files[@]}; i++ ));
do
index=$(( i+1 ))
file="${files[$i]}.yaml"
target_file="$target_dir/$index-$file"
url="https://github.com/knative/$component/releases/download/$version/$file"
url="https://github.com/$org/$component/releases/download/$version/$file"

wget --no-check-certificate "$url" -O "$target_file"
done
}

download serving "$KNATIVE_SERVING_VERSION" "${serving_files[@]}"
download serving "$KNATIVE_SERVING_VERSION" "knative" "${serving_files[@]}"
lberk marked this conversation as resolved.
Show resolved Hide resolved

# Create an empty ingress directory.
# TODO: Investigate moving Kourier into here rather than "manually" installing it via
Expand All @@ -50,9 +59,11 @@ touch "$ingress_dir/.gitkeep"
# See also https://issues.redhat.com/browse/SRVKS-670.
git apply "$root/openshift-knative-operator/hack/003-serving-pdb.patch"

download eventing "$KNATIVE_EVENTING_VERSION" "${eventing_files[@]}"
download eventing "$KNATIVE_EVENTING_VERSION" "knative" "${eventing_files[@]}"
# Extra ClusterRole for downstream, so that users can get the CMs of knative-eventing
# TODO: propose to upstream
git apply "$root/openshift-knative-operator/hack/002-openshift-eventing-role.patch"
# For SRVKE-629 we disable HPA:
git apply "$root/openshift-knative-operator/hack/005-disable-hpa.patch"

download eventing-kafka "$KNATIVE_EVENTING_KAFKA_VERSION" "knative-sandbox" "${kafka_files[@]}"
2 changes: 1 addition & 1 deletion openshift/ci-operator/source-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ FROM src
COPY oc /usr/bin/oc
COPY --from=registry.ci.openshift.org/openshift/knative-v0.21.0:knative-serving-src /go/src/knative.dev/serving/ /go/src/knative.dev/serving/
COPY --from=registry.ci.openshift.org/openshift/knative-v0.21.0:knative-eventing-src /go/src/knative.dev/eventing/ /go/src/knative.dev/eventing/
COPY --from=registry.ci.openshift.org/openshift/knative-v0.20.0:knative-eventing-kafka-src /go/src/knative.dev/eventing-kafka/ /go/src/knative.dev/eventing-kafka/
COPY --from=registry.ci.openshift.org/openshift/knative-v0.21.0:knative-eventing-kafka-src /go/src/knative.dev/eventing-kafka/ /go/src/knative.dev/eventing-kafka/

RUN chmod g+w /go/src/knative.dev/serving/ && chmod g+w /go/src/knative.dev/eventing/ && chmod g+w /go/src/knative.dev/eventing-kafka/
4 changes: 2 additions & 2 deletions templates/csv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,9 @@ spec:
- name: KOURIER_MANIFEST_PATH
value: deploy/resources/kourier/kourier-latest.yaml
- name: KAFKACHANNEL_MANIFEST_PATH
value: deploy/resources/knativekafka/kafkachannel-latest.yaml
value: deploy/resources/knativekafka/1-channel-consolidated.yaml
- name: KAFKASOURCE_MANIFEST_PATH
value: deploy/resources/knativekafka/kafkasource-latest.yaml
value: deploy/resources/knativekafka/2-source.yaml
- name: QUICKSTART_MANIFEST_PATH
value: "deploy/resources/quickstart/serverless-application-quickstart.yaml"
- name: knative-openshift-ingress
Expand Down