diff --git a/chart/templates/skyhook-crd.yaml b/chart/templates/skyhook-crd.yaml index 4eb332ea..3f4fe002 100644 --- a/chart/templates/skyhook-crd.yaml +++ b/chart/templates/skyhook-crd.yaml @@ -108,18 +108,7 @@ spec: deploymentPolicy: description: DeploymentPolicy is the name of a DeploymentPolicy for rollout settings - properties: - name: - default: "" - description: |- - Name of the referent. - This field is effectively required, but due to backwards compatibility is - allowed to be empty. Instances of this type with an empty value here are - almost certainly wrong. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - type: object - x-kubernetes-map-type: atomic + type: string interruptionBudget: description: InterruptionBudget configures how many nodes that match node selectors that allowed to be interrupted at once. diff --git a/k8s-tests/chainsaw/helm/helm-chart-test/assert-skyhook-complete.yaml b/k8s-tests/chainsaw/helm/helm-chart-test/assert-skyhook-complete.yaml new file mode 100644 index 00000000..263008f5 --- /dev/null +++ b/k8s-tests/chainsaw/helm/helm-chart-test/assert-skyhook-complete.yaml @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: skyhook.nvidia.com/v1alpha1 +kind: Skyhook +metadata: + name: helm-test-skyhook +status: + status: complete diff --git a/k8s-tests/chainsaw/helm/helm-chart-test/chainsaw-test.yaml b/k8s-tests/chainsaw/helm/helm-chart-test/chainsaw-test.yaml index 3fb20f8e..bd58f73c 100644 --- a/k8s-tests/chainsaw/helm/helm-chart-test/chainsaw-test.yaml +++ b/k8s-tests/chainsaw/helm/helm-chart-test/chainsaw-test.yaml @@ -50,7 +50,18 @@ spec: ../install-helm-chart.sh foobar - assert: file: assert-scheduled.yaml + - apply: + file: deployment-policy.yaml + - apply: + file: skyhook.yaml + - assert: + file: assert-skyhook-complete.yaml finally: + - script: + content: | + ## Cleanup deployment policy test resources + kubectl delete skyhook helm-test-skyhook --ignore-not-found || true + kubectl delete deploymentpolicy helm-test-policy -n skyhook --ignore-not-found || true - script: content: | ## Remove taint from nodes diff --git a/k8s-tests/chainsaw/helm/helm-chart-test/deployment-policy.yaml b/k8s-tests/chainsaw/helm/helm-chart-test/deployment-policy.yaml new file mode 100644 index 00000000..07765806 --- /dev/null +++ b/k8s-tests/chainsaw/helm/helm-chart-test/deployment-policy.yaml @@ -0,0 +1,33 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: skyhook.nvidia.com/v1alpha1 +kind: DeploymentPolicy +metadata: + name: helm-test-policy + namespace: skyhook +spec: + default: + budget: + percent: 100 + strategy: + fixed: + initialBatch: 1 + batchThreshold: 100 + safetyLimit: 50 diff --git a/k8s-tests/chainsaw/helm/helm-chart-test/skyhook.yaml b/k8s-tests/chainsaw/helm/helm-chart-test/skyhook.yaml new file mode 100644 index 00000000..63a03402 --- /dev/null +++ b/k8s-tests/chainsaw/helm/helm-chart-test/skyhook.yaml @@ -0,0 +1,40 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: skyhook.nvidia.com/v1alpha1 +kind: Skyhook +metadata: + name: helm-test-skyhook +spec: + nodeSelectors: + matchExpressions: + - key: node-role.kubernetes.io/control-plane + operator: DoesNotExist + deploymentPolicy: helm-test-policy + additionalTolerations: + - key: dedicated + value: system-cpu + effect: NoSchedule + packages: + helm-test: + version: "6.2.0" + image: ghcr.io/nvidia/skyhook/agentless + env: + - name: SLEEP_LEN + value: "1" diff --git a/k8s-tests/chainsaw/helm/helm-chart-test/values.yaml b/k8s-tests/chainsaw/helm/helm-chart-test/values.yaml index 6ea40ddb..d2c1fddd 100644 --- a/k8s-tests/chainsaw/helm/helm-chart-test/values.yaml +++ b/k8s-tests/chainsaw/helm/helm-chart-test/values.yaml @@ -28,5 +28,10 @@ controllerManager: repository: ghcr.io/nvidia/skyhook/operator tag: latest ## THIS should change to be like a tag so it can point at a specific commit digest: "" + # Use agentless mock image for testing - it just sleeps and exits successfully + agent: + repository: ghcr.io/nvidia/skyhook/agentless + tag: "6.2.0" + digest: "" webhook: enable: false