Skip to content
Merged
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
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ vet: ## Run go vet against code.
go vet ./...

.PHONY: test
test: generate fmt vet envtest image-build verify-crds ## Run tests.
test: generate fmt vet envtest image-build verify-crds verify-helm-charts ## Run tests.
CGO_ENABLED=1 KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e | grep -v /conformance) -race -coverprofile cover.out

.PHONY: test-unit
Expand Down Expand Up @@ -174,6 +174,10 @@ verify: vet fmt-verify generate ci-lint api-lint verify-all
verify-crds: kubectl-validate
hack/verify-manifests.sh

.PHONY: verify-helm-charts
verify-helm-charts: helm-install
hack/verify-helm.sh

# Run static analysis.
.PHONY: verify-all
verify-all:
Expand Down Expand Up @@ -423,8 +427,9 @@ $(GOLANGCI_API_LINT):
yq: ## Download yq locally if necessary.
GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on go install github.com/mikefarah/yq/v4@$(YQ_VERSION)

.PHONY: helm
helm: ## Download helm locally if necessary.
.PHONY: helm-install
helm-install: $(HELM) ## Download helm locally if necessary.
$(HELM): $(LOCALBIN)
GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on go install helm.sh/helm/v3/cmd/helm@$(HELM_VERSION)

.PHONY: kubectl-validate
Expand Down
43 changes: 43 additions & 0 deletions hack/verify-helm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

# Copyright 2025 The Kubernetes Authors.
#
# 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.

SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")/..

declare -A test_cases_inference_pool

# InferencePool Helm Chart test cases
test_cases_inference_pool["basic"]="--set inferencePool.modelServers.matchLabels.app=llm-instance-gateway"
test_cases_inference_pool["gke-provider"]="--set provider.name=gke --set inferencePool.modelServers.matchLabels.app=llm-instance-gateway"
test_cases_inference_pool["multiple-replicas"]="--set inferencePool.replicas=3 --set inferencePool.modelServers.matchLabels.app=llm-instance-gateway"

# Run the install command in case this script runs from a different bash
# source (such as in the verify-all script)
make helm-install

# Running tests cases
echo "Running helm template command for inferencePool chart..."
# Loop through the keys of the associative array
for key in "${!test_cases_inference_pool[@]}"; do
echo "Running test: $key"
${SCRIPT_ROOT}/bin/helm template ${SCRIPT_ROOT}/config/charts/inferencepool ${test_cases_inference_pool[$key]} --output-dir="${SCRIPT_ROOT}/bin"
if [ $? -ne 0 ]; then
echo "Helm template command failed for test: $key"
exit 1
fi
done



2 changes: 2 additions & 0 deletions hack/verify-manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ main() {
fetch_crds "https://raw.githubusercontent.com/GoogleCloudPlatform/gke-gateway-api/refs/tags/${GKE_GATEWAY_API_VERSION}/config/crd/networking.gke.io_healthcheckpolicies.yaml"
fetch_crds "https://raw.githubusercontent.com/istio/istio/refs/tags/${ISTIO_VERSION}/manifests/charts/base/files/crd-all.gen.yaml"

# Run the install command in case this script runs from a different bash
# source (such as in the verify-all script)
make kubectl-validate

${SCRIPT_ROOT}/bin/kubectl-validate "${TEMP_DIR}"
Expand Down