Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Verify Job to check consistency between generate yaml and the yam… #373

Merged
merged 2 commits into from
Jul 23, 2019
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
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ jobs:
- go get -u golang.org/x/lint/golint
script:
- make verify
- stage: Verify Deployment Yaml
script:
- echo "Verifying contents of installer/development.yaml with generated yaml"
- make TAG=latest generate-yaml
- make verify-generated-yaml
- stage: UT Tests
before_script:
- go get github.com/mattn/goveralls
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,7 @@ verify: generate-code
hack/verify-gofmt.sh
hack/verify-golint.sh
hack/verify-gencode.sh

verify-generated-yaml:
./hack/check-generated-yaml.sh

33 changes: 33 additions & 0 deletions hack/check-generated-yaml.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Copyright 2019 The Volcano 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.

set -o errexit
set -o nounset
set -o pipefail

VK_ROOT=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/..
export RELEASE_FOLDER=${VK_ROOT}/${RELEASE_DIR}


if ! diff ${VK_ROOT}/installer/volcano-development.yaml ${RELEASE_FOLDER}/volcano-latest.yaml ; then
{
echo
echo "The Generated yaml is different from the one in installer/volcano-development.yaml"
echo "Suggest to sync both the files"
echo
} >&2
false
fi
25 changes: 13 additions & 12 deletions installer/volcano-development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ data:
- name: predicates
- name: proportion
- name: nodeorder

---
apiVersion: v1
kind: ServiceAccount
Expand Down Expand Up @@ -134,13 +134,13 @@ spec:
app: volcano-scheduler
spec:
serviceAccount: volcano-scheduler

containers:
- name: volcano-scheduler
image: volcanosh/vc-scheduler:latest
args:
- --alsologtostderr
- --scheduler-conf=/volcano.scheduler/volcano-scheduler-ci.conf
- --scheduler-conf=/volcano.scheduler/volcano-scheduler.conf
- -v=3
- 2>&1
imagePullPolicy: "IfNotPresent"
Expand Down Expand Up @@ -223,7 +223,7 @@ spec:
app: volcano-admission
spec:
serviceAccount: volcano-admission

containers:
- args:
- --tls-cert-file=/admission.local.config/certificates/tls.crt
Expand Down Expand Up @@ -372,15 +372,15 @@ spec:
app: volcano-controller
spec:
serviceAccount: volcano-controllers

containers:
- name: volcano-controllers
image: volcanosh/vc-controllers:latest
args:
- --alsologtostderr
- -v=4
- 2>&1
imagePullPolicy: "IfNotPresent"
- name: volcano-controllers
image: volcanosh/vc-controllers:latest
args:
- --alsologtostderr
- -v=4
- 2>&1
imagePullPolicy: "IfNotPresent"

---
# Source: volcano/templates/batch_v1alpha1_job.yaml
Expand Down Expand Up @@ -800,3 +800,4 @@ spec:
type: object
type: object
version: v1alpha2