1313from codehub .cli .gcp .helpers import authenticate_k8s_GKE
1414from codehub .cli .k8s .create import create_k8s_resources
1515from codehub .cli .helm .create import create_deploy
16- from codehub .cli .helm .install import install_helm_chart , upgrade_helm_chart
16+ from codehub .cli .helm .install import install_helm_chart
1717from codehub .cli .helpers import get_cloud_dir , get_latest_deployment , read_yaml
1818from codehub .cli .manage import wait_for_hub_to_get_ready , get_ip
1919import kubernetes .client .rest # Add this import for the exception handling
@@ -51,10 +51,8 @@ def create(config: CreateConfig):
5151
5252 __create_k8s_resources (deploy_config )
5353
54- __install_helm_chart (
55- deploy_config ,
56- admins = config .admins ,
57- )
54+ __create_deploy (deploy_config , admins = config .admins )
55+ install_helm_chart (deploy_config , upgrade = False )
5856
5957 wait_for_hub_to_get_ready (k8s_dir )
6058
@@ -74,12 +72,13 @@ def upgrade(name, admins, https=None, oauth_config: Optional[OAuthConfig] = None
7472 ]
7573 deploy_config = DeployConfig (name , region , helm_dir , hub_dir , k8s_dir , cloud_state )
7674
77- __upgrade_helm_chart (
75+ __create_deploy (
7876 deploy_config ,
7977 admins = admins ,
8078 https = https ,
8179 oauth_config = oauth_config ,
8280 )
81+ install_helm_chart (deploy_config , upgrade = True )
8382
8483 authenticate_k8s_GKE (name )
8584 wait_for_hub_to_get_ready (k8s_dir )
@@ -133,30 +132,6 @@ def __create_k8s_resources(deploy_config: DeployConfig):
133132 raise
134133
135134
136- def __install_helm_chart (
137- deploy_config : DeployConfig ,
138- admins ,
139- ):
140- __create_deploy (deploy_config , admins )
141- install_helm_chart (deploy_config )
142-
143-
144- def __upgrade_helm_chart (
145- deploy_config : DeployConfig ,
146- admins ,
147- https = None ,
148- oauth_config : Optional [OAuthConfig ] = None ,
149- ):
150- __create_deploy (
151- deploy_config ,
152- admins = admins ,
153- https = https ,
154- oauth_config = oauth_config ,
155- )
156-
157- upgrade_helm_chart (deploy_config )
158-
159-
160135def __create_deploy (
161136 deploy_config : DeployConfig ,
162137 admins ,
0 commit comments