Skip to content

Commit

Permalink
Change ManagementState for image registry for non cloud platforms
Browse files Browse the repository at this point in the history
Fixes: #1436

Signed-off-by: Petr Balogh <pbalogh@redhat.com>
  • Loading branch information
petr-balogh committed Feb 5, 2020
1 parent f146d7a commit 3f5004f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ocs_ci/ocs/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
DEFAULT_ROUTE_CRT = "router-certs-default"
DEFAULT_NAMESPACE = "default"
IMAGE_REGISTRY_RESOURCE_NAME = "cluster"
IMAGE_REGISTRY_CONFIG = "configs.imageregistry.operator.openshift.io/cluster"

# Default StorageClass
DEFAULT_STORAGECLASS_CEPHFS = f'{DEFAULT_CLUSTERNAME}-cephfs'
Expand Down Expand Up @@ -431,6 +432,7 @@
# Platforms
AWS_PLATFORM = 'aws'
VSPHERE_PLATFORM = 'vsphere'
CLOUD_PLATFORMS = (AWS_PLATFORM)

# Default SC based on platforms
DEFAULT_SC_AWS = "gp2"
Expand Down
9 changes: 9 additions & 0 deletions ocs_ci/ocs/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ def change_registry_backend_to_ocs():
resource_name=constants.IMAGE_REGISTRY_RESOURCE_NAME, params=param_cmd, format_type='json'
), f"Registry pod storage backend to OCS is not success"

if(config.ENV_DATA['platform'] not in constants.CLOUD_PLATFORMS):
run_cmd(
f'oc patch {constants.IMAGE_REGISTRY_CONFIG} --type merge -p '
f'\'{{"spec":{{"managementState": "Managed"}}}}\''
)
logger.info(
"Waiting 30 seconds after change managementState of image-registry."
)
time.sleep(30)
# Validate registry pod status
validate_registry_pod_status()

Expand Down

0 comments on commit 3f5004f

Please sign in to comment.