Skip to content

Commit 4d2ba4e

Browse files
authored
Adding more clear error message when tag is not known (#543)
* adding more clear error message when tag is not known Signed-off-by: vsoch <[email protected]>
1 parent 7e04fd7 commit 4d2ba4e

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: |
2828
export PATH="/usr/share/miniconda/bin:$PATH"
2929
source activate black
30-
pip install black==20.8b1
30+
pip install black
3131
black --check shpc
3232
3333
- name: Check imports with pyflakes

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are:
1414
The versions coincide with releases on pip. Only major versions will be released as tags on Github.
1515

1616
## [0.0.x](https://github.com/singularityhub/singularity-hpc/tree/main) (0.0.x)
17+
- better error message if container tag does not exist on update (0.0.52)
1718
- minimum version of spython required is 0.2.0 to support apptainer (0.0.51)
1819
- add support for TCL and LMOD default version, multiple variants (0.0.50)
1920
- refactor to "add" to generate a container.yaml first (0.0.49)

shpc/main/container/update/docker.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,19 @@ def tags(self):
3737

3838
def manifest(self, tag):
3939
url = "%s/manifest/%s:%s" % (self.apiroot, self.container_name, tag)
40-
return self.get_request(url).json()
40+
response = self.get_request(url)
41+
return response.json()
4142

4243
def digest(self, tag):
4344
url = "%s/digest/%s:%s" % (self.apiroot, self.container_name, tag)
44-
response = self.get_request(url).text
45+
response = self.get_request(url)
4546
if "could not parse reference" in response:
4647
logger.exit("Issue getting digest: %s" % response)
47-
return self.get_request(url).text
48+
if "MANIFEST_UNKNOWN" in response.text:
49+
logger.exit(
50+
f"The tag {tag} you provided is not known. Check that it and the container both exist."
51+
)
52+
return response.text
4853

4954
def config(self):
5055
url = "%s/config/%s" % (self.apiroot, self.container_name)

shpc/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
__copyright__ = "Copyright 2021-2022, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

5-
__version__ = "0.0.51"
5+
__version__ = "0.0.52"
66
AUTHOR = "Vanessa Sochat"
77
NAME = "singularity-hpc"
88
PACKAGE_URL = "https://github.com/singularityhub/singularity-hpc"

0 commit comments

Comments
 (0)