-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
"""Interacts with OLMv1 CRs""" | ||
|
||
__virtualname__ = "metalk8s_olm" | ||
|
||
|
||
def __virtual__(): | ||
return __virtualname__ | ||
|
||
|
||
def check_clustercatalog_serving(name: str): | ||
catalog = __salt__["metalk8s_kubernetes.get_object"]( | ||
kind="ClusterCatalog", apiVersion="olm.operatorframework.io/v1", name=name | ||
) | ||
for cond in catalog["status"]["conditions"]: | ||
if cond["type"] == "Serving": | ||
return cond["status"] == "True" | ||
return False |
12 changes: 12 additions & 0 deletions
12
salt/metalk8s/addons/olm/catalog/deployed/cluster-catalog.sls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!jinja | metalk8s_kubernetes | ||
|
||
apiVersion: olm.operatorframework.io/v1 | ||
kind: ClusterCatalog | ||
metadata: | ||
name: operatorhubio | ||
spec: | ||
source: | ||
type: Image | ||
image: | ||
ref: quay.io/operatorhubio/catalog:latest | ||
pollIntervalMinutes: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
include: | ||
- ...operator-controller.deployed | ||
- .cluster-catalog | ||
|
||
Wait for Cluster Catalog to be Serving: | ||
test.configurable_test_state: | ||
- changes: False | ||
- result: __slot__:salt:metalk8s_olm.check_catalogsource_serving(name=operatorhubio) | ||
- comment: Wait for ClusterCatalog to be Ready | ||
- retry: | ||
attempts: 30 | ||
- require: | ||
- test: Wait for the Operator Controller Controller Manager Deployment to be Ready | ||
- sls: metalk8s.addons.olm.catalog.deployed.cluster-catalog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters