Skip to content

Commit 0448dbf

Browse files
committed
Address the comments
1 parent d12dbdf commit 0448dbf

File tree

2 files changed

+74
-2
lines changed

2 files changed

+74
-2
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
3+
name: helm-chart-validation
4+
5+
on:
6+
push:
7+
branches: [main, master]
8+
paths:
9+
- helpers/helm/**
10+
- helpers/hpc-mutating-webhook/**
11+
- helpers/hyper-v-mutating-webhook/**
12+
pull_request:
13+
branches: [main, master]
14+
paths:
15+
- helpers/helm/**
16+
- helpers/hpc-mutating-webhook/**
17+
- helpers/hyper-v-mutating-webhook/**
18+
- .github/workflows/helm-chart-validation.yaml
19+
workflow_dispatch:
20+
21+
jobs:
22+
validate-helm-chart:
23+
runs-on: ubuntu-latest
24+
strategy:
25+
matrix:
26+
values-file: [values.yaml, values-hpc.yaml, values-hyperv.yaml]
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: Install Helm
31+
run: curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
32+
33+
- name: Install kubeconform
34+
run: |
35+
wget -q https://github.com/yannh/kubeconform/releases/latest/download/kubeconform-linux-amd64.tar.gz
36+
tar xf kubeconform-linux-amd64.tar.gz
37+
sudo mv kubeconform /usr/local/bin
38+
39+
- name: Validate Chart with ${{ matrix.values-file }}
40+
run: |
41+
echo "🔍 Validating Helm chart with ${{ matrix.values-file }}"
42+
43+
# Lint the chart
44+
helm lint helpers/helm/
45+
46+
# Render and validate against Kubernetes schemas
47+
helm template test helpers/helm/ -f helpers/helm/${{ matrix.values-file }} | kubeconform -summary -verbose
48+
49+
echo "✅ Chart validation passed!"
50+
51+
build:
52+
runs-on: ubuntu-latest
53+
needs: validate-helm-chart
54+
steps:
55+
- uses: actions/checkout@v4
56+
57+
- name: Build both webhook images
58+
if: ${{ github.event_name != 'push' }}
59+
run: |
60+
echo "🔨 Building both HPC and Hyper-V webhook images..."
61+
cd helpers
62+
make docker-build-all
63+
echo "✅ Both webhook images built successfully!"
64+
65+
- name: Build and push webhook images to registry
66+
if: ${{ github.event_name == 'push' }}
67+
run: |
68+
echo "🚀 Building and pushing both webhook images to registry..."
69+
echo "${{ secrets.DOCKER_SECRET }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
70+
cd helpers
71+
make docker-push-all
72+
echo "✅ Both webhook images built and pushed successfully!"

helpers/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
# Override: make docker-build-all REGISTRY=myregistry.io VERSION=2.0
2121

2222
# Image registry and version (edit here or override on command line)
23-
REGISTRY ?= wcctpublic.azurecr.io/kubernetes-sigs/windows-testing
24-
VERSION ?= 10.0
23+
REGISTRY ?= sigwindowstools
24+
VERSION ?= latest
2525

2626
# Constructed image names
2727
HYPERV_IMG = $(REGISTRY)/hyperv-webhook:$(VERSION)

0 commit comments

Comments
 (0)