Repository: Azure/ARO-RP
Pull request #1567 (2021-07-01 10:29:50)

change SP for prod
### Which issue this PR addresses:

Fixes SP ref for Production public cloud

### What this PR does / why we need it:

I suspect App id is wrong in public cloud.

### Test plan for issue:

by :fire: 

### Is there any documentation that needs to be updated for this PR?

No


Patch:
diff --git a/pkg/cluster/delete.go b/pkg/cluster/delete.go
index d727e6c91..b73fed41e 100644
--- a/pkg/cluster/delete.go
+++ b/pkg/cluster/delete.go
@@ -259,21 +259,9 @@ func (m *manager) deleteRoleDefinition(ctx context.Context) error {
 
 func (m *manager) Delete(ctx context.Context) error {
 	resourceGroup := stringutils.LastTokenByte(m.doc.OpenShiftCluster.Properties.ClusterProfile.ResourceGroupID, '/')
-	//In edge case of CRG not being managedBy ARO, we have a different delete path
-	//we will assume normal case and set rgManagedByARO to true CRG is managedby ARO
-	rgManagedByARO := true
-	rg, err := m.resourceGroups.Get(ctx, resourceGroup)
-	if err != nil {
-		m.log.Warnf("failed to get resourceGroup %s", err)
-	} else {
-		if rg.ManagedBy == nil || *rg.ManagedBy == "" || !strings.EqualFold(*rg.ManagedBy, m.doc.OpenShiftCluster.ID) {
-			rgManagedByARO = false
-			m.log.Infof("cluster resource group not managed by aro %s", *rg.Name)
-		}
-	}
 
 	m.log.Printf("deleting dns")
-	err = m.dns.Delete(ctx, m.doc.OpenShiftCluster)
+	err := m.dns.Delete(ctx, m.doc.OpenShiftCluster)
 	if err != nil {
 		return err
 	}
@@ -296,27 +284,25 @@ func (m *manager) Delete(ctx context.Context) error {
 		return err
 	}
 
-	// only delete if managedByARO
-	if rgManagedByARO {
-		m.log.Printf("deleting resources")
-		err = m.deleteResources(ctx)
-		if err != nil {
-			return err
-		}
+	m.log.Printf("deleting resources")
+	err = m.deleteResources(ctx)
+	if err != nil {
+		return err
+	}
 
-		m.log.Printf("deleting resource group %s", resourceGroup)
-		err = m.resourceGroups.DeleteAndWait(ctx, resourceGroup)
-		if detailedErr, ok := err.(autorest.DetailedError); ok &&
-			(detailedErr.StatusCode == http.StatusForbidden || detailedErr.StatusCode == http.StatusNotFound) {
-			err = nil
-		}
-		if azureerrors.HasAuthorizationFailedError(err) {
-			err = nil
-		}
-		if err != nil {
-			return err
-		}
+	m.log.Printf("deleting resource group %s", resourceGroup)
+	err = m.resourceGroups.DeleteAndWait(ctx, resourceGroup)
+	if detailedErr, ok := err.(autorest.DetailedError); ok &&
+		(detailedErr.StatusCode == http.StatusForbidden || detailedErr.StatusCode == http.StatusNotFound) {
+		err = nil
 	}
+	if azureerrors.HasAuthorizationFailedError(err) {
+		err = nil
+	}
+	if err != nil {
+		return err
+	}
+
 	if !m.env.FeatureIsSet(env.FeatureDisableSignedCertificates) {
 		managedDomain, err := dns.ManagedDomain(m.env, m.doc.OpenShiftCluster.Properties.ClusterProfile.Domain)
 		if err != nil {


Test patch:
diff --git a/.pipelines/templates/template-prod-e2e-steps.yml b/.pipelines/templates/template-prod-e2e-steps.yml
index 1272aee2e..64b31668c 100644
--- a/.pipelines/templates/template-prod-e2e-steps.yml
+++ b/.pipelines/templates/template-prod-e2e-steps.yml
@@ -33,7 +33,7 @@ steps:
       export AZURE_FP_SERVICE_PRINCIPAL_ID=fe9d206f-a6af-46db-8bda-303aae45e469
     else
       export AZURE_FP_CLIENT_ID=f1dd0a37-89c6-4e07-bcd1-ffd3d43d8875
-      export AZURE_FP_SERVICE_PRINCIPAL_ID=de2829de-2392-40ee-b3a8-79b70a18c2a1
+      export AZURE_FP_SERVICE_PRINCIPAL_ID=50c17c64-bc11-4fdd-a339-0ecd396bf911
     fi
     # TODO: remove --env RESOURCEGROUP after next RP deployment.