Skip to content

Commit c02c7c3

Browse files
authored
Merge pull request #186 from k8s-proxmox/fix/nil-pointer
Fix/nil pointer
2 parents e66aef3 + 0598c44 commit c02c7c3

9 files changed

+260
-263
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ KIND ?= $(LOCALBIN)/kind
2828

2929
## Tool Versions
3030
KUSTOMIZE_VERSION ?= v5.0.0
31-
CONTROLLER_TOOLS_VERSION ?= v0.11.3
31+
CONTROLLER_TOOLS_VERSION ?= v0.17.1
3232
ENVSUBST_VER ?= v1.4.2
3333
KUBECTL_VER := v1.25.10
3434
TILT_VER := 0.33.6

api/v1beta1/zz_generated.deepcopy.go

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cloud/scheduler/plugins/noderesource/node_resrouce.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,7 @@ func (pl *NodeResource) Score(ctx context.Context, state *framework.CycleState,
2828
maxMem := nodeInfo.Node().MaxMem
2929
u := cpu / float32(maxCPU) * float32(mem/maxMem)
3030
score := int64(1 / u)
31-
return score, nil
31+
status := framework.NewStatus()
32+
status.SetCode(1)
33+
return score, status
3234
}

cloud/scheduler/queue/queue_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import (
55
"testing"
66
"time"
77

8-
. "github.com/onsi/ginkgo/v2"
9-
. "github.com/onsi/gomega"
108
"github.com/k8s-proxmox/cluster-api-provider-proxmox/cloud/scheduler/queue"
119
"github.com/k8s-proxmox/proxmox-go/api"
10+
. "github.com/onsi/ginkgo/v2"
11+
. "github.com/onsi/gomega"
1212
)
1313

1414
func TestQueue(t *testing.T) {

config/crd/bases/infrastructure.cluster.x-k8s.io_proxmoxclusters.yaml

+40-32
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.11.3
7-
creationTimestamp: null
6+
controller-gen.kubebuilder.io/version: v0.17.1
87
name: proxmoxclusters.infrastructure.cluster.x-k8s.io
98
spec:
109
group: infrastructure.cluster.x-k8s.io
@@ -38,14 +37,19 @@ spec:
3837
description: ProxmoxCluster is the Schema for the proxmoxclusters API
3938
properties:
4039
apiVersion:
41-
description: 'APIVersion defines the versioned schema of this representation
42-
of an object. Servers should convert recognized schemas to the latest
43-
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
40+
description: |-
41+
APIVersion defines the versioned schema of this representation of an object.
42+
Servers should convert recognized schemas to the latest internal value, and
43+
may reject unrecognized values.
44+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
4445
type: string
4546
kind:
46-
description: 'Kind is a string value representing the REST resource this
47-
object represents. Servers may infer this from the endpoint the client
48-
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
47+
description: |-
48+
Kind is a string value representing the REST resource this object represents.
49+
Servers may infer this from the endpoint the client submits requests to.
50+
Cannot be updated.
51+
In CamelCase.
52+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
4953
type: string
5054
metadata:
5155
type: object
@@ -79,10 +83,14 @@ spec:
7983
proxmox login secrets
8084
properties:
8185
name:
82-
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
86+
description: |-
87+
Name of the referent.
88+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
8389
type: string
8490
namespace:
85-
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
91+
description: |-
92+
Namespace of the referent.
93+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
8694
type: string
8795
required:
8896
- name
@@ -112,37 +120,37 @@ spec:
112120
operational state.
113121
properties:
114122
lastTransitionTime:
115-
description: Last time the condition transitioned from one status
116-
to another. This should be when the underlying condition changed.
117-
If that is not known, then using the time when the API field
118-
changed is acceptable.
123+
description: |-
124+
Last time the condition transitioned from one status to another.
125+
This should be when the underlying condition changed. If that is not known, then using the time when
126+
the API field changed is acceptable.
119127
format: date-time
120128
type: string
121129
message:
122-
description: A human readable message indicating details about
123-
the transition. This field may be empty.
130+
description: |-
131+
A human readable message indicating details about the transition.
132+
This field may be empty.
124133
type: string
125134
reason:
126-
description: The reason for the condition's last transition
127-
in CamelCase. The specific API may choose whether or not this
128-
field is considered a guaranteed API. This field may not be
129-
empty.
135+
description: |-
136+
The reason for the condition's last transition in CamelCase.
137+
The specific API may choose whether or not this field is considered a guaranteed API.
138+
This field may not be empty.
130139
type: string
131140
severity:
132-
description: Severity provides an explicit classification of
133-
Reason code, so the users or machines can immediately understand
134-
the current situation and act accordingly. The Severity field
135-
MUST be set only when Status=False.
141+
description: |-
142+
Severity provides an explicit classification of Reason code, so the users or machines can immediately
143+
understand the current situation and act accordingly.
144+
The Severity field MUST be set only when Status=False.
136145
type: string
137146
status:
138147
description: Status of the condition, one of True, False, Unknown.
139148
type: string
140149
type:
141-
description: Type of condition in CamelCase or in foo.example.com/CamelCase.
142-
Many .condition.type values are consistent across resources
143-
like Available, but because arbitrary conditions can be useful
144-
(see .node.status.conditions), the ability to deconflict is
145-
important.
150+
description: |-
151+
Type of condition in CamelCase or in foo.example.com/CamelCase.
152+
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
153+
can be useful (see .node.status.conditions), the ability to deconflict is important.
146154
type: string
147155
required:
148156
- lastTransitionTime
@@ -152,9 +160,9 @@ spec:
152160
type: array
153161
failureDomains:
154162
additionalProperties:
155-
description: FailureDomainSpec is the Schema for Cluster API failure
156-
domains. It allows controllers to understand how many failure
157-
domains a cluster can optionally span across.
163+
description: |-
164+
FailureDomainSpec is the Schema for Cluster API failure domains.
165+
It allows controllers to understand how many failure domains a cluster can optionally span across.
158166
properties:
159167
attributes:
160168
additionalProperties:

0 commit comments

Comments
 (0)