Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/helm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: helm

on:
pull_request:
branches: [main]
paths:
- 'deployments/gpu-operator/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

env:
CHART_NAME: gpu-operator
CHART_DIR: deployments

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up chart-testing
uses: helm/chart-testing-action@6ec842c01de15ebb84c8627d2744a0c2f2755c9f # v2.8.0

- name: Run chart-testing (lint)
run: |
ct lint \
--target-branch ${{ github.event.repository.default_branch }} \
--all \
--validate-maintainers=false \
--chart-dirs ${{ env.CHART_DIR }}

unittest:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up Helm
uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5

- name: Install helm-unittest plugin
run: |
echo "Installing helm-unittest plugin..."
helm plugin install https://github.com/helm-unittest/helm-unittest.git --verify=false --version v1.0.3 # 6f82a998e0b5461762ca959f87f5dd344af5e4eb

- name: Run helm unittest
run: helm unittest ${{ env.CHART_DIR }}/${{ env.CHART_NAME }}
2 changes: 2 additions & 0 deletions deployments/gpu-operator/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@
.idea/
*.tmproj
.vscode/
# helm unittest
tests/
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
should match snapshot:
1: |
apiVersion: batch/v1
kind: Job
metadata:
annotations:
helm.sh/hook: pre-delete
helm.sh/hook-delete-policy: hook-succeeded,before-hook-creation
helm.sh/hook-weight: "1"
labels:
app.kubernetes.io/component: gpu-operator
app.kubernetes.io/instance: gpu-operator
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: gpu-operator
app.kubernetes.io/version: v25.0.0
helm.sh/chart: gpu-operator-v1.0.0-devel
name: gpu-operator-cleanup-crd
namespace: gpu-operator
spec:
template:
metadata:
labels:
app.kubernetes.io/component: gpu-operator
app.kubernetes.io/instance: gpu-operator
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: gpu-operator
app.kubernetes.io/version: v25.0.0
helm.sh/chart: gpu-operator-v1.0.0-devel
name: gpu-operator-cleanup-crd
spec:
containers:
- args:
- delete
- --filepath=/opt/gpu-operator/nvidia.com_clusterpolicies.yaml
- --filepath=/opt/gpu-operator/nvidia.com_nvidiadrivers.yaml
- --filepath=/opt/gpu-operator/nfd-api-crds.yaml
command:
- /usr/bin/manage-crds
image: nvcr.io/nvidia/gpu-operator:v25.0.0
imagePullPolicy: IfNotPresent
name: cleanup-crd
restartPolicy: OnFailure
serviceAccountName: gpu-operator
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
operator: Equal
value: ""
Loading
Loading