Skip to content

Commit

Permalink
Adds missing logging (v0.3.0 -> v0.3.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLonelyGhost committed Nov 7, 2019
1 parent 6d27526 commit 0a52b50
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
We follow [Semantic Versioning](http://semver.org/) as a way of measuring stability of an update. This
means we will never make a backwards-incompatible change within a major version of the project.

## [0.3.1] - 2019-11-07

- Missing `--verbose` flag to crank up the logging
- Adds more logging statements for later troubleshooting, if need be

## [0.3.0] - 2019-11-07

- Uses the TLS verification settings already present in the kube config
Expand Down
2 changes: 1 addition & 1 deletion oc_auth/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.3.0'
__version__ = '0.3.1'
9 changes: 7 additions & 2 deletions oc_auth/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ def get_args():
help='The name of the credential in ~/.kube/config to update (OPTIONAL)')

p.add_argument('--insecure', action='store_const', dest='verify', const=False, default=True)
p.add_argument('--verbose', action='store_const', dest='log_level', const=logging.DEBUG, default=logging.INFO)

return p.parse_args()


def get_context_mapping(kube_config: KubeConfig, name=None, cluster=None, credential=None) -> KubeConfigDataSnippet:
def get_context_mapping(kube_config: KubeConfig, name=_missing, cluster=None, credential=None) -> KubeConfigDataSnippet:
if name is _missing:
name = kube_config.data.value.get('current-context')

Expand Down Expand Up @@ -111,8 +112,12 @@ def disable_tls_verification():


def main():
logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s')
opts = get_args()
logging.basicConfig(level=opts.log_level, format='%(levelname)s: %(message)s')
logging.debug('Given context: {}'.format(opts.context))
logging.debug('Given cluster: {}'.format(opts.cluster))
logging.debug('Given credential: {}'.format(opts.credential))
logging.debug('Given TLS verification: {}'.format('yes' if opts.verify else 'no'))

kube_config = KubeConfig.find_from_env()

Expand Down

0 comments on commit 0a52b50

Please sign in to comment.