Skip to content

Commit

Permalink
fix: Backport fixes found during che-operator 7.33.0 release (#929)
Browse files Browse the repository at this point in the history
* fix: Backport fixes found during che-operator 7.33.0 release

Signed-off-by: Anatolii Bazko <[email protected]>
  • Loading branch information
tolusha authored Jul 15, 2021
1 parent fb1f238 commit 8de4ddd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions olm/olm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ applyCRCheCluster() {
CRs=$(yq -r '.metadata.annotations["alm-examples"]' "${CSV_FILE}")
CR=$(echo "$CRs" | yq -r ".[0]")
CR=$(echo "$CR" | yq -r ".spec.devWorkspace.enable = ${DEV_WORKSPACE_ENABLE:-false}")
CR=$(echo "$CR" | yq -r ".spec.server.serverExposureStrategy = \"${CHE_EXPOSURE_STRATEGY:-multi-host}\"")
if [ "${platform}" == "kubernetes" ]
then
CR=$(echo "$CR" | yq -r ".spec.k8s.ingressDomain = \"$(minikube ip).nip.io\"")
Expand Down
13 changes: 11 additions & 2 deletions pkg/controller/che/che_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"fmt"
"io/ioutil"
"os"
"strings"

mocks "github.com/eclipse-che/che-operator/mocks"

Expand All @@ -27,6 +28,7 @@ import (

identity_provider "github.com/eclipse-che/che-operator/pkg/deploy/identity-provider"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"

"github.com/eclipse-che/che-operator/pkg/deploy"
"github.com/eclipse-che/che-operator/pkg/util"
Expand Down Expand Up @@ -920,8 +922,15 @@ func TestImagePullerConfiguration(t *testing.T) {
if err != nil {
t.Errorf("Error getting KubernetesImagePuller: %v", err)
}
if !reflect.DeepEqual(testCase.expectedImagePuller, gotImagePuller) {
t.Errorf("Expected KubernetesImagePuller and KubernetesImagePuller returned from API server differ (-want, +got): %v", cmp.Diff(testCase.expectedImagePuller, gotImagePuller))

diff := cmp.Diff(testCase.expectedImagePuller, gotImagePuller, cmpopts.IgnoreFields(chev1alpha1.KubernetesImagePullerSpec{}, "Images"))
if diff != "" {
t.Errorf("Expected KubernetesImagePuller and KubernetesImagePuller returned from API server differ (-want, +got): %v", diff)
}

// check images differently since it might contains extra images
if !strings.Contains(gotImagePuller.Spec.Images, testCase.expectedImagePuller.Spec.Images) {
t.Errorf("Expected KubernetesImagePuller and KubernetesImagePuller returned from API server differ (-want, +got): %v", cmp.Diff(testCase.expectedImagePuller.Spec.Images, gotImagePuller.Spec.Images))
}
}
if testCase.shouldDelete {
Expand Down

0 comments on commit 8de4ddd

Please sign in to comment.