File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 33import sys
44import argparse
55
6+ ALLOWED_RELEASE_OPTIONS = frozenset (
7+ ["mongodb-kubernetes-operator" , "version-upgrade-hook" ]
8+ )
9+
610
711def parse_args () -> argparse .Namespace :
812 parser = argparse .ArgumentParser ()
@@ -35,7 +39,7 @@ def parse_args() -> argparse.Namespace:
3539 parser .add_argument (
3640 "--image_type" ,
3741 help = "Type of image to be released" ,
38- choices = [ "mongodb-kubernetes-operator" , "version-upgrade-hook" ] ,
42+ choices = ALLOWED_RELEASE_OPTIONS ,
3943 )
4044 args = parser .parse_args ()
4145
@@ -47,18 +51,15 @@ def main() -> int:
4751 with open (args .release_file ) as f :
4852 release = json .load (f )
4953
50- if args .image_type == "operator" :
51- new_tag = release ["mongodb-kubernetes-operator" ]
52- elif args .image_type == "versionhook" :
53- new_tag = release ["version-upgrade-hook" ]
54- else :
55- print (f"Image type{ args .image_type } is not supported by the release script!" )
54+ if args .image_type not in ALLOWED_RELEASE_OPTIONS :
55+ print (f"Image type { args .image_type } is not supported by the release script!" )
5656 return 1
57+
5758 dockerutil .retag_image (
5859 args .old_repo_url ,
5960 args .new_repo_url ,
6061 args .old_tag ,
61- new_tag ,
62+ release [ args . image_type ] ,
6263 args .path ,
6364 args .labels ,
6465 args .username ,
You can’t perform that action at this time.
0 commit comments