Skip to content

Commit

Permalink
hypershift assisted: delete bmh before namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Mar 22, 2024
1 parent c6098b9 commit 5eef2ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions kvirt/cluster/hypershift/assisted_infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ kind: InfraEnv
metadata:
name: {{ cluster }}
namespace: {{ namespace }}-{{ cluster }}
annotations:
infraenv.agent-install.openshift.io/enable-ironic-agent: "false"
spec:
pullSecretRef:
name: {{ cluster }}-pull-secret
Expand Down
4 changes: 4 additions & 0 deletions kvirt/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2865,6 +2865,10 @@ def delete_kube(self, cluster, overrides={}):
z.delete_dns(f"apps.{cluster}", domain)
if hypershift:
kubeconfigmgmt = f"{clusterdir}/kubeconfig.mgmt"
if os.path.exists('{clusterdir}/bmcs.yml'):
call(f'KUBECONFIG={kubeconfigmgmt} oc delete -f {clusterdir}/bmcs.yml', shell=True)
if os.path.exists('{clusterdir}/assisted_infra.yml'):
call(f'KUBECONFIG={kubeconfigmgmt} oc delete -f {clusterdir}/assisted_infra.yml', shell=True)
call(f'KUBECONFIG={kubeconfigmgmt} oc delete -f {clusterdir}/autoapprovercron.yml', shell=True)
call(f'KUBECONFIG={kubeconfigmgmt} oc delete -f {clusterdir}/nodepool.yaml', shell=True)
call(f'KUBECONFIG={kubeconfigmgmt} oc delete -f {clusterdir}/hostedcluster.yaml', shell=True)
Expand Down

0 comments on commit 5eef2ed

Please sign in to comment.