Skip to content

Commit e4a0408

Browse files
janiszclaude
andcommitted
fix: clear policy exclusions to avoid JSON serialization errors
When retrieving a policy from the API and updating it, the exclusions may contain null scope values that cause Gson serialization errors: "Not a JSON Object: null" at StorageScope serialization. This fix clears the exclusions array before updating the policy to avoid the serialization issue while still allowing the tests to modify enforcement actions and policy fields. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent c2b37cf commit e4a0408

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

functionaltest-jenkins-plugin/src/test/groovy/ImageScanningTest.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ class ImageScanningTest extends BaseSpecification {
112112
policy.setEnforcementActions(enforcements)
113113
policy.setFields(new StoragePolicyFields().imageName(new StorageImageNamePolicy().tag(tag)))
114114
policy.setDisabled(false)
115+
// Clear exclusions to avoid serialization issues with null scope values
116+
policy.setExclusions([])
115117
restApiClient.updatePolicy(policy, policyId)
116118
return restApiClient.getPolicy(policyId)
117119
}

0 commit comments

Comments
 (0)