From 3549630d32f83c225d1d62f3cfe51758be3f6bd6 Mon Sep 17 00:00:00 2001 From: jiangpengcheng Date: Fri, 8 Aug 2025 17:54:26 +0800 Subject: [PATCH 1/3] Use POD_NAME as the name for filebeat sidecar container --- controllers/spec/common.go | 4 ++-- controllers/spec/template/filebeat-config.yaml.tmpl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/spec/common.go b/controllers/spec/common.go index 49ed1d845..cdacec255 100644 --- a/controllers/spec/common.go +++ b/controllers/spec/common.go @@ -2407,8 +2407,8 @@ func makeFilebeatContainer(volumeMounts []corev1.VolumeMount, envVar []corev1.En Name: "logTopic", Value: logTopic, }, corev1.EnvVar{ - Name: "logName", - Value: name, + Name: "POD_NAME", + ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.name"}}, }) if authConfig != nil { diff --git a/controllers/spec/template/filebeat-config.yaml.tmpl b/controllers/spec/template/filebeat-config.yaml.tmpl index 6d20f306b..a7cb52ac4 100644 --- a/controllers/spec/template/filebeat-config.yaml.tmpl +++ b/controllers/spec/template/filebeat-config.yaml.tmpl @@ -6,7 +6,7 @@ output.pulsar: fast_fail: true url: \${brokerServiceURL} topic: \${logTopic} - name: \${logName} + name: \${POD_NAME} token: \${clientAuthenticationParameters:""} oauth2: enabled: \${oauth2Enabled:false} From cee627e24b3bf51e4233371cfb7184bf007b0c71 Mon Sep 17 00:00:00 2001 From: jiangpengcheng Date: Mon, 11 Aug 2025 09:01:02 +0800 Subject: [PATCH 2/3] Upgrade go to 1.24.6 --- .github/workflows/bundle-release.yml | 8 ++++---- .github/workflows/olm-verify.yml | 4 ++-- .github/workflows/project.yml | 2 +- .github/workflows/release.yml | 4 ++-- .github/workflows/test-helm-charts.yml | 4 ++-- .github/workflows/trivy.yml | 4 ++-- .github/workflows/trivy_scheduled_master.yml | 4 ++-- Dockerfile | 2 +- api/go.mod | 2 +- go.mod | 2 +- images/samples/go-function-samples/Dockerfile | 2 +- images/samples/go-function-samples/func/go.mod | 2 +- redhat.Dockerfile | 2 +- 13 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/bundle-release.yml b/.github/workflows/bundle-release.yml index 44ed6c383..57dd96ce6 100644 --- a/.github/workflows/bundle-release.yml +++ b/.github/workflows/bundle-release.yml @@ -49,10 +49,10 @@ jobs: username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Set up GO 1.24.4 + - name: Set up GO 1.24.6 uses: actions/setup-go@v1 with: - go-version: 1.24.4 + go-version: 1.24.6 id: go - name: InstallKubebuilder @@ -180,10 +180,10 @@ jobs: username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Set up GO 1.24.4 + - name: Set up GO 1.24.6 uses: actions/setup-go@v1 with: - go-version: 1.24.4 + go-version: 1.24.6 id: go - name: InstallKubebuilder diff --git a/.github/workflows/olm-verify.yml b/.github/workflows/olm-verify.yml index 6dff4f683..e12a19f8a 100644 --- a/.github/workflows/olm-verify.yml +++ b/.github/workflows/olm-verify.yml @@ -34,10 +34,10 @@ jobs: - name: checkout uses: actions/checkout@v2 - - name: Set up GO 1.24.4 + - name: Set up GO 1.24.6 uses: actions/setup-go@v1 with: - go-version: 1.24.4 + go-version: 1.24.6 id: go - name: InstallKubebuilder diff --git a/.github/workflows/project.yml b/.github/workflows/project.yml index 5edc6b22c..1b5e764fa 100644 --- a/.github/workflows/project.yml +++ b/.github/workflows/project.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - go-version: [1.22.12, 1.24.4] + go-version: [1.22.12, 1.24.6] steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@v1.3.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 61543dc26..2e328fd80 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,10 +37,10 @@ jobs: username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Set up GO 1.24.4 + - name: Set up GO 1.24.6 uses: actions/setup-go@v1 with: - go-version: 1.24.4 + go-version: 1.24.6 id: go - name: InstallKubebuilder diff --git a/.github/workflows/test-helm-charts.yml b/.github/workflows/test-helm-charts.yml index 1d51288a9..c9ed41e0f 100644 --- a/.github/workflows/test-helm-charts.yml +++ b/.github/workflows/test-helm-charts.yml @@ -83,11 +83,11 @@ jobs: run: hack/kind-cluster-build.sh --name chart-testing -c 1 -v 10 --k8sVersion v1.23.17 if: steps.list-changed.outputs.changed == 'true' - - name: Set up GO 1.24.4 + - name: Set up GO 1.24.6 if: steps.list-changed.outputs.changed == 'true' uses: actions/setup-go@v1 with: - go-version: 1.24.4 + go-version: 1.24.6 id: go - name: setup kubebuilder 3.6.0 diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml index 6d34de1a6..a2c298946 100644 --- a/.github/workflows/trivy.yml +++ b/.github/workflows/trivy.yml @@ -34,10 +34,10 @@ jobs: repository: ${{github.event.pull_request.head.repo.full_name}} ref: ${{ github.event.pull_request.head.sha }} - - name: Set up GO 1.24.4 + - name: Set up GO 1.24.6 uses: actions/setup-go@v1 with: - go-version: 1.24.4 + go-version: 1.24.6 id: go - name: InstallKubebuilder diff --git a/.github/workflows/trivy_scheduled_master.yml b/.github/workflows/trivy_scheduled_master.yml index 7b9cd36db..cd63554f0 100644 --- a/.github/workflows/trivy_scheduled_master.yml +++ b/.github/workflows/trivy_scheduled_master.yml @@ -45,10 +45,10 @@ jobs: repository: ${{github.event.pull_request.head.repo.full_name}} ref: ${{ github.event.pull_request.head.sha }} - - name: Set up GO 1.24.4 + - name: Set up GO 1.24.6 uses: actions/setup-go@v1 with: - go-version: 1.24.4 + go-version: 1.24.6 id: go - name: InstallKubebuilder diff --git a/Dockerfile b/Dockerfile index 066d424b6..03758e78c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.24.4-bullseye as builder +FROM golang:1.24.6-bullseye as builder WORKDIR /workspace/api COPY api/ . diff --git a/api/go.mod b/api/go.mod index 49fc4b224..3da3ac8e2 100644 --- a/api/go.mod +++ b/api/go.mod @@ -1,6 +1,6 @@ module github.com/streamnative/function-mesh/api -go 1.24.4 +go 1.24.6 require ( k8s.io/api v0.30.9 diff --git a/go.mod b/go.mod index 2f6e95fe3..181b0ede3 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/streamnative/function-mesh -go 1.24.4 +go 1.24.6 require ( github.com/apache/pulsar-client-go v0.9.1-0.20230816081803-fbee610ddcbf diff --git a/images/samples/go-function-samples/Dockerfile b/images/samples/go-function-samples/Dockerfile index 1c6412317..891e0973c 100644 --- a/images/samples/go-function-samples/Dockerfile +++ b/images/samples/go-function-samples/Dockerfile @@ -1,5 +1,5 @@ ARG PULSAR_IMAGE_TAG -FROM golang:1.24.4-bullseye as builder +FROM golang:1.24.6-bullseye as builder WORKDIR /workspace # Copy the Go Modules manifests diff --git a/images/samples/go-function-samples/func/go.mod b/images/samples/go-function-samples/func/go.mod index f128a66c6..1d6a92e8b 100644 --- a/images/samples/go-function-samples/func/go.mod +++ b/images/samples/go-function-samples/func/go.mod @@ -1,6 +1,6 @@ module github.com/apache/pulsar/pulsar-function-go/examples -go 1.24.4 +go 1.24.6 require github.com/apache/pulsar/pulsar-function-go v0.0.0-20250430085326-611dc3f360b5 diff --git a/redhat.Dockerfile b/redhat.Dockerfile index 06a17376a..397fe0b10 100644 --- a/redhat.Dockerfile +++ b/redhat.Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.24.4-bullseye as builder +FROM golang:1.24.6-bullseye as builder WORKDIR /workspace/api COPY api/ . From 320e8952f6068fe1ed5264e73212a0880bb013e5 Mon Sep 17 00:00:00 2001 From: jiangpengcheng Date: Mon, 11 Aug 2025 10:02:19 +0800 Subject: [PATCH 3/3] Fix style --- controllers/spec/common.go | 6 +++--- controllers/spec/function.go | 2 +- controllers/spec/function_test.go | 2 +- controllers/spec/sink.go | 2 +- controllers/spec/source.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/controllers/spec/common.go b/controllers/spec/common.go index cdacec255..30f8a7f84 100644 --- a/controllers/spec/common.go +++ b/controllers/spec/common.go @@ -218,11 +218,11 @@ func MakeHeadlessServiceName(serviceName string) string { func MakeStatefulSet(objectMeta *metav1.ObjectMeta, replicas *int32, downloaderImage string, container *corev1.Container, volumes []corev1.Volume, labels map[string]string, policy v1alpha1.PodPolicy, authConfig *v1alpha1.AuthConfig, tlsConfig TLSConfig, pulsarConfig, authSecret, tlsSecret string, javaRuntime *v1alpha1.JavaRuntime, - pythonRuntime *v1alpha1.PythonRuntime, goRuntime *v1alpha1.GoRuntime, env []corev1.EnvVar, name, logTopic, filebeatImage string, + pythonRuntime *v1alpha1.PythonRuntime, goRuntime *v1alpha1.GoRuntime, env []corev1.EnvVar, logTopic, filebeatImage string, logTopicAgent v1alpha1.LogTopicAgent, definedVolumeMounts []corev1.VolumeMount, volumeClaimTemplates []corev1.PersistentVolumeClaim, persistentVolumeClaimRetentionPolicy *appsv1.StatefulSetPersistentVolumeClaimRetentionPolicy) *appsv1.StatefulSet { - filebeatContainer := makeFilebeatContainer(definedVolumeMounts, env, name, logTopic, logTopicAgent, tlsConfig, authConfig, pulsarConfig, tlsSecret, authSecret, filebeatImage) + filebeatContainer := makeFilebeatContainer(definedVolumeMounts, env, logTopic, logTopicAgent, tlsConfig, authConfig, pulsarConfig, tlsSecret, authSecret, filebeatImage) volumeMounts := generateDownloaderVolumeMountsForDownloader(javaRuntime, pythonRuntime, goRuntime) var downloaderContainer *corev1.Container @@ -2387,7 +2387,7 @@ func getSubscriptionNameOrDefault(subscription, tenant, namespace, name string) return subscription } -func makeFilebeatContainer(volumeMounts []corev1.VolumeMount, envVar []corev1.EnvVar, name string, logTopic string, +func makeFilebeatContainer(volumeMounts []corev1.VolumeMount, envVar []corev1.EnvVar, logTopic string, agent v1alpha1.LogTopicAgent, tlsConfig TLSConfig, authConfig *v1alpha1.AuthConfig, pulsarConfig string, authSecret string, tlsSecret string, image string) *corev1.Container { if logTopic == "" || agent != v1alpha1.SIDECAR { diff --git a/controllers/spec/function.go b/controllers/spec/function.go index a1b8e1651..2b5a321c2 100644 --- a/controllers/spec/function.go +++ b/controllers/spec/function.go @@ -69,7 +69,7 @@ func MakeFunctionStatefulSet(ctx context.Context, cli client.Client, function *v statefulSet := MakeStatefulSet(objectMeta, function.Spec.Replicas, function.Spec.DownloaderImage, makeFunctionContainer(function), makeFunctionVolumes(function, function.Spec.Pulsar.AuthConfig), labels, function.Spec.Pod, function.Spec.Pulsar.AuthConfig, function.Spec.Pulsar.TLSConfig, function.Spec.Pulsar.PulsarConfig, function.Spec.Pulsar.AuthSecret, - function.Spec.Pulsar.TLSSecret, function.Spec.Java, function.Spec.Python, function.Spec.Golang, function.Spec.Pod.Env, function.Name, + function.Spec.Pulsar.TLSSecret, function.Spec.Java, function.Spec.Python, function.Spec.Golang, function.Spec.Pod.Env, function.Spec.LogTopic, function.Spec.FilebeatImage, function.Spec.LogTopicAgent, function.Spec.VolumeMounts, function.Spec.VolumeClaimTemplates, function.Spec.PersistentVolumeClaimRetentionPolicy) diff --git a/controllers/spec/function_test.go b/controllers/spec/function_test.go index feaeb0268..90711ebe8 100644 --- a/controllers/spec/function_test.go +++ b/controllers/spec/function_test.go @@ -123,7 +123,7 @@ func TestInitContainerDownloader(t *testing.T) { statefulSet := MakeStatefulSet(objectMeta, function.Spec.Replicas, function.Spec.DownloaderImage, makeFunctionContainer(function), makeFunctionVolumes(function, function.Spec.Pulsar.AuthConfig), labels, function.Spec.Pod, function.Spec.Pulsar.AuthConfig, function.Spec.Pulsar.TLSConfig, function.Spec.Pulsar.PulsarConfig, function.Spec.Pulsar.AuthSecret, - function.Spec.Pulsar.TLSSecret, function.Spec.Java, function.Spec.Python, function.Spec.Golang, function.Spec.Pod.Env, function.Name, + function.Spec.Pulsar.TLSSecret, function.Spec.Java, function.Spec.Python, function.Spec.Golang, function.Spec.Pod.Env, function.Spec.LogTopic, function.Spec.FilebeatImage, function.Spec.LogTopicAgent, function.Spec.VolumeMounts, function.Spec.VolumeClaimTemplates, function.Spec.PersistentVolumeClaimRetentionPolicy) diff --git a/controllers/spec/sink.go b/controllers/spec/sink.go index 9460a46fa..d4e0ff089 100644 --- a/controllers/spec/sink.go +++ b/controllers/spec/sink.go @@ -65,7 +65,7 @@ func MakeSinkStatefulSet(ctx context.Context, cli client.Client, sink *v1alpha1. statefulSet := MakeStatefulSet(objectMeta, sink.Spec.Replicas, sink.Spec.DownloaderImage, makeSinkContainer(sink), makeSinkVolumes(sink, sink.Spec.Pulsar.AuthConfig), makeSinkLabels(sink), sink.Spec.Pod, sink.Spec.Pulsar.AuthConfig, sink.Spec.Pulsar.TLSConfig, sink.Spec.Pulsar.PulsarConfig, sink.Spec.Pulsar.AuthSecret, sink.Spec.Pulsar.TLSSecret, - sink.Spec.Java, sink.Spec.Python, sink.Spec.Golang, sink.Spec.Pod.Env, sink.Name, sink.Spec.LogTopic, sink.Spec.FilebeatImage, + sink.Spec.Java, sink.Spec.Python, sink.Spec.Golang, sink.Spec.Pod.Env, sink.Spec.LogTopic, sink.Spec.FilebeatImage, sink.Spec.LogTopicAgent, sink.Spec.VolumeMounts, nil, nil) globalBackendConfigVersion, namespacedBackendConfigVersion, err := PatchStatefulSet(ctx, cli, sink.Namespace, statefulSet) diff --git a/controllers/spec/source.go b/controllers/spec/source.go index 20d144165..c8c942c4d 100644 --- a/controllers/spec/source.go +++ b/controllers/spec/source.go @@ -65,7 +65,7 @@ func MakeSourceStatefulSet(ctx context.Context, cli client.Client, source *v1alp statefulSet := MakeStatefulSet(objectMeta, source.Spec.Replicas, source.Spec.DownloaderImage, makeSourceContainer(source), makeSourceVolumes(source, source.Spec.Pulsar.AuthConfig), makeSourceLabels(source), source.Spec.Pod, source.Spec.Pulsar.AuthConfig, source.Spec.Pulsar.TLSConfig, source.Spec.Pulsar.PulsarConfig, source.Spec.Pulsar.AuthSecret, source.Spec.Pulsar.TLSSecret, - source.Spec.Java, source.Spec.Python, source.Spec.Golang, source.Spec.Pod.Env, source.Name, source.Spec.LogTopic, source.Spec.FilebeatImage, + source.Spec.Java, source.Spec.Python, source.Spec.Golang, source.Spec.Pod.Env, source.Spec.LogTopic, source.Spec.FilebeatImage, source.Spec.LogTopicAgent, source.Spec.VolumeMounts, nil, nil) globalBackendConfigVersion, namespacedBackendConfigVersion, err := PatchStatefulSet(ctx, cli, source.Namespace, statefulSet)