From 10954bdc19687a62f9092c044520ce671a79d40c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 09:06:47 +0200 Subject: [PATCH 1/4] Bump google.golang.org/grpc from 1.66.1 to 1.66.2 (#2678) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.66.1 to 1.66.2. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.66.1...v1.66.2) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e73df0929..df3f9448a 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( go.opentelemetry.io/otel/trace v1.30.0 go.uber.org/zap v1.27.0 gomodules.xyz/jsonpatch/v2 v2.4.0 - google.golang.org/grpc v1.66.1 + google.golang.org/grpc v1.66.2 k8s.io/api v0.29.3 k8s.io/apimachinery v0.29.3 k8s.io/client-go v0.29.3 diff --git a/go.sum b/go.sum index b0a4471b1..cefe90b47 100644 --- a/go.sum +++ b/go.sum @@ -273,8 +273,8 @@ google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1: google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.66.1 h1:hO5qAXR19+/Z44hmvIM4dQFMSYX9XcWsByfoxutBpAM= -google.golang.org/grpc v1.66.1/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= +google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo= +google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 240bd0cc24e2f60543ef3f8ff47124aff32770d5 Mon Sep 17 00:00:00 2001 From: Ankit Kurmi Date: Thu, 19 Sep 2024 12:38:53 +0530 Subject: [PATCH 2/4] feat: added missing test for elasticsearch reconciler (#2662) Signed-off-by: Ankit152 --- .../elasticsearch_controller_test.go | 77 +++++++++++++++++++ controllers/elasticsearch/suit_test.go | 57 ++++++++++++++ 2 files changed, 134 insertions(+) create mode 100644 controllers/elasticsearch/elasticsearch_controller_test.go create mode 100644 controllers/elasticsearch/suit_test.go diff --git a/controllers/elasticsearch/elasticsearch_controller_test.go b/controllers/elasticsearch/elasticsearch_controller_test.go new file mode 100644 index 000000000..6d3f1bdc6 --- /dev/null +++ b/controllers/elasticsearch/elasticsearch_controller_test.go @@ -0,0 +1,77 @@ +package elasticsearch_test + +import ( + "context" + "testing" + + esv1 "github.com/openshift/elasticsearch-operator/apis/logging/v1" + "github.com/stretchr/testify/require" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + k8sconfig "sigs.k8s.io/controller-runtime/pkg/client/config" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + "sigs.k8s.io/controller-runtime/pkg/manager" + k8sreconcile "sigs.k8s.io/controller-runtime/pkg/reconcile" + + v1 "github.com/jaegertracing/jaeger-operator/apis/v1" + "github.com/jaegertracing/jaeger-operator/controllers/elasticsearch" +) + +func TestElasticSearchSetupWithManager(t *testing.T) { + t.Skip("this test requires a real cluster, otherwise the GetConfigOrDie will die") + + // prepare + mgr, err := manager.New(k8sconfig.GetConfigOrDie(), manager.Options{}) + require.NoError(t, err) + reconciler := elasticsearch.NewReconciler( + k8sClient, + k8sClient, + ) + + // test + err = reconciler.SetupWithManager(mgr) + + // verify + require.NoError(t, err) +} + +func TestNewElasticSearchInstance(t *testing.T) { + // prepare + ns := &corev1.Namespace{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-ns", + }, + } + + es := &esv1.Elasticsearch{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-es", + Namespace: "test-ns", + }, + } + + jaeger := v1.NewJaeger(types.NamespacedName{ + Name: "test-jaeger", + Namespace: "test-jaeger", + }) + + esv1.AddToScheme(testScheme) + v1.AddToScheme(testScheme) + + client := fake.NewClientBuilder().WithRuntimeObjects(ns, es, jaeger).Build() + reconciler := elasticsearch.NewReconciler( + client, + client, + ) + + req := k8sreconcile.Request{ + NamespacedName: types.NamespacedName{ + Name: "test-es", + Namespace: "test-ns", + }, + } + + _, err := reconciler.Reconcile(context.Background(), req) + require.NoError(t, err) +} diff --git a/controllers/elasticsearch/suit_test.go b/controllers/elasticsearch/suit_test.go new file mode 100644 index 000000000..ec25ea50f --- /dev/null +++ b/controllers/elasticsearch/suit_test.go @@ -0,0 +1,57 @@ +package elasticsearch_test + +import ( + "fmt" + "os" + "path/filepath" + "testing" + + v1 "github.com/jaegertracing/jaeger-operator/apis/v1" + + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/kubernetes/scheme" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/envtest" + // +kubebuilder:scaffold:imports +) + +var ( + k8sClient client.Client + testEnv *envtest.Environment + testScheme *runtime.Scheme = scheme.Scheme +) + +func TestMain(m *testing.M) { + testEnv = &envtest.Environment{ + CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")}, + } + + cfg, err := testEnv.Start() + if err != nil { + fmt.Printf("failed to start testEnv: %v", err) + os.Exit(1) + } + + if err := v1.AddToScheme(scheme.Scheme); err != nil { + fmt.Printf("failed to register scheme: %v", err) + os.Exit(1) + } + + // +kubebuilder:scaffold:scheme + + k8sClient, err = client.New(cfg, client.Options{Scheme: testScheme}) + if err != nil { + fmt.Printf("failed to setup a Kubernetes client: %v", err) + os.Exit(1) + } + + code := m.Run() + + err = testEnv.Stop() + if err != nil { + fmt.Printf("failed to stop testEnv: %v", err) + os.Exit(1) + } + + os.Exit(code) +} From a9770ff513b5d43e59ab29c34453c42c616ad67e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2024 13:07:36 +0200 Subject: [PATCH 3/4] Bump github/codeql-action from 3.26.7 to 3.26.8 (#2685) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.7 to 3.26.8. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/8214744c546c1e5c8f03dde8fab3a7353211988d...294a9d92911152fe08befb9ec03e240add280cb3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql.yml | 6 +++--- .github/workflows/ossf-scorecard.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index e9fe54839..bf3e065a5 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -41,12 +41,12 @@ jobs: - run: rm -rf ./tests - name: Initialize CodeQL - uses: github/codeql-action/init@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7 + uses: github/codeql-action/init@294a9d92911152fe08befb9ec03e240add280cb3 # v3.26.8 with: languages: go - name: Autobuild - uses: github/codeql-action/autobuild@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7 + uses: github/codeql-action/autobuild@294a9d92911152fe08befb9ec03e240add280cb3 # v3.26.8 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7 + uses: github/codeql-action/analyze@294a9d92911152fe08befb9ec03e240add280cb3 # v3.26.8 diff --git a/.github/workflows/ossf-scorecard.yml b/.github/workflows/ossf-scorecard.yml index 92cf56cf5..a2dee3cea 100644 --- a/.github/workflows/ossf-scorecard.yml +++ b/.github/workflows/ossf-scorecard.yml @@ -49,6 +49,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7 + uses: github/codeql-action/upload-sarif@294a9d92911152fe08befb9ec03e240add280cb3 # v3.26.8 with: sarif_file: results.sarif From cb1d78c602d2085ea792b29345475c9a3799d42e Mon Sep 17 00:00:00 2001 From: Ishwar Kanse Date: Mon, 29 Apr 2024 13:34:13 +0530 Subject: [PATCH 4/4] Add OWNERS file --- OWNERS | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 OWNERS diff --git a/OWNERS b/OWNERS new file mode 100644 index 000000000..b8c606b0d --- /dev/null +++ b/OWNERS @@ -0,0 +1,15 @@ +approvers: +- pavolloffay +- andreasgerstmayr +- iblancasa +- rubenvp8510 +- frzifus +- IshwarKanse +options: {} +reviewers: +- pavolloffay +- andreasgerstmayr +- iblancasa +- rubenvp8510 +- frzifus +- IshwarKanse