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.
19 lines
520 B
Bash
Executable File
19 lines
520 B
Bash
Executable File
#!/bin/sh
|
|
version=$1
|
|
if [ -z $version ]; then
|
|
version=$(git rev-parse HEAD)
|
|
fi
|
|
|
|
date=$2
|
|
if [ -z $date ]; then
|
|
date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
|
fi
|
|
|
|
gitcommit=$3
|
|
if [ -z $gitcommit ]; then
|
|
gitcommit=$(git rev-parse HEAD)
|
|
fi
|
|
|
|
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH -ldflags "-X github.com/fission/fission.GitCommit=$gitcommit -X github.com/fission/fission.BuildDate=$date -X github.com/fission/fission.Version=$version" -o pre-upgrade-checks
|