Skip to content

Commit

Permalink
Fix AS3 response parsing for new response format (#3390)
Browse files Browse the repository at this point in the history
  • Loading branch information
arzzon committed Apr 25, 2024
1 parent bba6ec0 commit edfc480
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/controller/postManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,19 @@ func (postMgr *PostManager) deleteDocumentAPI(tenant string, cfg *as3Config, doc
func updateTenantDeletion(tenant string, declaration map[string]interface{}) bool {
// We are finding the tenant is deleted based on the AS3 API response,
// if results contain the partition with status code of 200 and declaration does not contain the partition we assume that partition is deleted.
// This is a workaround to handle the deletion of tenant in AS3 API response for CIS 3.x, presently AS3 returns class AS3, where as it's expected to return class ADC
// TODO: Revert this change once fixed
// Currently the response is in the format
/*
"declaration": {
"$schema": "https://raw.githubusercontent.com/F5Networks/f5-appsvcs-extension/master/schema//as3-schema-.json",
"class": "AS3",
"declaration": {
"class": "ADC",
*/
if adcDeclaration, ok := declaration["declaration"]; ok {
declaration = adcDeclaration.(interface{}).(map[string]interface{})
}
if _, ok := declaration[tenant]; !ok {
return true
}
Expand Down

0 comments on commit edfc480

Please sign in to comment.