mirror of
https://github.com/outbackdingo/proxmox-cloud-controller-manager.git
synced 2026-01-27 02:20:02 +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
|
FROM --platform=${BUILDPLATFORM} golang:1.23.1-alpine3.20 AS builder
|
||||||
RUN apk update && apk add --no-cache make
|
RUN apk update && apk add --no-cache make
|
||||||
ENV GO111MODULE on
|
ENV GO111MODULE=on
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
COPY go.mod go.sum /src
|
COPY go.mod go.sum /src
|
||||||
|
|||||||
3
Makefile
3
Makefile
@@ -21,7 +21,8 @@ TESTARGS ?= "-v"
|
|||||||
|
|
||||||
BUILD_ARGS := --platform=$(PLATFORM)
|
BUILD_ARGS := --platform=$(PLATFORM)
|
||||||
ifeq ($(PUSH),true)
|
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
|
else
|
||||||
BUILD_ARGS += --output type=docker
|
BUILD_ARGS += --output type=docker
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -235,6 +235,10 @@ func (i *instances) getInstanceType(vmRef *pxapi.VmRef, region string) (string,
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if vmInfo["maxcpu"] == nil || vmInfo["maxmem"] == nil {
|
||||||
|
return "", fmt.Errorf("instances.getInstanceType() failed to get instance type")
|
||||||
|
}
|
||||||
|
|
||||||
return fmt.Sprintf("%.0fVCPU-%.0fGB",
|
return fmt.Sprintf("%.0fVCPU-%.0fGB",
|
||||||
vmInfo["maxcpu"].(float64),
|
vmInfo["maxcpu"].(float64),
|
||||||
vmInfo["maxmem"].(float64)/1024/1024/1024), nil
|
vmInfo["maxmem"].(float64)/1024/1024/1024), nil
|
||||||
|
|||||||
Reference in New Issue
Block a user