Skip to content

Commit 5c0a51b

Browse files
committed
fix: bug in uncordon logic
1 parent 2d9b615 commit 5c0a51b

File tree

5 files changed

+30
-22
lines changed

5 files changed

+30
-22
lines changed

k8s-tests/chainsaw/skyhook/strict_order/chainsaw-test.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33
#
44
#
@@ -33,6 +33,12 @@ spec:
3333
- try:
3434
- script:
3535
content: |
36+
## Verify skyhook-cli binary exists (symlink to operator/bin/skyhook)
37+
if [[ ! -x ../skyhook-cli ]]; then
38+
echo "ERROR: ../skyhook-cli does not exist or is not executable"
39+
echo "Run 'make build-cli' in the operator directory first"
40+
exit 1
41+
fi
3642
## remove annotation/labels from last run
3743
../skyhook-cli reset strict-order-skyhook-zzz --confirm 2>/dev/null || true
3844
../skyhook-cli reset strict-order-skyhook-b --confirm 2>/dev/null || true
@@ -57,7 +63,7 @@ spec:
5763
../../metrics_test.py skyhook_node_status_count 1 -t skyhook_name=strict-order-skyhook-zzz -t status=complete
5864
../../metrics_test.py skyhook_status 1 -t skyhook_name=strict-order-skyhook-c -t status=waiting
5965
../../metrics_test.py skyhook_package_state_count 1 -t package_name=foobar -t package_version=1.2 -t skyhook_name=strict-order-skyhook-zzz -t state=complete
60-
../../metrics_test.py skyhook_package_stage_count 1 -t package_name=foobar -t package_version=1.2 -t skyhook_name=strict-order-skyhook-zzz -t stage=config
66+
../../metrics_test.py skyhook_package_stage_count 1 -t package_name=foobar -t package_version=1.2 -t skyhook_name=strict-order-skyhook-zzz -t stage=post-interrupt
6167
# make sure that if it was going to start b it will start b
6268
- sleep:
6369
duration: 5s

k8s-tests/chainsaw/skyhook/strict_order/skyhook-disable-update.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33
#
44
#
@@ -31,6 +31,9 @@ spec:
3131
skyhook.nvidia.com/test-node: skyhooke2e
3232
packages:
3333
foobar:
34+
interrupt:
35+
type: service
36+
services: [cron]
3437
version: "1.2"
3538
image: ghcr.io/nvidia/skyhook/agentless
3639
env:
@@ -54,6 +57,9 @@ spec:
5457
skyhook.nvidia.com/test-node: skyhooke2e
5558
packages:
5659
foobar:
60+
interrupt:
61+
type: service
62+
services: [cron]
5763
version: "1.2"
5864
image: ghcr.io/nvidia/skyhook/agentless
5965
env:

k8s-tests/chainsaw/skyhook/strict_order/skyhook-pause-update.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33
#
44
#
@@ -31,6 +31,9 @@ spec:
3131
skyhook.nvidia.com/test-node: skyhooke2e
3232
packages:
3333
foobar:
34+
interrupt:
35+
type: service
36+
services: [cron]
3437
version: "1.2"
3538
image: ghcr.io/nvidia/skyhook/agentless
3639
env:
@@ -54,6 +57,9 @@ spec:
5457
skyhook.nvidia.com/test-node: skyhooke2e
5558
packages:
5659
foobar:
60+
interrupt:
61+
type: service
62+
services: [cron]
5763
version: "1.2"
5864
image: ghcr.io/nvidia/skyhook/agentless
5965
env:

k8s-tests/chainsaw/skyhook/strict_order/skyhook.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33
#
44
#
@@ -30,6 +30,9 @@ spec:
3030
skyhook.nvidia.com/test-node: skyhooke2e
3131
packages:
3232
foobar:
33+
interrupt:
34+
type: service
35+
services: [cron]
3336
version: "1.2"
3437
image: ghcr.io/nvidia/skyhook/agentless
3538
env:
@@ -53,6 +56,9 @@ spec:
5356
skyhook.nvidia.com/test-node: skyhooke2e
5457
packages:
5558
foobar:
59+
interrupt:
60+
type: service
61+
services: [cron]
5662
version: "1.2"
5763
image: ghcr.io/nvidia/skyhook/agentless
5864
env:

operator/internal/wrapper/node.go

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*
55
*
@@ -22,7 +22,6 @@ import (
2222
"encoding/json"
2323
"fmt"
2424
"sort"
25-
"strings"
2625

2726
"github.com/NVIDIA/skyhook/operator/api/v1alpha1"
2827
"github.com/NVIDIA/skyhook/operator/internal/graph"
@@ -396,21 +395,6 @@ func (node *skyhookNode) Cordon() {
396395

397396
func (node *skyhookNode) Uncordon() {
398397

399-
other := false
400-
for key := range node.Annotations {
401-
if strings.HasPrefix(key, fmt.Sprintf("%s/cordon_", v1alpha1.METADATA_PREFIX)) &&
402-
key != fmt.Sprintf("%s/cordon_%s", v1alpha1.METADATA_PREFIX, node.skyhookName) {
403-
other = true
404-
break
405-
}
406-
}
407-
408-
if other { // if others also hold a cordon, just remove our self
409-
delete(node.Annotations, fmt.Sprintf("%s/cordon_%s", v1alpha1.METADATA_PREFIX, node.skyhookName))
410-
node.updated = true
411-
return
412-
}
413-
414398
// if we hold a cordon remove it, also we dont want to remove a cordon if we dont have one...
415399
_, ok := node.Annotations[fmt.Sprintf("%s/cordon_%s", v1alpha1.METADATA_PREFIX, node.skyhookName)]
416400
if ok {

0 commit comments

Comments
 (0)