Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

WIP Add an option to igore version specified in image.yaml #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dogen/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def run(self):
'--version', action='version', help='Show version and exit', version=version)

parser.add_argument('--without-sources', '--ws', action='store_true', help='Do not process sources, only generate Dockerfile')
parser.add_argument('--ignore-version', action='store_true', help='Allow to use different version of Dogen than specifed in descriptor')
parser.add_argument('--skip-ssl-verification', action='store_true', help='Should we skip SSL verification when retrieving data?')
parser.add_argument('--scripts-path', help='Location of the scripts directory containing script packages.')
parser.add_argument('--additional-script', action='append', help='Location of additional script (can be url). Can be specified multiple times.')
Expand Down
7 changes: 6 additions & 1 deletion dogen/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def __init__(self, log, args, plugins=[]):
self.template = args.template
self.scripts_path = args.scripts_path
self.additional_scripts = args.additional_script
self.ignore_version = args.ignore_version

ssl_verify = None
if args.skip_ssl_verification:
Expand Down Expand Up @@ -109,7 +110,11 @@ def configure(self):
# Check if the current runnig version of Dogen
# is the one the descriptor is expecting.
if required_version != version:
raise Error("You try to parse descriptor that requires Dogen version %s, but you run version %s" % (required_version, version))
message = "You try to parse descriptor that requires Dogen version %s, but you run version %s" % (required_version, version)
if self.ignore_version:
self.log.warn(message)
else:
raise Error(message)

ssl_verify = dogen_cfg.get('ssl_verify')

Expand Down