@@ -120,6 +120,8 @@ type Application interface {
120
120
// Charm is the interface that is used to get information about a charm.
121
121
type Charm interface {
122
122
Meta () * charm.Meta
123
+ Manifest () * charm.Manifest
124
+ URL () string
123
125
}
124
126
125
127
// Model is the interface that is used to get information about a model.
@@ -270,7 +272,7 @@ func (b *baseDeployer) DeployLocalCharm(ctx context.Context, arch string, base c
270
272
func (b * baseDeployer ) DeployCharmhubCharm (ctx context.Context , arch string , base corebase.Base ) (string , * corecharm.Origin , error ) {
271
273
model , err := b .stateBackend .Model ()
272
274
if err != nil {
273
- return "" , nil , err
275
+ return "" , nil , errors . Trace ( err )
274
276
}
275
277
276
278
charmRepo , err := b .newCharmRepo (services.CharmRepoFactoryConfig {
@@ -280,7 +282,7 @@ func (b *baseDeployer) DeployCharmhubCharm(ctx context.Context, arch string, bas
280
282
ModelBackend : model ,
281
283
})
282
284
if err != nil {
283
- return "" , nil , err
285
+ return "" , nil , errors . Trace ( err )
284
286
}
285
287
286
288
var curl * charm.URL
@@ -290,10 +292,11 @@ func (b *baseDeployer) DeployCharmhubCharm(ctx context.Context, arch string, bas
290
292
curl = charm .MustParseURL (b .charmhubURL )
291
293
}
292
294
if err != nil {
293
- return "" , nil , err
295
+ return "" , nil , errors . Trace ( err )
294
296
}
295
297
origin := corecharm.Origin {
296
298
Source : corecharm .CharmHub ,
299
+ Type : "charm" ,
297
300
Channel : & b .channel ,
298
301
Platform : corecharm.Platform {
299
302
Architecture : arch ,
@@ -325,11 +328,11 @@ func (b *baseDeployer) DeployCharmhubCharm(ctx context.Context, arch string, bas
325
328
ModelBackend : model ,
326
329
})
327
330
if err != nil {
328
- return "" , nil , err
331
+ return "" , nil , errors . Trace ( err )
329
332
}
330
333
resOrigin , err := charmDownloader .DownloadAndStore (ctx , curl , origin , false )
331
334
if err != nil {
332
- return "" , nil , err
335
+ return "" , nil , errors . Trace ( err )
333
336
}
334
337
335
338
b .logger .Debugf ("Successfully deployed charmhub Juju controller charm" )
@@ -339,7 +342,7 @@ func (b *baseDeployer) DeployCharmhubCharm(ctx context.Context, arch string, bas
339
342
340
343
// AddControllerApplication adds the controller application.
341
344
func (b * baseDeployer ) AddControllerApplication (ctx context.Context , curl string , origin corecharm.Origin , controllerAddress string ) (Unit , error ) {
342
- _ , err := b .stateBackend .Charm (curl )
345
+ ch , err := b .stateBackend .Charm (curl )
343
346
if err != nil {
344
347
return nil , errors .Trace (err )
345
348
}
@@ -368,8 +371,8 @@ func (b *baseDeployer) AddControllerApplication(ctx context.Context, curl string
368
371
}
369
372
370
373
app , err := b .stateBackend .AddApplication (state.AddApplicationArgs {
371
- Name : bootstrap .ControllerApplicationName ,
372
- // Charm: ch,
374
+ Name : bootstrap .ControllerApplicationName ,
375
+ Charm : ch ,
373
376
CharmOrigin : stateOrigin ,
374
377
CharmConfig : cfg ,
375
378
Constraints : b .constraints ,
0 commit comments