I found an issue deploying a k8s bundle through libjuju that is causing two problems:
When a charm is pointing to the charm store, even if a resource is override in the bundle, libjuju tries to get the information of the resource from the charm store.
When I point to a local charm, it tries to get the resource from the charm store and it will fail with a 404 not found url.
The charm can be downloaded executing this command:
charm pull cs:~charmed-osm/squid-0
Script used for the testing:
from juju import loop
from juju.model import Model
async def main():
model = Model()
print('Connecting to model')
# Connect to current model with current user, per Juju CLI
await model.connect()
try:
print('Deploying bundle')
applications = await model.deploy(
'./k8s-bundle',
)
print('Waiting for active')
await model.block_until(
lambda: all(unit.workload_status == 'active'
for application in applications for unit in application.units))
print("Successfully deployed!")
print('Removing bundle')
for application in applications:
await application.remove()
finally:
print('Disconnecting from model')
await model.disconnect()
print("Success")
if __name__ == '__main__':
loop.run(main())
Error when deploying it with libjuju:
Connecting to model
Deploying bundle
Disconnecting from model
Success
Traceback (most recent call last):
File "/home/davigar15/code/python-libjuju/lib/python3.8/site-packages/theblues/charmstore.py", line 78, in _get
response.raise_for_status()
File "/home/davigar15/code/python-libjuju/lib/python3.8/site-packages/requests/models.py", line 941, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.jujucharms.com/charmstore/v5/k8s-bundle/meta/any?include=bundle-machine-count&include=bundle-metadata&include=bundle-unit-count&include=charm-actions&include=charm-config&include=charm-metadata&include=common-info&include=extra-info&include=owner&include=published&include=resources&include=supported-series&include=terms
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "../deploy_bundle.py", line 40, in <module>
loop.run(main())
File "/home/davigar15/code/python-libjuju/juju/loop.py", line 38, in run
raise task.exception()
File "../deploy_bundle.py", line 21, in main
applications = await model.deploy(
File "/home/davigar15/code/python-libjuju/juju/model.py", line 1419, in deploy
entity = await self.charmstore.entity(entity_url, channel=channel,
File "/home/davigar15/code/python-libjuju/juju/model.py", line 2303, in coro
return await self.loop.run_in_executor(None, method)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/davigar15/code/python-libjuju/lib/python3.8/site-packages/theblues/charmstore.py", line 147, in entity
return self._meta(entity_id, includes, channel=channel)
File "/home/davigar15/code/python-libjuju/lib/python3.8/site-packages/theblues/charmstore.py", line 127, in _meta
data = self._get(url)
File "/home/davigar15/code/python-libjuju/lib/python3.8/site-packages/theblues/charmstore.py", line 82, in _get
raise EntityNotFound(url)
theblues.errors.EntityNotFound: https://api.jujucharms.com/charmstore/v5/./k8s-bundle/meta/any?include=bundle-machine-count&include=bundle-metadata&include=bundle-unit-count&include=charm-actions&include=charm-config&include=charm-metadata&include=common-info&include=extra-info&include=owner&include=published&include=resources&include=supported-series&include=terms
Hello,
I found an issue deploying a k8s bundle through libjuju that is causing two problems:
This is the bundle I have been testing with:
The charm can be downloaded executing this command:
Script used for the testing:
Error when deploying it with libjuju: