Skip to content

Commit 345580f

Browse files
committed
feat: change Gpunode to clusterlevel resource
1 parent 107f4f9 commit 345580f

File tree

5 files changed

+3
-5
lines changed

5 files changed

+3
-5
lines changed

PROJECT

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ resources:
1818
version: v1
1919
- api:
2020
crdVersion: v1
21-
namespaced: true
2221
controller: true
2322
domain: tensor-fusion.ai
2423
kind: GPUNode

api/v1/gpunode_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type GPUNodeStatus struct {
2929

3030
// +kubebuilder:object:root=true
3131
// +kubebuilder:subresource:status
32-
32+
// +kubebuilder:resource:scope=Cluster
3333
// GPUNode is the Schema for the gpunodes API.
3434
type GPUNode struct {
3535
metav1.TypeMeta `json:",inline"`

config/crd/bases/tensor-fusion.ai_gpunodes.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spec:
1212
listKind: GPUNodeList
1313
plural: gpunodes
1414
singular: gpunode
15-
scope: Namespaced
15+
scope: Cluster
1616
versions:
1717
- name: v1
1818
schema:

config/samples/v1_gpunode.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ metadata:
55
app.kubernetes.io/name: tensor-fusion-operator
66
app.kubernetes.io/managed-by: kustomize
77
name: gpunode-sample
8-
namespace: tensor-fusion
98
status:
109
capacity:
1110
tflops: '200'

internal/controller/tensorfusionconnection_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func (r *TensorFusionConnectionReconciler) handleDeletion(ctx context.Context, c
129129

130130
// Get the node
131131
node := &tfv1.GPUNode{}
132-
if err := r.Get(ctx, client.ObjectKey{Name: connection.Status.Node, Namespace: connection.Namespace}, node); err != nil {
132+
if err := r.Get(ctx, client.ObjectKey{Name: connection.Status.Node}, node); err != nil {
133133
if errors.IsNotFound(err) {
134134
// Node is already gone, nothing to do
135135
return nil

0 commit comments

Comments
 (0)