Skip to content

Commit

Permalink
Make latest version check optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Karandash8 committed Jul 16, 2024
1 parent 6084695 commit 6131686
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions make_argocd_fly/cli_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def __init__(self) -> None:
self.clean = None
self.print_vars = None
self.var_identifier = None
self.skip_latest_version_check = None
self.yaml_linter = None
self.kube_linter = None
self.loglevel = None
Expand Down Expand Up @@ -81,6 +82,11 @@ def get_var_identifier(self):
raise Exception("var_identifier is not set")
return self.var_identifier

def get_skip_latest_version_check(self):
if self.skip_latest_version_check is None:
raise Exception("skip_latest_version_check is not set")
return self.skip_latest_version_check

def get_yaml_linter(self):
if self.yaml_linter is None:
raise Exception("yaml_linter is not set")
Expand Down
7 changes: 5 additions & 2 deletions make_argocd_fly/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,18 @@ def main() -> None:
parser.add_argument('--clean', action='store_true', help='Clean all applications in output directory')
parser.add_argument('--print-vars', action='store_true', help='Print variables for each application')
parser.add_argument('--var-identifier', type=str, default='$', help='Variable prefix in config.yml file (default: $)')
parser.add_argument('--skip-latest-version-check', action='store_true', help='Skip latest version check')
parser.add_argument('--yaml-linter', action='store_true', help='Run yamllint against output directory (https://github.com/adrienverge/yamllint)')
parser.add_argument('--kube-linter', action='store_true', help='Run kube-linter against output directory (https://github.com/stackrox/kube-linter)')
parser.add_argument('--loglevel', type=str, default='INFO', help='DEBUG, INFO, WARNING, ERROR, CRITICAL')
args = parser.parse_args()

init_logging(args.loglevel)
latest_version_check()

cli_args = populate_cli_args(**vars(args))
if not cli_args.get_skip_latest_version_check():
latest_version_check()
else:
log.warn('Skipping latest version check')
config = read_config(args.root_dir, args.config_file, cli_args)

tmp_dir = config.get_tmp_dir()
Expand Down

0 comments on commit 6131686

Please sign in to comment.