Skip to content

Commit

Permalink
Skip deprecation check if VersionApi is unavailable (#102) (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
furiousassault committed Jul 26, 2019
1 parent 89f9b03 commit f02d82c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions k8s_handle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,18 @@ def _handler_provision(command, resources, priority_evaluator, use_kubeconfig, s
log.info("Default namespace is not set. "
"This may lead to provisioning error, if namespace is not set for each resource.")

d = ApiDeprecationChecker(client.VersionApi().get_code().git_version[1:])
p = Provisioner(command, sync_mode, show_logs)
try:
deprecation_checker = ApiDeprecationChecker(client.VersionApi().get_code().git_version[1:])

for resource in resources:
d.run(resource)
for resource in resources:
deprecation_checker.run(resource)
except client.api_client.ApiException:
log.warning("Error while getting API version, deprecation check will be skipped.")

provisioner = Provisioner(command, sync_mode, show_logs)

for resource in resources:
p.run(resource)
provisioner.run(resource)


parser = argparse.ArgumentParser(description='CLI utility generate k8s resources by templates and apply it to cluster')
Expand Down

0 comments on commit f02d82c

Please sign in to comment.