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
58 changes: 58 additions & 0 deletions .github/workflows/helm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false

- 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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false

- name: Set up Helm
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1

- 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟨 Unverified Helm plugin executes in CI

On every chart pull request, helm plugin install runs code from a mutable tag without verifying its signature. The commit SHA in the comment does not pin the installed code.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.


- 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,61 @@
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/nvidia.com_gpuclusters.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
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
nodeSelector:
kubernetes.io/os: linux
restartPolicy: OnFailure
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
serviceAccountName: gpu-operator
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
operator: Equal
value: ""
Loading
Loading