Fix "unknown apiVersion: kind.sigs.k8s.io/v1alpha3" (#76)
* Fix "unknown apiVersion: kind.sigs.k8s.io/v1alpha3" *Motivation* The api version `kind.sigs.k8s.io/v1alpha3` is not available anymore for kind clusters. So all the CI actions are broken now. This PR fix the issue. Additionally it adds a helm chart lint job to lint the chart changes. * Trigger CI when kind cluster build script is changed
This commit is contained in:
parent
fb4c44f449
commit
669af788ff
22
.ci/ct.sh
22
.ci/ct.sh
@ -23,7 +23,7 @@ set -o errexit
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
DEFAULT_IMAGE=quay.io/helmpack/chart-testing:v2.4.0
|
DEFAULT_IMAGE=quay.io/helmpack/chart-testing:v3.0.0
|
||||||
|
|
||||||
show_help() {
|
show_help() {
|
||||||
cat << EOF
|
cat << EOF
|
||||||
@ -65,12 +65,9 @@ main() {
|
|||||||
# charts changed.
|
# charts changed.
|
||||||
echo "::set-output name=changed::true"
|
echo "::set-output name=changed::true"
|
||||||
|
|
||||||
if [[ "$command" == "lint" ]] || [[ "$command" == "list-changed" ]]; then
|
|
||||||
helm_init
|
|
||||||
# All other ct commands require a cluster to be created in a previous step.
|
# All other ct commands require a cluster to be created in a previous step.
|
||||||
else
|
if [[ "$command" != "lint" ]] && [[ "$command" != "list-changed" ]]; then
|
||||||
configure_kube
|
configure_kube
|
||||||
install_tiller
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
run_ct
|
run_ct
|
||||||
@ -151,21 +148,6 @@ configure_kube() {
|
|||||||
docker cp "$kubeconfig" ct:/root/.kube/config
|
docker cp "$kubeconfig" ct:/root/.kube/config
|
||||||
}
|
}
|
||||||
|
|
||||||
install_tiller() {
|
|
||||||
echo 'Installing Tiller...'
|
|
||||||
docker_exec sh -c 'kubectl create serviceaccount tiller --namespace kube-system --save-config --dry-run \
|
|
||||||
--output=yaml | kubectl apply -f -'
|
|
||||||
docker_exec sh -c 'kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin \
|
|
||||||
--serviceaccount=kube-system:tiller --save-config --dry-run --output=yaml | kubectl apply -f -'
|
|
||||||
docker_exec helm init --service-account tiller --upgrade --wait
|
|
||||||
echo
|
|
||||||
}
|
|
||||||
|
|
||||||
helm_init() {
|
|
||||||
docker_exec helm init --client-only
|
|
||||||
echo
|
|
||||||
}
|
|
||||||
|
|
||||||
run_ct() {
|
run_ct() {
|
||||||
echo "Running 'ct $command'..."
|
echo "Running 'ct $command'..."
|
||||||
docker_exec ct "$command"
|
docker_exec ct "$command"
|
||||||
|
|||||||
48
.github/workflows/lint.yml
vendored
Normal file
48
.github/workflows/lint.yml
vendored
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
#
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
# or more contributor license agreements. See the NOTICE file
|
||||||
|
# distributed with this work for additional information
|
||||||
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
|
# to you 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
name: Precommit - Helm Chart Lint
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
paths:
|
||||||
|
- 'charts/pulsar/**'
|
||||||
|
- '.ci/ct.sh'
|
||||||
|
jobs:
|
||||||
|
lint-test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
|
- name: Check if this pull request only changes documentation
|
||||||
|
id: docs
|
||||||
|
uses: apache/pulsar-test-infra/diff-only@master
|
||||||
|
with:
|
||||||
|
args: site2 .asf.yaml ct.yaml
|
||||||
|
|
||||||
|
- name: Lint chart
|
||||||
|
id: lint
|
||||||
|
uses: helm/chart-testing-action@v1.0.0
|
||||||
|
with:
|
||||||
|
command: lint
|
||||||
1
.github/workflows/pulsar.yml
vendored
1
.github/workflows/pulsar.yml
vendored
@ -24,6 +24,7 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
paths:
|
paths:
|
||||||
- 'charts/pulsar/**'
|
- 'charts/pulsar/**'
|
||||||
|
- 'hack/kind-cluster-build.sh'
|
||||||
jobs:
|
jobs:
|
||||||
lint-test:
|
lint-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
1
.github/workflows/pulsar_bk_tls.yml
vendored
1
.github/workflows/pulsar_bk_tls.yml
vendored
@ -24,6 +24,7 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
paths:
|
paths:
|
||||||
- 'charts/pulsar/**'
|
- 'charts/pulsar/**'
|
||||||
|
- 'hack/kind-cluster-build.sh'
|
||||||
jobs:
|
jobs:
|
||||||
lint-test:
|
lint-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
1
.github/workflows/pulsar_broker_tls.yml
vendored
1
.github/workflows/pulsar_broker_tls.yml
vendored
@ -24,6 +24,7 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
paths:
|
paths:
|
||||||
- 'charts/pulsar/**'
|
- 'charts/pulsar/**'
|
||||||
|
- 'hack/kind-cluster-build.sh'
|
||||||
jobs:
|
jobs:
|
||||||
lint-test:
|
lint-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
1
.github/workflows/pulsar_function.yml
vendored
1
.github/workflows/pulsar_function.yml
vendored
@ -24,6 +24,7 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
paths:
|
paths:
|
||||||
- 'charts/pulsar/**'
|
- 'charts/pulsar/**'
|
||||||
|
- 'hack/kind-cluster-build.sh'
|
||||||
jobs:
|
jobs:
|
||||||
lint-test:
|
lint-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
1
.github/workflows/pulsar_image.yml
vendored
1
.github/workflows/pulsar_image.yml
vendored
@ -24,6 +24,7 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
paths:
|
paths:
|
||||||
- 'charts/pulsar/**'
|
- 'charts/pulsar/**'
|
||||||
|
- 'hack/kind-cluster-build.sh'
|
||||||
jobs:
|
jobs:
|
||||||
lint-test:
|
lint-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
1
.github/workflows/pulsar_jwt_asymmetric.yml
vendored
1
.github/workflows/pulsar_jwt_asymmetric.yml
vendored
@ -24,6 +24,7 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
paths:
|
paths:
|
||||||
- 'charts/pulsar/**'
|
- 'charts/pulsar/**'
|
||||||
|
- 'hack/kind-cluster-build.sh'
|
||||||
jobs:
|
jobs:
|
||||||
lint-test:
|
lint-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
1
.github/workflows/pulsar_jwt_symmetric.yml
vendored
1
.github/workflows/pulsar_jwt_symmetric.yml
vendored
@ -24,6 +24,7 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
paths:
|
paths:
|
||||||
- 'charts/pulsar/**'
|
- 'charts/pulsar/**'
|
||||||
|
- 'hack/kind-cluster-build.sh'
|
||||||
jobs:
|
jobs:
|
||||||
lint-test:
|
lint-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
1
.github/workflows/pulsar_tls.yml
vendored
1
.github/workflows/pulsar_tls.yml
vendored
@ -24,6 +24,7 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
paths:
|
paths:
|
||||||
- 'charts/pulsar/**'
|
- 'charts/pulsar/**'
|
||||||
|
- 'hack/kind-cluster-build.sh'
|
||||||
jobs:
|
jobs:
|
||||||
lint-test:
|
lint-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
1
.github/workflows/pulsar_zk_tls.yml
vendored
1
.github/workflows/pulsar_zk_tls.yml
vendored
@ -24,6 +24,7 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
paths:
|
paths:
|
||||||
- 'charts/pulsar/**'
|
- 'charts/pulsar/**'
|
||||||
|
- 'hack/kind-cluster-build.sh'
|
||||||
jobs:
|
jobs:
|
||||||
lint-test:
|
lint-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
1
.github/workflows/pulsar_zkbk_tls.yml
vendored
1
.github/workflows/pulsar_zkbk_tls.yml
vendored
@ -24,6 +24,7 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
paths:
|
paths:
|
||||||
- 'charts/pulsar/**'
|
- 'charts/pulsar/**'
|
||||||
|
- 'hack/kind-cluster-build.sh'
|
||||||
jobs:
|
jobs:
|
||||||
lint-test:
|
lint-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@ -117,7 +117,7 @@ configFile=${workDir}/kind-config.yaml
|
|||||||
|
|
||||||
cat <<EOF > ${configFile}
|
cat <<EOF > ${configFile}
|
||||||
kind: Cluster
|
kind: Cluster
|
||||||
apiVersion: kind.sigs.k8s.io/v1alpha3
|
apiVersion: kind.x-k8s.io/v1alpha4
|
||||||
nodes:
|
nodes:
|
||||||
- role: control-plane
|
- role: control-plane
|
||||||
extraPortMappings:
|
extraPortMappings:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user