1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 05:14:13 +01:00

Merge pull request #607 from a7i/fix-helm-test

Place bash shebang at the top of the script + Ensure Helm installed for run-helm-tests
This commit is contained in:
Kubernetes Prow Robot
2021-07-27 00:40:45 -07:00
committed by GitHub
5 changed files with 17 additions and 14 deletions

View File

@@ -25,7 +25,7 @@ ARCHS = amd64 arm arm64
LDFLAGS=-ldflags "-X ${LDFLAG_LOCATION}.version=${VERSION} -X ${LDFLAG_LOCATION}.buildDate=${BUILD} -X ${LDFLAG_LOCATION}.gitbranch=${BRANCH} -X ${LDFLAG_LOCATION}.gitsha1=${SHA1}"
GOLANGCI_VERSION := v1.30.0
HAS_GOLANGCI := $(shell ls _output/bin/golangci-lint)
HAS_GOLANGCI := $(shell ls _output/bin/golangci-lint 2> /dev/null)
# REGISTRY is the container registry to push
# into. The default is to push to the staging
@@ -43,7 +43,7 @@ IMAGE_GCLOUD:=$(REGISTRY)/descheduler:$(VERSION)
# In the future binaries can be uploaded to
# GCS bucket gs://k8s-staging-descheduler.
HAS_HELM := $(shell which helm)
HAS_HELM := $(shell which helm 2> /dev/null)
all: build
@@ -135,11 +135,13 @@ ifndef HAS_GOLANGCI
endif
./_output/bin/golangci-lint run
lint-chart:
lint-chart: ensure-helm-install
helm lint ./charts/descheduler
test-helm: ensure-helm-install
./test/run-helm-tests.sh
ensure-helm-install:
ifndef HAS_HELM
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 && chmod 700 ./get_helm.sh && ./get_helm.sh
endif
helm lint ./charts/descheduler
test-helm:
./test/run-helm-tests.sh

BIN
kind Executable file

Binary file not shown.

View File

@@ -1,3 +1,5 @@
#!/usr/bin/env bash
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#!/bin/bash
set -x
set -o errexit
set -o nounset

View File

@@ -1,3 +1,5 @@
#!/usr/bin/env bash
# Copyright 2021 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
@@ -28,8 +29,8 @@ mv kind-linux-amd64 kind
export PATH=$PATH:$PWD
kind create cluster --image kindest/node:"${K8S_VERSION}" --config=./hack/kind_config.yaml
kind load docker-image descheduler:helm-test
helm install descheduler-ci --set image.repository="${IMAGE_REPO}",image.tag="${IMAGE_TAG}" --namespace kube-system "${CHART_LOCATION}"
sleep 20s
helm install descheduler-ci --set image.repository="${IMAGE_REPO}",image.tag="${IMAGE_TAG}",schedule="* * * * *" --namespace kube-system "${CHART_LOCATION}"
sleep 61 # sleep until Job is triggered
helm test descheduler-ci --namespace kube-system
# Delete kind cluster once test is finished

View File

@@ -1,3 +1,5 @@
#!/usr/bin/env bash
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#!/bin/bash
set -x
set -o errexit
set -o nounset