Skip to content

Commit

Permalink
Merge pull request #1621 from datawire/flynn/dev/resolver-diag
Browse files Browse the repository at this point in the history
Fix diag-report issue with resolvers
  • Loading branch information
kflynn authored Jun 13, 2019
2 parents 3ddc59e + 244cb7e commit ca02234
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions ambassador/ambassador/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def load_secret(self, context: 'IRTLSContext', secret_name: str, namespace: str)


def dump(config_dir_path: Parameter.REQUIRED, *,
watt=False, debug=False, debug_scout=False, k8s=False, recurse=False,
secret_dir_path=None, watt=False, debug=False, debug_scout=False, k8s=False, recurse=False,
aconf=False, ir=False, v2=False, diag=False, features=False):
"""
Dump various forms of an Ambassador configuration for debugging
Expand All @@ -123,6 +123,7 @@ def dump(config_dir_path: Parameter.REQUIRED, *,
will be dumped.
:param config_dir_path: Configuration directory to scan for Ambassador YAML files
:param secret_dir_path: Directory into which to save secrets
:param watt: If set, input must be a WATT snapshot
:param debug: If set, generate debugging output
:param debug_scout: If set, generate debugging output
Expand All @@ -135,6 +136,12 @@ def dump(config_dir_path: Parameter.REQUIRED, *,
:param features: If set, dump the feature set
"""

if not secret_dir_path:
secret_dir_path = config_dir_path

if not os.path.isdir(secret_dir_path):
secret_dir_path = os.path.dirname(secret_dir_path)

if debug:
logger.setLevel(logging.DEBUG)

Expand Down Expand Up @@ -174,7 +181,7 @@ def dump(config_dir_path: Parameter.REQUIRED, *,
if dump_aconf:
od['aconf'] = aconf.as_dict()

secret_handler = CLISecretHandler(logger, config_dir_path, config_dir_path, "0")
secret_handler = CLISecretHandler(logger, config_dir_path, secret_dir_path, "0")

ir = IR(aconf, file_checker=file_checker, secret_handler=secret_handler)

Expand Down
2 changes: 1 addition & 1 deletion ambassador/ambassador/diagnostics/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ def add_ambassador_resolver(self, resolver, group_list) -> None:
'kind': resolver.kind,
'_source': resolver.location,
'name': resolver.name,
'groups': group_list
'groups': [ g.as_dict() for g in group_list ]
})

@staticmethod
Expand Down

0 comments on commit ca02234

Please sign in to comment.