move skipservicemodify check
@@ -992,6 +992,10 @@ func (m *MigrationController) checkAndUpdateService(
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(object.UnstructuredContent(), &svc); err != nil {
return false, fmt.Errorf("error converting unstructured obj to service resource: %v", err)
}
+ if _, ok := svc.Annotations[resourcecollector.SkipModifyResources]; ok {
+ // older behaviour where we delete and create svc resources
+ return false, nil
+ }
adminClient, err := m.getRemoteAdminConfig(migration)
if err != nil {
return false, err
@@ -1014,10 +1018,6 @@ func (m *MigrationController) checkAndUpdateService(
}
}
}
- if _, ok := svc.Annotations[resourcecollector.SkipModifyResources]; ok {
- // older behaviour where we delete and create svc resources
- return false, nil
- }
// update annotations
for k, v := range svc.Annotations {
curr.Annotations[k] = v
