File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -25,3 +25,4 @@ ${PKG_ROOT}/hack/verify-yamllint.sh
25
25
${PKG_ROOT} /hack/verify-boilerplate.sh
26
26
${PKG_ROOT} /hack/verify-helm-chart-files.sh
27
27
${PKG_ROOT} /hack/verify-helm-chart.sh
28
+ ${PKG_ROOT} /hack/verify-helm-chart-index.sh
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Copyright 2020 The Kubernetes Authors.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ set -euo pipefail
18
+
19
+ readonly PKG_ROOT=" $( git rev-parse --show-toplevel) "
20
+
21
+ INDEX=${PKG_ROOT} /charts/index.yaml
22
+
23
+ function check_url() {
24
+ url=$1
25
+ result=$( curl -I -m 5 -s -w " %{http_code}\n" -o /dev/null $1 )
26
+ if [ $result -ne 200 ]
27
+ then
28
+ echo " Error: $1 is fail."
29
+ echo " Error: wrong pkg in " ${PKG_ROOT}${url#* master}
30
+ exit 1
31
+ fi
32
+ }
33
+
34
+ function check_yaml() {
35
+ grep http $INDEX | while read LINE
36
+ do
37
+ url=$( echo " $LINE " | awk -F " " ' {print $2}' )
38
+ check_url $url
39
+ done
40
+ }
41
+
42
+ echo " begin to verify helm chart index ..."
43
+ check_yaml
44
+ echo " all url in helm chart index have been checked"
You can’t perform that action at this time.
0 commit comments