You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2021/01/15 19:40:24 UTC

[lucene-solr-operator] branch master updated: Make github actions pass (#180)

This is an automated email from the ASF dual-hosted git repository.

houston pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr-operator.git


The following commit(s) were added to refs/heads/master by this push:
     new cc222b9  Make github actions pass (#180)
cc222b9 is described below

commit cc222b943fdeadf7e451f8cc2aabb309c1065e6c
Author: Houston Putman <ho...@apache.org>
AuthorDate: Fri Jan 15 14:39:53 2021 -0500

    Make github actions pass (#180)
    
    - Fixed random test failures due to needing to wait more time on the reconciler
    - Various Makefile/License/Github Actions fixes
---
 .github/workflows/docker.yaml                    |  2 +-
 .github/workflows/tests.yaml                     |  5 ++---
 Makefile                                         |  2 +-
 controllers/solrcloud_controller_ingress_test.go |  1 +
 controllers/solrcloud_controller_storage_test.go |  1 +
 controllers/solrcloud_controller_test.go         |  7 +++++-
 controllers/util/prometheus_exporter_util.go     | 27 +++++++++++++-----------
 7 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml
index 4990ad0..72fab38 100644
--- a/.github/workflows/docker.yaml
+++ b/.github/workflows/docker.yaml
@@ -7,7 +7,7 @@ on:
 
 jobs:
   test:
-    name: Build and Test Operator
+    name: Build Docker Image
 
     runs-on: ubuntu-latest
 
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
index 8b10bdf..94869e3 100644
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -13,14 +13,13 @@ jobs:
 
     strategy:
       matrix:
-        matrix:
-          go: [ '1.14' ]
+        go: [ '1.14' ]
 
     steps:
       # Setup
       - uses: actions/checkout@v2
       - name: Setup go
-        uses: actions/setup-go@v1
+        uses: actions/setup-go@v2
         with:
           go-version: ${{ matrix.go }}
 
diff --git a/Makefile b/Makefile
index d8289e9..6c8847d 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ CRD_OPTIONS ?= "crd"
 NAME ?= solr-operator
 NAMESPACE ?= bloomberg/
 IMG = $(NAMESPACE)$(NAME)
-VERSION ?= $(shell git describe --tags HEAD)
+VERSION ?= $(or $(shell git describe --tags HEAD),"latest")
 GIT_SHA = $(shell git rev-parse --short HEAD)
 GOOS = $(shell go env GOOS)
 ARCH = $(shell go env GOARCH)
diff --git a/controllers/solrcloud_controller_ingress_test.go b/controllers/solrcloud_controller_ingress_test.go
index 243b07f..da67206 100644
--- a/controllers/solrcloud_controller_ingress_test.go
+++ b/controllers/solrcloud_controller_ingress_test.go
@@ -636,6 +636,7 @@ func TestIngressExtraDomainsCloudReconcile(t *testing.T) {
 	// Add an additional check for reconcile, so that the services will have IP addresses for the hostAliases to use
 	// Otherwise the reconciler will have 'blockReconciliationOfStatefulSet' set to true, and the stateful set will not be created
 	g.Eventually(requests, timeout).Should(gomega.Receive(gomega.Equal(expectedCloudRequest)))
+	g.Eventually(requests, timeout).Should(gomega.Receive(gomega.Equal(expectedCloudRequest)))
 
 	// Check the statefulSet
 	statefulSet := expectStatefulSet(t, g, requests, expectedCloudRequest, cloudSsKey)
diff --git a/controllers/solrcloud_controller_storage_test.go b/controllers/solrcloud_controller_storage_test.go
index aedd280..cbd5b8a 100644
--- a/controllers/solrcloud_controller_storage_test.go
+++ b/controllers/solrcloud_controller_storage_test.go
@@ -102,6 +102,7 @@ func TestPersistentStorageVolumesRetain(t *testing.T) {
 	g.Expect(err).NotTo(gomega.HaveOccurred())
 	defer testClient.Delete(context.TODO(), instance)
 	g.Eventually(requests, timeout).Should(gomega.Receive(gomega.Equal(expectedCloudRequest)))
+	g.Eventually(requests, timeout).Should(gomega.Receive(gomega.Equal(expectedCloudRequest)))
 
 	// Fetch new value of instance to check finalizers
 	foundInstance := &solr.SolrCloud{}
diff --git a/controllers/solrcloud_controller_test.go b/controllers/solrcloud_controller_test.go
index 148f0f3..11900f8 100644
--- a/controllers/solrcloud_controller_test.go
+++ b/controllers/solrcloud_controller_test.go
@@ -737,11 +737,15 @@ func TestZookeeperDeprecationRemap(t *testing.T) {
 	g.Expect(err).NotTo(gomega.HaveOccurred())
 	defer testClient.Delete(context.TODO(), instance)
 	g.Eventually(requests, timeout).Should(gomega.Receive(gomega.Equal(expectedCloudRequest)))
+	g.Eventually(requests, timeout).Should(gomega.Receive(gomega.Equal(expectedCloudRequest)))
 
 	g.Eventually(func() error { return testClient.Get(context.TODO(), expectedCloudRequest.NamespacedName, instance) }, timeout).Should(gomega.Succeed())
 
 	// Check the default Zookeeper
-	assert.Equal(t, reps, *instance.Spec.ZookeeperRef.ProvidedZookeeper.Replicas, "Bad Migration - Spec.ZookeeperRef.ProvidedZookeeper.OutdatedZookeeper.Replicas")
+	assert.NotNil(t, instance.Spec.ZookeeperRef.ProvidedZookeeper.Replicas, "Bad Migration - Spec.ZookeeperRef.ProvidedZookeeper.OutdatedZookeeper.Replicas")
+	if instance.Spec.ZookeeperRef.ProvidedZookeeper.Replicas != nil {
+		assert.Equal(t, reps, *instance.Spec.ZookeeperRef.ProvidedZookeeper.Replicas, "Bad Migration - Spec.ZookeeperRef.ProvidedZookeeper.OutdatedZookeeper.Replicas")
+	}
 	assert.EqualValues(t, testImage, instance.Spec.ZookeeperRef.ProvidedZookeeper.Image, "Bad Default - instance.Spec.ZookeeperRef.ProvidedZookeeper.OutdatedZookeeper.Image")
 	assert.EqualValues(t, testPVCSpec.VolumeName, instance.Spec.ZookeeperRef.ProvidedZookeeper.Persistence.PersistentVolumeClaimSpec.VolumeName, "Bad Default - instance.Spec.ZookeeperRef.ProvidedZookeeper.OutdatedZookeeper.PersistentVolumeClaimSpec.VolumeName")
 	assert.Equal(t, testPodPolicy, instance.Spec.ZookeeperRef.ProvidedZookeeper.ZookeeperPod, "Bad Default - Spec.ZookeeperRef.ProvidedZookeeper.OutdatedZookeeper.ZookeeperPod")
@@ -805,6 +809,7 @@ func TestExternalKubeDomainCloudReconcile(t *testing.T) {
 	g.Expect(err).NotTo(gomega.HaveOccurred())
 	defer testClient.Delete(context.TODO(), instance)
 	g.Eventually(requests, timeout).Should(gomega.Receive(gomega.Equal(expectedCloudRequest)))
+	g.Eventually(requests, timeout).Should(gomega.Receive(gomega.Equal(expectedCloudRequest)))
 
 	// Check the statefulSet
 	statefulSet := expectStatefulSet(t, g, requests, expectedCloudRequest, cloudSsKey)
diff --git a/controllers/util/prometheus_exporter_util.go b/controllers/util/prometheus_exporter_util.go
index 243fdaf..e7c7cb2 100644
--- a/controllers/util/prometheus_exporter_util.go
+++ b/controllers/util/prometheus_exporter_util.go
@@ -1,16 +1,19 @@
 /*
-Copyright 2019 Bloomberg Finance LP.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-    http://www.apache.org/licenses/LICENSE-2.0
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 package util