Skip to content

Commit 04e57e5

Browse files
committed
Workaround for CloudControl bug (UNEXPECTED_ERROR when listing past the last page of server tags).
1 parent 06b549c commit 04e57e5

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ _testmain.go
2929
.DS_Store
3030

3131
# Version info
32-
version-info.go
32+
version_info.go
3333

3434
# Terraform
3535
terraform.tfvars

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
VERSION = 0.1.0-alpha6
1+
VERSION = 0.1.0-beta1
22

33
SERVER_DIRECTORY = ./server
44
BIN_DIRECTORY = ./_bin
55
EXECUTABLE_NAME = mcp2-dhcp-server
66
DIST_ZIP_PREFIX = $(EXECUTABLE_NAME).v$(VERSION)
7-
VERSION_INFO_FILE = $(SERVER_DIRECTORY)/version-info.go
7+
VERSION_INFO_FILE = $(SERVER_DIRECTORY)/version_info.go
88

99
REPO_BASE = github.com/DimensionDataResearch
1010
REPO_ROOT = $(REPO_BASE)/mcp2-dhcp-server

installer/group_vars/net-boot-service.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22

33
# Server versions
4-
mcp2_dhcp_server_version: "0.1.0-alpha6"
4+
mcp2_dhcp_server_version: "0.1.0-beta1"
55
coreos_ipxe_server_version: "0.3.0"
66

77
# CloudControl connection details.

server/cloudcontrol-cache.go renamed to server/cloudcontrol_cache.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,6 @@ func (service *Service) getAllServerTags() (map[string][]compute.TagDetail, erro
131131
for {
132132
tags, err := service.Client.GetAssetTagsByType(compute.AssetTypeServer, service.NetworkDomain.DatacenterID, tagPage)
133133
if err != nil {
134-
if compute.IsAPIErrorCode(err, compute.ResponseCodeUnexpectedError) {
135-
break // CloudControl bug - going past last page of tags returns UNEXPECTED_ERROR (i.e. there are no more tags).
136-
}
137-
138134
return nil, err
139135
}
140136
if tags.IsEmpty() {
@@ -151,6 +147,12 @@ func (service *Service) getAllServerTags() (map[string][]compute.TagDetail, erro
151147
allServerTags[tag.AssetID] = serverTags
152148
}
153149

150+
// CloudControl bug - going past last page of tags returns UNEXPECTED_ERROR (i.e. there are no more tags).
151+
// We therefore manually determine whether this is the last page of results.
152+
if tags.IsLastPage() {
153+
break
154+
}
155+
154156
tagPage.Next()
155157
}
156158

0 commit comments

Comments
 (0)