param( [string]$OldNamespace = "ircs-system", [string]$NewNamespace = "ircs-prod", [string]$OldApplication = "ircs-app", [string]$ArgoNamespace = "argocd", [switch]$Execute ) $ErrorActionPreference = "Stop" if (-not $Execute) { Write-Host "Dry run only. Planned actions:" Write-Host "1. Patch ArgoCD application $OldApplication to disable automated sync." Write-Host "2. Apply ircs-prod/edge-cutover HTTPRoutes." Write-Host "3. Delete old $OldNamespace huawai-route and ircs-route to avoid hostname/path conflicts." Write-Host "4. Wait for new routes to be Accepted and ResolvedRefs." Write-Host "Add -Execute to perform cutover." exit 0 } kubectl -n $ArgoNamespace patch application $OldApplication --type merge -p '{"spec":{"syncPolicy":null}}' | Out-Null kubectl apply -k ircs-prod/edge-cutover | Out-Null kubectl -n $OldNamespace delete httproute huawai-route ircs-route --ignore-not-found | Out-Null kubectl -n $NewNamespace wait --for=condition=Accepted httproute/huawai-route --timeout=120s kubectl -n $NewNamespace wait --for=condition=Accepted httproute/ircs-route --timeout=120s kubectl -n $NewNamespace get httproute huawai-route ircs-route