Skip to content

Commit

Permalink
Add empty validation
Browse files Browse the repository at this point in the history
Signed-off-by: Vicente Zepeda Mas <[email protected]>
  • Loading branch information
chentex committed Jun 20, 2024
1 parent dfb6512 commit 14b4ad4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pkg/helpers/clean_test_transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ func (t *CleanTestTransport) addToCleanup(request *http.Request, response *http.
return response
}
}
markClusterForCleanup(ctx, clusterID.(string), deprovision, t.Logger)
if clusterID.(string) != "" {
markClusterForCleanup(ctx, clusterID.(string), deprovision, t.Logger)
}

body, err := json.Marshal(cluster)
if err != nil {
Expand Down Expand Up @@ -103,7 +105,9 @@ func (t *CleanTestTransport) addToArchive(request *http.Request, response *http.
return response
}

markSubscriptionForArchiving(ctx, subscriptionID.(string), t.Logger)
if subscriptionID.(string) != "" {
markSubscriptionForArchiving(ctx, subscriptionID.(string), t.Logger)
}
body, err := json.Marshal(authorization)
if err != nil {
t.Logger.Error(ctx, "Failed to marshall body of response for request %s %s: %v", request.Method,
Expand Down Expand Up @@ -237,7 +241,9 @@ func (t *CleanTestTransport) addToServiceCleanup(request *http.Request, response
request.URL.String(), err)
return response
}
markServiceForCleanup(ctx, serviceID.(string), t.Logger)
if serviceID.(string) != "" {
markServiceForCleanup(ctx, serviceID.(string), t.Logger)
}

body, err := json.Marshal(service)
if err != nil {
Expand Down

0 comments on commit 14b4ad4

Please sign in to comment.