Use native configuration validation and diagnostics
This commit is contained in:
@@ -115,14 +115,11 @@ func (a *configurationAcquisition) Campaign(ctx context.Context) (*config.Campai
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cfg, err := config.LoadCampaign(path)
|
||||
cfg, err := config.LoadCampaignWithIdentity(path, a.selection.Campaign.Value)
|
||||
err = errors.Join(err, ctx.Err())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if a.selection.Campaign.Set && config.CampaignID(cfg) != a.selection.Campaign.Value {
|
||||
return nil, &config.SessionIdentityError{Source: path, Field: "campaign_id", Expected: a.selection.Campaign.Value, Actual: config.CampaignID(cfg)}
|
||||
}
|
||||
a.campaign, a.campaignPath = cfg, path
|
||||
if a.deps.reporter != nil {
|
||||
a.deps.reporter.Info("selected campaign configuration", "campaign", config.CampaignID(cfg), "source", path)
|
||||
|
||||
Reference in New Issue
Block a user