-
Notifications
You must be signed in to change notification settings - Fork 91
/
crunchypostgresoperator.py
33 lines (27 loc) · 1.07 KB
/
crunchypostgresoperator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from subscription_install_mode import InstallMode
from olm import Operator
from environment import ctx
from behave import given
class CrunchyPostgresOperator(Operator):
def __init__(self, name="pgo"):
if ctx.cli == "oc":
package_name = "crunchy-postgres-operator"
catalog_source_name = "certified-operators"
else:
package_name = "postgresql"
catalog_source_name = "operatorhubio-catalog"
csv = "postgresoperator.v5.3.0"
channel = "v5"
super().__init__(
name=name,
package_name=package_name,
operator_catalog_source_name=catalog_source_name,
operator_subscription_csv_version=csv,
operator_catalog_channel=channel)
@given(u'Crunchy Data Postgres operator is running')
def install(_context):
operator = CrunchyPostgresOperator()
if not operator.is_running():
operator.install_operator_subscription(install_mode=InstallMode.Manual)
operator.is_running(wait=True)
print("Crunchy Data Postgres operator is running")