Skip to content

Commit

Permalink
Fix dispatcherPodLister and run make generate-release
Browse files Browse the repository at this point in the history
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
  • Loading branch information
pierDipi committed Sep 24, 2024
1 parent 6e9fc1d commit ad34290
Show file tree
Hide file tree
Showing 32 changed files with 665 additions and 358 deletions.
6 changes: 3 additions & 3 deletions control-plane/pkg/reconciler/consumergroup/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import (
"knative.dev/pkg/client/injection/kube/informers/apps/v1/statefulset"
configmapinformer "knative.dev/pkg/client/injection/kube/informers/core/v1/configmap"
nodeinformer "knative.dev/pkg/client/injection/kube/informers/core/v1/node"
podinformer "knative.dev/pkg/client/injection/kube/informers/core/v1/pod"
podinformer "knative.dev/pkg/client/injection/kube/informers/core/v1/pod/filtered"
secretinformer "knative.dev/pkg/client/injection/kube/informers/core/v1/secret"
"knative.dev/pkg/configmap"
"knative.dev/pkg/controller"
Expand Down Expand Up @@ -105,7 +105,7 @@ func NewController(ctx context.Context, watcher configmap.Watcher) *controller.I
logger.Panicf("unable to process required environment variables: %v", err)
}

dispatcherPodInformer := podinformer.Get(ctx, eventing.DispatcherLabelSelectorStr)
dispatcherPodInformer := podinformer.Get(ctx, "app.kubernetes.io/kind=kafka-dispatcher")
dispatcherPodLister := dispatcherPodInformer.Lister()

