From d0ae1e749e715fc5cb9ea9c8359491262bd26f17 Mon Sep 17 00:00:00 2001 From: Igor Lalik Date: Mon, 8 Apr 2024 13:26:38 +0200 Subject: [PATCH] Fix URL to delete definition --- internal/kmi/definitionclient.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/kmi/definitionclient.go b/internal/kmi/definitionclient.go index 4416c13..178fb18 100644 --- a/internal/kmi/definitionclient.go +++ b/internal/kmi/definitionclient.go @@ -54,8 +54,8 @@ func (client *KMIRestClient) CreateBlockSecret(collectionName string, definition } func (client *KMIRestClient) DeleteDefinition(collectionName string, definitionName string) error { + idenityengineurl := fmt.Sprintf("%s/definition/Col=%s/Def=%s", client.Host, collectionName, definitionName) - idenityengineurl := fmt.Sprintf("%s/definition/Col=%s/Def=$%s", client.Host, collectionName, definitionName) req, err := http.NewRequest("DELETE", idenityengineurl, nil) if err != nil { return err @@ -65,6 +65,10 @@ func (client *KMIRestClient) DeleteDefinition(collectionName string, definitionN return err } defer resp.Body.Close() + + if resp.StatusCode != http.StatusNoContent { + return fmt.Errorf("error while calling DeleteDefinition api %s and payload is %v", resp.Status, resp) + } return nil }