Skip to content

Commit

Permalink
fix tag name attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
OriHoch committed Jan 24, 2025
1 parent 3c18726 commit 83ce5dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func (c *KamateraApiClientRest) getServerTags(ctx context.Context, serverName st
tags := make([]string, 0)
for _, row := range res.([]interface{}) {
row := row.(map[string]interface{})
tags = append(tags, row["tag name"].(string))
tags = append(tags, row["tagName"].(string))
}
return tags, nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func TestApiClientRest_ListServers(t *testing.T) {
]`, newServerName1, cachedServerName2, cachedServerName3, cachedServerName4),
).On("handle", "/server/tags").Return(
"application/json",
`[{"tag name": "test-tag"}, {"tag name": "other-test-tag"}]`,
`[{"tagName": "test-tag"}, {"tagName": "other-test-tag"}]`,
)
servers, err := client.ListServers(ctx, map[string]*Instance{
cachedServerName2: {
Expand Down Expand Up @@ -140,7 +140,7 @@ func TestApiClientRest_ListServersNamePrefix(t *testing.T) {
]`, newServerName1, newServerName2),
).On("handle", "/server/tags").Return(
"application/json",
`[{"tag name": "test-tag"}, {"tag name": "other-test-tag"}]`,
`[{"tagName": "test-tag"}, {"tagName": "other-test-tag"}]`,
)
servers, err := client.ListServers(ctx, map[string]*Instance{}, "prefixb")
assert.NoError(t, err)
Expand Down

0 comments on commit 83ce5dd

Please sign in to comment.