From 1dffb870374b2c71cff3f49a1253675eb8f4b62f Mon Sep 17 00:00:00 2001 From: Nikhita Raghunath Date: Fri, 24 Jul 2020 14:33:05 +0530 Subject: [PATCH] hack: ensure go version is not specified for master in publishing rules The go version for all master branches is defined in `default-go-version` locally. Note that this validation isn't added to publishing-bot directly because we still want to give users of the publishing-bot the ability to specify specific go versions for the master branch if they need, but we want to explicitly disallow this for kubernetes repos. --- hack/verify-publishing-bot.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hack/verify-publishing-bot.py b/hack/verify-publishing-bot.py index 6881efb7e93..fdab858d13f 100755 --- a/hack/verify-publishing-bot.py +++ b/hack/verify-publishing-bot.py @@ -86,6 +86,11 @@ def main(): if branch["source"]["branch"] != "master": raise Exception("cannot find master source branch for destination %s" % rule["destination"]) + # we specify the go version for all master branches through `default-go-version` + # so ensure we don't specify explicit go version for master branch in rules + if "go" in branch: + raise Exception("go version must not be specified for master branch for destination %s" % rule["destination"]) + print("processing : %s" % rule["destination"]) if rule["destination"] not in gomod_dependencies: raise Exception("missing go.mod for %s" % rule["destination"])