Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
Improve "not found" error message (#121)
Browse files Browse the repository at this point in the history
The current message:

```
The following image references were not found: [eu.gcr.io/robco-rodrigoq/move-endpoint:latest]
```

suggests to the untrained eye that they should check that image has not
been found on the container registry, as the user may not know that the
resolver is replacing image references inside the YAML file.

This commit changes the message to:

```
ERROR: The following image references were not found in '/your/bazel/cache/dir/execroot/__main__bazel-out/k8-opt/bin/your/package/path/k8s.runfiles/__main__/your/package/path/deployment.yaml':
    eu.gcr.io/robco-rodrigoq/move-endpoint:latest
```

which is very long but hopefully clearer, as the user can look at that
file to work out why the image reference is not found.
  • Loading branch information
drigz authored and mattmoor committed Mar 8, 2018
1 parent 8c9b9cb commit 03a073f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions k8s/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,10 @@ def _StringToDigest(t):
content = Resolve(inputs, _StringToDigest)

if len(unseen_strings) > 0:
print('The following image references were not found: [%s]' % "\n".join([
str(x) for x in unseen_strings
]),file=sys.stderr)
print('ERROR: The following image references were not found in %r:' %
args.template, file=sys.stderr)
for ref in unseen_strings:
print(' %s' % ref, file=sys.stderr)
sys.exit(1)

print(content)
Expand Down

0 comments on commit 03a073f

Please sign in to comment.