Skip to content

Commit

Permalink
configure default value for hosted_odf_registry
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Horak <[email protected]>
  • Loading branch information
dahorak committed Nov 13, 2024
1 parent 2ce1cbc commit ff7c93e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
2 changes: 1 addition & 1 deletion conf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ higher priority).
* `cpu_cores_per_hosted_cluster` - number of CPU cores per hosted cluster
* `memory_per_hosted_cluster` - amount of memory per hosted cluster
* `nodepool_replicas` - number of replicas of nodepool for each cluster
* `hosted_odf_registry` - registry for hosted ODF
* `hosted_odf_registry` - registry for hosted ODF (default: quay.io/rhceph-dev/ocs-registry)
* `hosted_odf_version` - version of ODF to be deployed on hosted clusters
* `cp_availability_policy` - "HighlyAvailable" or "SingleReplica"; if not provided the default value is "SingleReplica"
* `wait_timeout_for_healthy_osd_in_minutes` - timeout waiting for healthy OSDs before continuing upgrade (see https://bugzilla.redhat.com/show_bug.cgi?id=2276694 for more details)
Expand Down
23 changes: 5 additions & 18 deletions ocs_ci/deployment/hosted_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from ocs_ci.deployment.metallb import MetalLBInstaller
from ocs_ci.framework import config
from ocs_ci.helpers import helpers
from ocs_ci.ocs import constants, ocp
from ocs_ci.ocs import constants, defaults, ocp
from ocs_ci.ocs.constants import HCI_PROVIDER_CLIENT_PLATFORMS
from ocs_ci.ocs.exceptions import (
ProviderModeNotFoundException,
Expand Down Expand Up @@ -195,18 +195,13 @@ def config_has_hosted_odf_image(self, cluster_name):
bool: True if the config has hosted ODF image, False otherwise
"""
regestry_exists = (
config.ENV_DATA.get("clusters")
.get(cluster_name)
.get("hosted_odf_registry", False)
)
version_exists = (
config.ENV_DATA.get("clusters")
.get(cluster_name)
.get("hosted_odf_version", False)
)

return regestry_exists and version_exists
return version_exists

def storage_installation_requested(self, cluster_name):
"""
Expand Down Expand Up @@ -1046,22 +1041,14 @@ def create_catalog_source(self):
"OCS version is not set in the config file, should be set in format similar to '4.14.5-8'"
"in the 'hosted_odf_version' key in the 'ENV_DATA.clusters.<name>' section of the config file. "
)
if (
not config.ENV_DATA.get("clusters")
.get(self.name)
.get("hosted_odf_registry")
):
raise ValueError(
"OCS registry is not set in the config file, should be set in format similar to "
"'quay.io/rhceph-dev/ocs-registry' in the 'hosted_odf_registry' key in the 'ENV_DATA.clusters.<name>' "
"section of the config file. "
)

odf_version = (
config.ENV_DATA.get("clusters").get(self.name).get("hosted_odf_version")
)
odf_registry = (
config.ENV_DATA.get("clusters").get(self.name).get("hosted_odf_registry")
config.ENV_DATA.get("clusters")
.get(self.name)
.get("hosted_odf_registry", defaults.HOSTED_ODF_REGISTRY_DEFAULT)
)

logger.info(
Expand Down
2 changes: 2 additions & 0 deletions ocs_ci/ocs/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,5 @@
# IBM Cloud
IBM_CLOUD_LOAD_BALANCER_QUOTA = 50
IBM_CLOUD_REGIONS = {"us-south", "us-east"}

HOSTED_ODF_REGISTRY_DEFAULT = "quay.io/rhceph-dev/ocs-registry"

0 comments on commit ff7c93e

Please sign in to comment.