pre-upgrade job to verify function references and restricted privileges for fetcher and builder SA (#717)

It is mandatory (from this release onwards) for function to refer to secrets, config-maps and packages in its own namespace to ensure isolation of users sharing the same cluster.
This change runs a pre-upgrade job to verify function references for all functions created prior to this release and fails the upgrade by printing a list of functions that violate this restriction.
This commit is contained in:
smruthi2187
2018-06-04 19:30:27 -07:00
committed by GitHub
parent 0057270551
commit 2e37611da8
12 changed files with 417 additions and 4 deletions
+29
View File
@@ -250,6 +250,31 @@ build_charts() {
popd
}
# Build pre-upgrade-checks image
build_pre_upgrade_checks_image() {
local version=$1
local date=$2
local gitcommit=$3
local tag=fission/pre-upgrade-checks:$version
pushd $DIR/preupgradechecks
./build.sh $version $date $gitcommit
docker build -t $tag .
docker tag $tag fission/pre-upgrade-checks:latest
popd
}
# Push pre-upgrade-checks image
push_pre_upgrade_checks_image() {
local version=$1
local tag=fission/pre-upgrade-checks:$version
docker push $tag
}
build_all() {
local version=$1
@@ -289,6 +314,7 @@ build_all() {
build_logger_image $version
build_all_cli $version $date $gitcommit
build_charts $version
build_pre_upgrade_checks_image $version $date $gitcommit
}
push_all() {
@@ -304,6 +330,9 @@ push_all() {
push_logger_image $version
push_logger_image latest
push_pre_upgrade_checks_image $version
push_pre_upgrade_checks_image latest
}
tag_and_release() {