Skip to content

Commit

Permalink
fix flake
Browse files Browse the repository at this point in the history
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
  • Loading branch information
anandrkskd committed Aug 22, 2022
1 parent 88f49c8 commit 1a8eca1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
23 changes: 22 additions & 1 deletion scripts/configure-cluster/common/setup-operators.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
#!/bin/bash
set -x

install_sourceCatalog(){
$1 create -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: operatorhubio-catalog
namespace: openshift-marketplace
spec:
sourceType: grpc
image: quay.io/operatorhubio/catalog:latest
displayName: Community Operators
publisher: OperatorHub.io
updateStrategy:
registryPoll:
interval: 60m
EOF
}

install_postgres_operator(){
$1 create -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
Expand Down Expand Up @@ -73,8 +91,11 @@ elif [ "$KUBERNETES" == "true" ]; then
# install "service-binding-operator" using "kubectl" in "operators" namespace; use "operatorhubio-catalog" catalog source from "olm" namespace
install_service_binding_operator kubectl operators service-binding-operator operatorhubio-catalog olm
else
#install operatorhub.io sourceCatalog
install_sourceCatalog oc

# install "cloud-native-postgresql" using "oc" in "openshift-operators" namespace; use "certified-operators" catalog source from "openshift-marketplace" namespace
install_postgres_operator oc openshift-operators certified-operators openshift-marketplace
install_postgres_operator oc openshift-operators operatorhubio-catalog openshift-marketplace

# install "rh-service-binding-operator" using "oc" in "openshift-operators" namespace; use "redhat-operators" catalog source from "openshift-marketplace" namespace
install_service_binding_operator oc openshift-operators rh-service-binding-operator redhat-operators openshift-marketplace
Expand Down
2 changes: 1 addition & 1 deletion tests/helper/helper_oc.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func (oc OcRunner) CreateAndSetRandNamespaceProjectOfLength(i int) string {

func (oc OcRunner) createAndSetRandNamespaceProject(projectName string) string {
fmt.Fprintf(GinkgoWriter, "Creating a new project: %s\n", projectName)
session := Cmd("odo", "create", "project", projectName, "-w", "-v4").ShouldPass().Out()
session := Cmd(oc.path, "new-project", projectName).ShouldPass().Out()
Expect(session).To(ContainSubstring(projectName))
oc.addConfigMapForCleanup(projectName)
return projectName
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/interactive_add_binding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ var _ = Describe("odo add binding interactive command tests", func() {
var nsWithNoService string

BeforeEach(func() {
nsWithNoService = commonVar.Project
nsWithNoService = commonVar.CliRunner.CreateAndSetRandNamespaceProject()
otherNS = commonVar.CliRunner.CreateAndSetRandNamespaceProject()
addBindableKindInOtherNs := commonVar.CliRunner.Run("-n", otherNS, "apply", "-f",
helper.GetExamplePath("manifests", "bindablekind-instance.yaml"))
Expand Down Expand Up @@ -554,7 +554,7 @@ var _ = Describe("odo add binding interactive command tests", func() {
var nsWithNoService string

BeforeEach(func() {
nsWithNoService = commonVar.Project
nsWithNoService = commonVar.CliRunner.CreateAndSetRandNamespaceProject()
otherNS = commonVar.CliRunner.CreateAndSetRandNamespaceProject()
addBindableKindInOtherNs := commonVar.CliRunner.Run("-n", otherNS, "apply", "-f",
helper.GetExamplePath("manifests", "bindablekind-instance.yaml"))
Expand Down

0 comments on commit 1a8eca1

Please sign in to comment.