Skip to content

Commit

Permalink
Added networkpolicy creation for hosted clusters before creating stor…
Browse files Browse the repository at this point in the history
…ageclient (#10648)

* Added networkpolicy creation for hosted clusters before creating storageclient

Signed-off-by: Amrita Mahapatra <49347640+amr1ta@users.noreply.github.com>

* Added networkpolicy creation for hosted clusters before creating storageclient

Signed-off-by: Amrita Mahapatra <49347640+amr1ta@users.noreply.github.com>

---------

Signed-off-by: Amrita Mahapatra <49347640+amr1ta@users.noreply.github.com>
  • Loading branch information
amr1ta authored Oct 14, 2024
1 parent b824d9c commit 8d87645
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ocs_ci/deployment/hosted_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
get_latest_release_version,
)
from ocs_ci.utility.version import get_semantic_version
from ocs_ci.ocs.resources.storage_client import StorageClient

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -103,6 +104,16 @@ def do_deploy(self, cluster_names=None):
logger.info("Download kubeconfig for all clusters")
kubeconfig_paths = self.download_hosted_clusters_kubeconfig_files()

# Need to create networkpolicy as mentioned in bug 2281536,
# https://bugzilla.redhat.com/show_bug.cgi?id=2281536#c21

# Create Network Policy
storage_client = StorageClient()
for cluster_name in cluster_names:
storage_client.create_network_policy(
namespace_to_create_storage_client=f"clusters-{cluster_name}"
)

# stage 4 deploy ODF on all hosted clusters if not already deployed
for cluster_name in cluster_names:

Expand Down

0 comments on commit 8d87645

Please sign in to comment.