Skip to content

Commit 1e52c22

Browse files
committed
fix: sync chart CRD deploymentPolicy type and add smoke test
1 parent edf9604 commit 1e52c22

File tree

6 files changed

+115
-12
lines changed

6 files changed

+115
-12
lines changed

chart/templates/skyhook-crd.yaml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,7 @@ spec:
108108
deploymentPolicy:
109109
description: DeploymentPolicy is the name of a DeploymentPolicy for
110110
rollout settings
111-
properties:
112-
name:
113-
default: ""
114-
description: |-
115-
Name of the referent.
116-
This field is effectively required, but due to backwards compatibility is
117-
allowed to be empty. Instances of this type with an empty value here are
118-
almost certainly wrong.
119-
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
120-
type: string
121-
type: object
122-
x-kubernetes-map-type: atomic
111+
type: string
123112
interruptionBudget:
124113
description: InterruptionBudget configures how many nodes that match
125114
node selectors that allowed to be interrupted at once.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
18+
# SPDX-License-Identifier: Apache-2.0
19+
20+
apiVersion: skyhook.nvidia.com/v1alpha1
21+
kind: Skyhook
22+
metadata:
23+
name: helm-test-skyhook
24+
status:
25+
status: complete

k8s-tests/chainsaw/helm/helm-chart-test/chainsaw-test.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,18 @@ spec:
5050
../install-helm-chart.sh foobar
5151
- assert:
5252
file: assert-scheduled.yaml
53+
- apply:
54+
file: deployment-policy.yaml
55+
- apply:
56+
file: skyhook.yaml
57+
- assert:
58+
file: assert-skyhook-complete.yaml
5359
finally:
60+
- script:
61+
content: |
62+
## Cleanup deployment policy test resources
63+
kubectl delete skyhook helm-test-skyhook --ignore-not-found || true
64+
kubectl delete deploymentpolicy helm-test-policy -n skyhook --ignore-not-found || true
5465
- script:
5566
content: |
5667
## Remove taint from nodes
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
18+
# SPDX-License-Identifier: Apache-2.0
19+
20+
apiVersion: skyhook.nvidia.com/v1alpha1
21+
kind: DeploymentPolicy
22+
metadata:
23+
name: helm-test-policy
24+
namespace: skyhook
25+
spec:
26+
default:
27+
budget:
28+
percent: 100
29+
strategy:
30+
fixed:
31+
initialBatch: 1
32+
batchThreshold: 100
33+
safetyLimit: 50
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
18+
# SPDX-License-Identifier: Apache-2.0
19+
20+
apiVersion: skyhook.nvidia.com/v1alpha1
21+
kind: Skyhook
22+
metadata:
23+
name: helm-test-skyhook
24+
spec:
25+
nodeSelectors:
26+
matchExpressions:
27+
- key: node-role.kubernetes.io/control-plane
28+
operator: DoesNotExist
29+
deploymentPolicy: helm-test-policy
30+
additionalTolerations:
31+
- key: dedicated
32+
value: system-cpu
33+
effect: NoSchedule
34+
packages:
35+
helm-test:
36+
version: "6.2.0"
37+
image: ghcr.io/nvidia/skyhook/agentless
38+
env:
39+
- name: SLEEP_LEN
40+
value: "1"

k8s-tests/chainsaw/helm/helm-chart-test/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,10 @@ controllerManager:
2828
repository: ghcr.io/nvidia/skyhook/operator
2929
tag: latest ## THIS should change to be like a tag so it can point at a specific commit
3030
digest: ""
31+
# Use agentless mock image for testing - it just sleeps and exits successfully
32+
agent:
33+
repository: ghcr.io/nvidia/skyhook/agentless
34+
tag: "6.2.0"
35+
digest: ""
3136
webhook:
3237
enable: false

0 commit comments

Comments
 (0)