c := SchedulerConfig{
Expand All @@ -126,7 +126,7 @@ func NewController(ctx context.Context, watcher configmap.Watcher) *controller.I
InternalsClient: internalsclient.Get(ctx).InternalV1alpha1(),
SecretLister: secretinformer.Get(ctx).Lister(),
ConfigMapLister: configmapinformer.Get(ctx).Lister(),
PodLister: podinformer.Get(ctx).Lister(),
PodLister: dispatcherPodLister,
KubeClient: kubeclient.Get(ctx),
NameGenerator: names.SimpleNameGenerator,
InitOffsetsFunc: offset.InitOffsets,
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module knative.dev/eventing-kafka-broker

go 1.22

toolchain go1.22.5

require (
github.com/IBM/sarama v1.43.2
github.com/cloudevents/sdk-go/protocol/kafka_sarama/v2 v2.15.2
Expand Down
18 changes: 8 additions & 10 deletions openshift/ci-operator/build-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# DO NOT EDIT! Generated Dockerfile.

FROM registry.ci.openshift.org/ocp/4.17:cli-artifacts as tools

# Dockerfile to bootstrap build and test in openshift-ci
FROM registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.22-openshift-4.17 as builder

RUN echo "[kubernetes]" >> /etc/yum.repos.d/kubernetes.repo && \
echo "name=Kubernetes" >> /etc/yum.repos.d/kubernetes.repo && \
echo "baseurl=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/" >> /etc/yum.repos.d/kubernetes.repo && \
echo "enabled=1" >> /etc/yum.repos.d/kubernetes.repo && \
echo "gpgcheck=1" >> /etc/yum.repos.d/kubernetes.repo && \
echo "gpgkey=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/repodata/repomd.xml.key" >> /etc/yum.repos.d/kubernetes.repo
ARG TARGETARCH

COPY --from=tools /usr/share/openshift/linux_$TARGETARCH/oc.rhel8 /usr/bin/oc

RUN yum install -y kubectl httpd-tools
RUN ln -s /usr/bin/oc /usr/bin/kubectl

RUN yum install -y httpd-tools

RUN wget https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && \
chmod 700 ./get-helm-3
Expand All @@ -22,6 +23,3 @@ RUN GOFLAGS='' go install github.com/mikefarah/yq/v3@latest
# go install creates $GOPATH/.cache with root permissions, we delete it here
# to avoid permission issues with the runtime users
RUN rm -rf $GOPATH/.cache

# Allow runtime users to add entries to /etc/passwd
RUN chmod g+rw /etc/passwd
35 changes: 24 additions & 11 deletions openshift/ci-operator/knative-images/event_display/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
# DO NOT EDIT! Generated Dockerfile for vendor/knative.dev/eventing/cmd/event_display.
FROM registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.22-openshift-4.17 as builder
ARG GO_BUILDER=registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.22-openshift-4.17
ARG GO_RUNTIME=registry.access.redhat.com/ubi8/ubi-minimal

FROM $GO_BUILDER as builder

COPY . .

RUN mkdir -p /var/run/ko && \
mkdir -p vendor/knative.dev/eventing/cmd/event_display/kodata && \
go build -o /usr/bin/main ./vendor/knative.dev/eventing/cmd/event_display && \
cp -r vendor/knative.dev/eventing/cmd/event_display/kodata /var/run/ko
ENV CGO_ENABLED=1
ENV GOEXPERIMENT=strictfipsruntime

RUN go build -tags strictfipsruntime -o /usr/bin/main ./vendor/knative.dev/eventing/cmd/event_display

FROM registry.access.redhat.com/ubi8/ubi-minimal
FROM $GO_RUNTIME

# install the missing zoneinfo to ubi-minimal
RUN microdnf install tzdata
ARG VERSION=knative-v1.14

COPY --from=builder /usr/bin/main /usr/bin/event_display

USER 65532

COPY --from=builder /usr/bin/main /usr/bin/main
COPY --from=builder /var/run/ko /var/run/ko
ENTRYPOINT ["/usr/bin/main"]
LABEL \
com.redhat.component="openshift-serverless-1-eventing-kafka-broker-event-display-rhel8-container" \
name="openshift-serverless-1/eventing-kafka-broker-event-display-rhel8" \
version=$VERSION \
summary="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Event Display" \
maintainer="serverless-support@redhat.com" \
description="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Event Display" \
io.k8s.display-name="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Event Display" \
io.k8s.description="Red Hat OpenShift Serverless Eventing Kafka Broker Event Display" \
io.openshift.tags="event-display"

ENTRYPOINT ["/usr/bin/event_display"]
35 changes: 24 additions & 11 deletions openshift/ci-operator/knative-images/heartbeats/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
# DO NOT EDIT! Generated Dockerfile for vendor/knative.dev/eventing/cmd/heartbeats.
FROM registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.22-openshift-4.17 as builder
ARG GO_BUILDER=registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.22-openshift-4.17
ARG GO_RUNTIME=registry.access.redhat.com/ubi8/ubi-minimal

FROM $GO_BUILDER as builder

COPY . .

RUN mkdir -p /var/run/ko && \
mkdir -p vendor/knative.dev/eventing/cmd/heartbeats/kodata && \
go build -o /usr/bin/main ./vendor/knative.dev/eventing/cmd/heartbeats && \
cp -r vendor/knative.dev/eventing/cmd/heartbeats/kodata /var/run/ko
ENV CGO_ENABLED=1
ENV GOEXPERIMENT=strictfipsruntime

RUN go build -tags strictfipsruntime -o /usr/bin/main ./vendor/knative.dev/eventing/cmd/heartbeats

FROM registry.access.redhat.com/ubi8/ubi-minimal
FROM $GO_RUNTIME

# install the missing zoneinfo to ubi-minimal
RUN microdnf install tzdata
ARG VERSION=knative-v1.14

COPY --from=builder /usr/bin/main /usr/bin/heartbeats

USER 65532

COPY --from=builder /usr/bin/main /usr/bin/main
COPY --from=builder /var/run/ko /var/run/ko
ENTRYPOINT ["/usr/bin/main"]
LABEL \
com.redhat.component="openshift-serverless-1-eventing-kafka-broker-heartbeats-rhel8-container" \
name="openshift-serverless-1/eventing-kafka-broker-heartbeats-rhel8" \
version=$VERSION \
summary="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Heartbeats" \
maintainer="serverless-support@redhat.com" \
description="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Heartbeats" \
io.k8s.display-name="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Heartbeats" \
io.k8s.description="Red Hat OpenShift Serverless Eventing Kafka Broker Heartbeats" \
io.openshift.tags="heartbeats"

ENTRYPOINT ["/usr/bin/heartbeats"]
35 changes: 24 additions & 11 deletions openshift/ci-operator/knative-images/kafka-controller/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
# DO NOT EDIT! Generated Dockerfile for control-plane/cmd/kafka-controller.
FROM registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.22-openshift-4.17 as builder
ARG GO_BUILDER=registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.22-openshift-4.17
ARG GO_RUNTIME=registry.access.redhat.com/ubi8/ubi-minimal

FROM $GO_BUILDER as builder

COPY . .

RUN mkdir -p /var/run/ko && \
mkdir -p control-plane/cmd/kafka-controller/kodata && \
go build -o /usr/bin/main ./control-plane/cmd/kafka-controller && \
cp -r control-plane/cmd/kafka-controller/kodata /var/run/ko
ENV CGO_ENABLED=1
ENV GOEXPERIMENT=strictfipsruntime

RUN go build -tags strictfipsruntime -o /usr/bin/main ./control-plane/cmd/kafka-controller

FROM registry.access.redhat.com/ubi8/ubi-minimal
FROM $GO_RUNTIME

# install the missing zoneinfo to ubi-minimal
RUN microdnf install tzdata
ARG VERSION=knative-v1.14

COPY --from=builder /usr/bin/main /usr/bin/kafka-controller

USER 65532

COPY --from=builder /usr/bin/main /usr/bin/main
COPY --from=builder /var/run/ko /var/run/ko
ENTRYPOINT ["/usr/bin/main"]
LABEL \
com.redhat.component="openshift-serverless-1-eventing-kafka-broker-kafka-controller-rhel8-container" \
name="openshift-serverless-1/eventing-kafka-broker-kafka-controller-rhel8" \
version=$VERSION \
summary="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Kafka Controller" \
maintainer="serverless-support@redhat.com" \
description="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Kafka Controller" \
io.k8s.display-name="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Kafka Controller" \
io.k8s.description="Red Hat OpenShift Serverless Eventing Kafka Broker Kafka Controller" \
io.openshift.tags="kafka-controller"

ENTRYPOINT ["/usr/bin/kafka-controller"]
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
# DO NOT EDIT! Generated Dockerfile for control-plane/cmd/kafka-source-controller.
FROM registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.22-openshift-4.17 as builder
ARG GO_BUILDER=registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.22-openshift-4.17
ARG GO_RUNTIME=registry.access.redhat.com/ubi8/ubi-minimal

FROM $GO_BUILDER as builder

COPY . .

RUN mkdir -p /var/run/ko && \
mkdir -p control-plane/cmd/kafka-source-controller/kodata && \
go build -o /usr/bin/main ./control-plane/cmd/kafka-source-controller && \
cp -r control-plane/cmd/kafka-source-controller/kodata /var/run/ko
ENV CGO_ENABLED=1
ENV GOEXPERIMENT=strictfipsruntime

RUN go build -tags strictfipsruntime -o /usr/bin/main ./control-plane/cmd/kafka-source-controller

FROM registry.access.redhat.com/ubi8/ubi-minimal
FROM $GO_RUNTIME

# install the missing zoneinfo to ubi-minimal
RUN microdnf install tzdata
ARG VERSION=knative-v1.14

COPY --from=builder /usr/bin/main /usr/bin/kafka-source-controller

USER 65532

COPY --from=builder /usr/bin/main /usr/bin/main
COPY --from=builder /var/run/ko /var/run/ko
ENTRYPOINT ["/usr/bin/main"]
LABEL \
com.redhat.component="openshift-serverless-1-eventing-kafka-broker-kafka-source-controller-rhel8-container" \
name="openshift-serverless-1/eventing-kafka-broker-kafka-source-controller-rhel8" \
version=$VERSION \
summary="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Kafka Source Controller" \
maintainer="serverless-support@redhat.com" \
description="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Kafka Source Controller" \
io.k8s.display-name="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Kafka Source Controller" \
io.k8s.description="Red Hat OpenShift Serverless Eventing Kafka Broker Kafka Source Controller" \
io.openshift.tags="kafka-source-controller"

ENTRYPOINT ["/usr/bin/kafka-source-controller"]
35 changes: 24 additions & 11 deletions openshift/ci-operator/knative-images/migrate/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
# DO NOT EDIT! Generated Dockerfile for vendor/knative.dev/pkg/apiextensions/storageversion/cmd/migrate.
FROM registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.22-openshift-4.17 as builder
ARG GO_BUILDER=registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.22-openshift-4.17
ARG GO_RUNTIME=registry.access.redhat.com/ubi8/ubi-minimal

FROM $GO_BUILDER as builder

COPY . .

RUN mkdir -p /var/run/ko && \
mkdir -p vendor/knative.dev/pkg/apiextensions/storageversion/cmd/migrate/kodata && \
go build -o /usr/bin/main ./vendor/knative.dev/pkg/apiextensions/storageversion/cmd/migrate && \
cp -r vendor/knative.dev/pkg/apiextensions/storageversion/cmd/migrate/kodata /var/run/ko
ENV CGO_ENABLED=1
ENV GOEXPERIMENT=strictfipsruntime

RUN go build -tags strictfipsruntime -o /usr/bin/main ./vendor/knative.dev/pkg/apiextensions/storageversion/cmd/migrate

FROM registry.access.redhat.com/ubi8/ubi-minimal
FROM $GO_RUNTIME

# install the missing zoneinfo to ubi-minimal
RUN microdnf install tzdata
ARG VERSION=knative-v1.14

COPY --from=builder /usr/bin/main /usr/bin/migrate

USER 65532

COPY --from=builder /usr/bin/main /usr/bin/main
COPY --from=builder /var/run/ko /var/run/ko
ENTRYPOINT ["/usr/bin/main"]
LABEL \
com.redhat.component="openshift-serverless-1-eventing-kafka-broker-migrate-rhel8-container" \
name="openshift-serverless-1/eventing-kafka-broker-migrate-rhel8" \
version=$VERSION \
summary="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Migrate" \
maintainer="serverless-support@redhat.com" \
description="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Migrate" \
io.k8s.display-name="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Migrate" \
io.k8s.description="Red Hat OpenShift Serverless Eventing Kafka Broker Migrate" \
io.openshift.tags="migrate"

ENTRYPOINT ["/usr/bin/migrate"]
35 changes: 24 additions & 11 deletions openshift/ci-operator/knative-images/post-install/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
# DO NOT EDIT! Generated Dockerfile for control-plane/cmd/post-install.
FROM registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.22-openshift-4.17 as builder
ARG GO_BUILDER=registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.22-openshift-4.17
ARG GO_RUNTIME=registry.access.redhat.com/ubi8/ubi-minimal

FROM $GO_BUILDER as builder

COPY . .

RUN mkdir -p /var/run/ko && \
mkdir -p control-plane/cmd/post-install/kodata && \
go build -o /usr/bin/main ./control-plane/cmd/post-install && \
cp -r control-plane/cmd/post-install/kodata /var/run/ko
ENV CGO_ENABLED=1
ENV GOEXPERIMENT=strictfipsruntime

RUN go build -tags strictfipsruntime -o /usr/bin/main ./control-plane/cmd/post-install

FROM registry.access.redhat.com/ubi8/ubi-minimal
FROM $GO_RUNTIME

# install the missing zoneinfo to ubi-minimal
RUN microdnf install tzdata
ARG VERSION=knative-v1.14

COPY --from=builder /usr/bin/main /usr/bin/post-install

USER 65532

COPY --from=builder /usr/bin/main /usr/bin/main
COPY --from=builder /var/run/ko /var/run/ko
ENTRYPOINT ["/usr/bin/main"]
LABEL \
com.redhat.component="openshift-serverless-1-eventing-kafka-broker-post-install-rhel8-container" \
name="openshift-serverless-1/eventing-kafka-broker-post-install-rhel8" \
version=$VERSION \
summary="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Post Install" \
maintainer="serverless-support@redhat.com" \
description="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Post Install" \
io.k8s.display-name="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Post Install" \
io.k8s.description="Red Hat OpenShift Serverless Eventing Kafka Broker Post Install" \
io.openshift.tags="post-install"

ENTRYPOINT ["/usr/bin/post-install"]
35 changes: 24 additions & 11 deletions openshift/ci-operator/knative-images/webhook-kafka/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
# DO NOT EDIT! Generated Dockerfile for control-plane/cmd/webhook-kafka.
FROM registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.22-openshift-4.17 as builder
ARG GO_BUILDER=registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.22-openshift-4.17
ARG GO_RUNTIME=registry.access.redhat.com/ubi8/ubi-minimal

FROM $GO_BUILDER as builder

COPY . .

RUN mkdir -p /var/run/ko && \
mkdir -p control-plane/cmd/webhook-kafka/kodata && \
go build -o /usr/bin/main ./control-plane/cmd/webhook-kafka && \
cp -r control-plane/cmd/webhook-kafka/kodata /var/run/ko
ENV CGO_ENABLED=1
ENV GOEXPERIMENT=strictfipsruntime

RUN go build -tags strictfipsruntime -o /usr/bin/main ./control-plane/cmd/webhook-kafka

FROM registry.access.redhat.com/ubi8/ubi-minimal
FROM $GO_RUNTIME

# install the missing zoneinfo to ubi-minimal
RUN microdnf install tzdata
ARG VERSION=knative-v1.14

COPY --from=builder /usr/bin/main /usr/bin/webhook-kafka

USER 65532

COPY --from=builder /usr/bin/main /usr/bin/main
COPY --from=builder /var/run/ko /var/run/ko
ENTRYPOINT ["/usr/bin/main"]
LABEL \
com.redhat.component="openshift-serverless-1-eventing-kafka-broker-webhook-kafka-rhel8-container" \
name="openshift-serverless-1/eventing-kafka-broker-webhook-kafka-rhel8" \
version=$VERSION \
summary="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Webhook Kafka" \
maintainer="serverless-support@redhat.com" \
description="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Webhook Kafka" \
io.k8s.display-name="Red Hat OpenShift Serverless 1 Eventing Kafka Broker Webhook Kafka" \
io.k8s.description="Red Hat OpenShift Serverless Eventing Kafka Broker Webhook Kafka" \
io.openshift.tags="webhook-kafka"

ENTRYPOINT ["/usr/bin/webhook-kafka"]
Loading

0 comments on commit ad34290

Please sign in to comment.