Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
cd716bb
[patch] create PR
prveenkumr Nov 25, 2024
6bcc82d
[patch] digest & catalog version update
prveenkumr Nov 25, 2024
1bac734
[patch] remove extra #
anilprajapatiibm Nov 25, 2024
869a0eb
[patch] move from ansible-devops updated Dec casebundle file
anilprajapatiibm Nov 25, 2024
57eeb4e
[patch] copy of ansibled-devops casebundle file of deccurate branch
anilprajapatiibm Nov 25, 2024
a6bb1c2
[patch] udpate catalog digest
anilprajapatiibm Nov 25, 2024
7bfa6c4
[patch] add deccurate casebundles
anilprajapatiibm Nov 25, 2024
d254204
[patch] update digest
anilprajapatiibm Nov 26, 2024
a83e249
[patch] update dec curate content and predict mvi
anilprajapatiibm Nov 26, 2024
219f975
[patch] remove deccurate yaml
anilprajapatiibm Nov 26, 2024
95690a0
Tidy up, not strictly necessary, but avoid confusion
durera Nov 26, 2024
1a39baf
Update test_data.py
durera Nov 26, 2024
2535cde
Remove mongo_extras_version
durera Nov 26, 2024
4e84ec8
[patch] revert mvi till clpud-pak pr merged
anilprajapatiibm Nov 26, 2024
e817c1e
common_services
IanBoden Nov 26, 2024
ba86359
[patch] go back to common_svcs_version 4.7
IanBoden Nov 27, 2024
80a333b
[patch] update digest and apps
anilprajapatiibm Nov 27, 2024
e6a9ad3
list of common_svcs
IanBoden Nov 27, 2024
a79d27f
[patch] digest update
prveenkumr Nov 28, 2024
d765192
add common_svcs_version_2
IanBoden Nov 28, 2024
060badb
Merge branch 'ib.dec' into deccatalog
IanBoden Nov 28, 2024
4a6fe9d
[patch] digest & apps updated
prveenkumr Nov 29, 2024
020659d
[patch] digest update
prveenkumr Dec 3, 2024
e6116d2
[patch] update manage in 9.0.x to 9.0.7
IanBoden Dec 4, 2024
8999b6c
[patch] Add 9.1.x-feature channel support for Dec (#42)
rawa-resul Dec 4, 2024
71a28af
[patch] Add subscription retrieval
rawa-resul Dec 5, 2024
f545c91
[patch] autopep8 changes
rawa-resul Dec 5, 2024
9538824
Merge branch 'stable' into MASR-2387
rawa-resul Dec 6, 2024
5dfcae8
[patch] Add image_pull_policy to pipelinerun-upgrade.yml.j2
rawa-resul Dec 7, 2024
1122924
[patch] Fixes
rawa-resul Dec 7, 2024
e84aec2
[patch] Undo imagepullpolicy
rawa-resul Dec 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/mas/devops/mas.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from jinja2 import Environment, FileSystemLoader

from .ocp import getStorageClasses
from .olm import getSubscription

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -141,6 +142,20 @@ def verifyMasInstance(dynClient: DynamicClient, instanceId: str) -> bool:
return False


def getMasChannel(dynClient: DynamicClient, instanceId: str) -> str:
"""
Get the MAS channel from the subscription
"""
try:
masSubscription = getSubscription(dynClient, f"mas-{instanceId}-core", "ibm-mas")
return masSubscription.items[0]["spec"]["channel"]
except NotFoundError:
return False
except UnauthorizedError:
logger.error("Error: Unable to verify MAS instance due to failed authorization: {e}")
return False


def updateIBMEntitlementKey(dynClient: DynamicClient, namespace: str, icrUsername: str, icrPassword: str, artifactoryUsername: str = None, artifactoryPassword: str = None, secretName: str = "ibm-entitlement") -> ResourceInstance:
if secretName is None:
secretName = "ibm-entitlement"
Expand Down
18 changes: 18 additions & 0 deletions src/mas/devops/olm.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,24 @@ def ensureOperatorGroupExists(dynClient: DynamicClient, env: Environment, namesp
logger.debug(f"An OperatorGroup already exists in namespace {namespace}")


def getSubscription(dynClient: DynamicClient, namespace: str, packageName: str):
try:
labelSelector = f"operators.coreos.com/{packageName}.{namespace}"
logger.debug(f"Get Subscription for {packageName} in {namespace}")
subscriptionsAPI = dynClient.resources.get(
api_version="operators.coreos.com/v1alpha1", kind="Subscription"
)
subscription = subscriptionsAPI.get(
label_selector=labelSelector, namespace=namespace
)
if subscription.items == 0:
raise NotFoundError
except NotFoundError:
logger.info(f"No matching Subscription found for {packageName} in {namespace}")
subscription = None
return subscription


def applySubscription(dynClient: DynamicClient, namespace: str, packageName: str, packageChannel: str = None, catalogSource: str = None, catalogSourceNamespace: str = "openshift-marketplace", config: dict = None):
"""
Usage:
Expand Down
Loading