Skip to content

Commit b6a26ed

Browse files
authored
Merge branch 'stable' into augcatalog
2 parents 47d71aa + 0617cf5 commit b6a26ed

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/mas/devops/olm.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def getPackageManifest(dynClient: DynamicClient, packageName: str, catalogSource
4040
return manifestResource
4141

4242

43-
def ensureOperatorGroupExists(dynClient: DynamicClient, env: Environment, namespace: str):
43+
def ensureOperatorGroupExists(dynClient: DynamicClient, env: Environment, namespace: str, installMode: str = "OwnNamespace"):
4444
# Create a new OperatorGroup if necessary
4545
operatorGroupsAPI = dynClient.resources.get(api_version="operators.coreos.com/v1", kind="OperatorGroup")
4646
operatorGroupList = operatorGroupsAPI.get(namespace=namespace)
@@ -49,7 +49,8 @@ def ensureOperatorGroupExists(dynClient: DynamicClient, env: Environment, namesp
4949
template = env.get_template("operatorgroup.yml.j2")
5050
renderedTemplate = template.render(
5151
name="operatorgroup",
52-
namespace=namespace
52+
namespace=namespace,
53+
installMode=installMode
5354
)
5455
operatorGroup = yaml.safe_load(renderedTemplate)
5556
operatorGroupsAPI.apply(body=operatorGroup, namespace=namespace)
@@ -70,7 +71,7 @@ def getSubscription(dynClient: DynamicClient, namespace: str, packageName: str):
7071
return subscriptions.items[0]
7172

7273

73-
def applySubscription(dynClient: DynamicClient, namespace: str, packageName: str, packageChannel: str = None, catalogSource: str = None, catalogSourceNamespace: str = "openshift-marketplace", config: dict = None):
74+
def applySubscription(dynClient: DynamicClient, namespace: str, packageName: str, packageChannel: str = None, catalogSource: str = None, catalogSourceNamespace: str = "openshift-marketplace", config: dict = None, installMode: str = "OwnNamespace"):
7475
"""
7576
Usage:
7677
createSubscription(dynClient, "testns1", "sub1", "ibm-sls") # use default channel, & auto-detect CatalogSource
@@ -101,7 +102,7 @@ def applySubscription(dynClient: DynamicClient, namespace: str, packageName: str
101102
# Create the Namespace & OperatorGroup if necessary
102103
logger.debug(f"Setting up OperatorGroup in {namespace}")
103104
createNamespace(dynClient, namespace)
104-
ensureOperatorGroupExists(dynClient, env, namespace)
105+
ensureOperatorGroupExists(dynClient, env, namespace, installMode)
105106

106107
# Create (or update) the subscription
107108
subscriptionsAPI = dynClient.resources.get(api_version="operators.coreos.com/v1alpha1", kind="Subscription")

src/mas/devops/templates/operatorgroup.yml.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ metadata:
55
name: {{ name }}
66
namespace: {{ namespace }}
77
spec:
8+
{%- if installMode != "AllNamespaces" %}
89
targetNamespaces:
910
- {{ namespace }}
11+
{%- endif %}
1012
upgradeStrategy: Default

src/mas/devops/templates/pipelinerun-install.yml.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,8 @@ spec:
369369
# -------------------------------------------------------------------------
370370
- name: dns_provider
371371
value: "{{ dns_provider }}"
372+
- name: ocp_ingress
373+
value: "{{ ocp_ingress }}"
372374
{%- if cloudflare_apitoken is defined and cloudflare_apitoken != "" %}
373375

374376
# MAS DNS Integrations - Cloudflare Support

0 commit comments

Comments
 (0)