From 30484cd088ecadef85bc3b42052bb45801796b75 Mon Sep 17 00:00:00 2001 From: Ales Stimec Date: Wed, 8 Jan 2025 08:59:07 +0100 Subject: [PATCH] chore(internal/jujuclient/applicationoffers.go): add a godoc explaining the usertag field --- internal/jujuclient/applicationoffers.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/jujuclient/applicationoffers.go b/internal/jujuclient/applicationoffers.go index 8d3939781..433215940 100644 --- a/internal/jujuclient/applicationoffers.go +++ b/internal/jujuclient/applicationoffers.go @@ -209,6 +209,11 @@ func (c Connection) GetApplicationOfferConsumeDetails(ctx context.Context, user OfferURLs: []string{info.Offer.OfferURL}, BakeryVersion: v, }, + // We need to specify the user tag, because the juju controller returns a macaroon + // with a third party caveat instructing the discharger to verify that the stated + // user has `consume` access to the offer. If the user tag is left empty juju + // will assume the logged-in user and since jimm is dialing the controller as + // `admin` user that causes an issue. UserTag: user.String(), }