Skip to content

Commit

Permalink
Get arch from config and not data when generating image (#3507)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Mar 11, 2022
1 parent 45e54d9 commit a82b4aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions supervisor/addons/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,10 +626,11 @@ def _image(self, config) -> str:
"""Generate image name from data."""
# Repository with Dockerhub images
if ATTR_IMAGE in config:
return config[ATTR_IMAGE].format(arch=self.arch)
arch = self.sys_arch.match(config[ATTR_ARCH])
return config[ATTR_IMAGE].format(arch=arch)

# local build
return f"{config[ATTR_REPOSITORY]}/{self.arch}-addon-{config[ATTR_SLUG]}"
return f"{config[ATTR_REPOSITORY]}/{self.sys_arch.default}-addon-{config[ATTR_SLUG]}"

def install(self) -> Awaitable[None]:
"""Install this add-on."""
Expand Down

0 comments on commit a82b4aa

Please sign in to comment.