Skip to content

Commit 10f3e36

Browse files
committed
fix: instance type
The node might be down when we try to retrieve the instance property. Signed-off-by: Serge Logvinov <[email protected]>
1 parent 2b64352 commit 10f3e36

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# syntax = docker/dockerfile:1.5
1+
# syntax = docker/dockerfile:1.10
22
########################################
33

44
FROM --platform=${BUILDPLATFORM} golang:1.23.1-alpine3.20 AS builder
55
RUN apk update && apk add --no-cache make
6-
ENV GO111MODULE on
6+
ENV GO111MODULE=on
77
WORKDIR /src
88

99
COPY go.mod go.sum /src

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ TESTARGS ?= "-v"
2121

2222
BUILD_ARGS := --platform=$(PLATFORM)
2323
ifeq ($(PUSH),true)
24-
BUILD_ARGS += --push=$(PUSH) --output type=image,annotation-index.org.opencontainers.image.source="https://github.com/$(USERNAME)/$(PROJECT)"
24+
BUILD_ARGS += --push=$(PUSH)
25+
BUILD_ARGS += --output type=image,annotation-index.org.opencontainers.image.source="https://github.com/$(USERNAME)/$(PROJECT)",annotation-index.org.opencontainers.image.description="Proxmox VE CCM for Kubernetes"
2526
else
2627
BUILD_ARGS += --output type=docker
2728
endif

pkg/proxmox/instances.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ func (i *instances) getInstanceType(vmRef *pxapi.VmRef, region string) (string,
235235
return "", err
236236
}
237237

238+
if vmInfo["maxcpu"] == nil || vmInfo["maxmem"] == nil {
239+
return "", fmt.Errorf("instances.getInstanceType() failed to get instance type")
240+
}
241+
238242
return fmt.Sprintf("%.0fVCPU-%.0fGB",
239243
vmInfo["maxcpu"].(float64),
240244
vmInfo["maxmem"].(float64)/1024/1024/1024), nil

0 commit comments

Comments
 (0)