Skip to content

Commit

Permalink
Merge pull request #2709 from jasonvigil/fix-drift-detection
Browse files Browse the repository at this point in the history
fix: Fix shouldSkipDriftDetection to handle direct resources
  • Loading branch information
google-oss-prow[bot] authored Sep 17, 2024
2 parents 003be1c + 0e0ebd7 commit 0d79a26
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/controller/dynamic/dynamic_controller_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,10 +523,14 @@ func shouldSkipDriftDetection(t *testing.T, resourceContext contexts.ResourceCon
t.Fatalf("error parsing `resourceID` field schema: %v", err)
}
return isServerGenerated
} else if resourceContext.IsTFResource {
// Skip drift detection test for tf-based resources with server-generated id.
rc := testservicemapping.GetResourceConfig(t, smLoader, u)
return hasServerGeneratedId(*rc)
} else {
// Drift detection tests are enabled by default for direct resources.
return false
}
// Skip drift detection test for tf-based resources with server-generated id.
rc := testservicemapping.GetResourceConfig(t, smLoader, u)
return hasServerGeneratedId(*rc)
}

func hasServerGeneratedId(rc v1alpha1.ResourceConfig) bool {
Expand Down

0 comments on commit 0d79a26

Please sign in to comment.