Skip to content

Commit 9281e43

Browse files
Merge pull request #679 from cderici/k8s-bundle-series-imagepullbackoff
[JUJU-1155] Avoid incorrectly setting `series: kubernetes` for sidecar charms in k8s bundles
2 parents f3e6ab2 + c65c077 commit 9281e43

3 files changed

Lines changed: 48 additions & 2 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
This example:
3+
4+
1. Connects to the current model
5+
2. Deploy a bundle and waits until it reports itself active
6+
3. Destroys the units and applications
7+
8+
"""
9+
from juju import jasyncio
10+
from juju.model import Model
11+
12+
13+
async def main():
14+
model = Model()
15+
print('Connecting to model')
16+
# Connect to current model with current user, per Juju CLI
17+
await model.connect()
18+
19+
try:
20+
print('Deploying bundle')
21+
await model.deploy(
22+
'./examples/k8s-local-bundle/big-k8s-bundle.yaml',
23+
channel='edge',
24+
trust=True,
25+
)
26+
finally:
27+
print('Disconnecting from model')
28+
await model.disconnect()
29+
print("Success")
30+
31+
32+
if __name__ == '__main__':
33+
jasyncio.run(main())
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
bundle: kubernetes
2+
name: magma-orc8r
3+
description: |
4+
Orchestrator is a Magma service that provides a simple and consistent way to
5+
configure and monitor the wireless network securely. The metrics acquired through the platform
6+
allows you to see the analytics and traffic flows of the wireless users through the Magma web UI.
7+
applications:
8+
nms-magmalte:
9+
charm: magma-nms-magmalte
10+
channel: edge
11+
scale: 1
12+
trust: true

juju/bundle.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ async def fetch_plan(self, charm_url, origin, overlays=[]):
257257
self.overlay_removed_charms.add(charm_name)
258258

259259
self.bundle = await self._validate_bundle(self.bundle)
260+
260261
if is_local:
261262
self.bundle = await self._handle_local_charms(self.bundle, bundle_dir)
262263

@@ -316,6 +317,7 @@ async def _resolve_charms(self):
316317
deployed = dict()
317318

318319
specs = self.applications_specs
320+
319321
for name in self.applications:
320322
spec = specs[name]
321323
app = self.model.applications.get(name, None)
@@ -593,8 +595,7 @@ async def run(self, context):
593595
raise JujuError("expected origin to be valid for application {} and charm {} with channel {}".format(self.application, str(url), str(channel)))
594596

595597
if self.series is None or self.series == "":
596-
self.series = context.bundle.get("bundle",
597-
context.bundle.get("series", None))
598+
self.series = context.bundle.get("series", None)
598599

599600
if Schema.CHARM_STORE.matches(url.schema):
600601
resources = await context.model._add_store_resources(

0 commit comments

Comments
 (0)