mirror of
https://github.com/outbackdingo/proxmox-cloud-controller-manager.git
synced 2026-01-27 10:20:13 +00:00
fix: instance type
The node might be down when we try to retrieve the instance property. Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
# syntax = docker/dockerfile:1.5
|
||||
# syntax = docker/dockerfile:1.10
|
||||
########################################
|
||||
|
||||
FROM --platform=${BUILDPLATFORM} golang:1.23.1-alpine3.20 AS builder
|
||||
RUN apk update && apk add --no-cache make
|
||||
ENV GO111MODULE on
|
||||
ENV GO111MODULE=on
|
||||
WORKDIR /src
|
||||
|
||||
COPY go.mod go.sum /src
|
||||
|
||||
3
Makefile
3
Makefile
@@ -21,7 +21,8 @@ TESTARGS ?= "-v"
|
||||
|
||||
BUILD_ARGS := --platform=$(PLATFORM)
|
||||
ifeq ($(PUSH),true)
|
||||
BUILD_ARGS += --push=$(PUSH) --output type=image,annotation-index.org.opencontainers.image.source="https://github.com/$(USERNAME)/$(PROJECT)"
|
||||
BUILD_ARGS += --push=$(PUSH)
|
||||
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"
|
||||
else
|
||||
BUILD_ARGS += --output type=docker
|
||||
endif
|
||||
|
||||
@@ -235,6 +235,10 @@ func (i *instances) getInstanceType(vmRef *pxapi.VmRef, region string) (string,
|
||||
return "", err
|
||||
}
|
||||
|
||||
if vmInfo["maxcpu"] == nil || vmInfo["maxmem"] == nil {
|
||||
return "", fmt.Errorf("instances.getInstanceType() failed to get instance type")
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%.0fVCPU-%.0fGB",
|
||||
vmInfo["maxcpu"].(float64),
|
||||
vmInfo["maxmem"].(float64)/1024/1024/1024), nil
|
||||
|
||||
Reference in New Issue
Block a user