Skip to content

Commit 697d4ce

Browse files
committed
Revert: include offer acl in export bundle output juju#10380
This reverts commit f5f1ba8.
1 parent 0c024c1 commit 697d4ce

File tree

7 files changed

+9
-52
lines changed

7 files changed

+9
-52
lines changed

Gopkg.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
name = "github.com/juju/bundlechanges"
6363

6464
[[constraint]]
65-
revision = "9daa941ef37578e70e66a5f97ab64b1f2b2bd410"
65+
revision = "d998a354f984c57a34feb889acbfa6c2c2247641"
6666
name = "github.com/juju/description"
6767

6868
[[constraint]]
@@ -147,7 +147,7 @@
147147

148148
[[constraint]]
149149
name = "gopkg.in/juju/charm.v6"
150-
revision = "54cd06b3e6b4e35c57464f13dcce189980323354"
150+
revision = "b0b4c5138c321b98c1497ddf436f1e49b8b35ae2"
151151

152152
[[constraint]]
153153
revision = "7778a447283bd71109671c20818544514e16e9d9"

apiserver/facades/client/bundle/bundle.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"github.com/juju/errors"
1616
"github.com/juju/loggo"
1717
"github.com/juju/os/series"
18-
"github.com/juju/utils/featureflag"
1918
"gopkg.in/juju/charm.v6"
2019
"gopkg.in/juju/names.v2"
2120
"gopkg.in/yaml.v2"
@@ -26,7 +25,6 @@ import (
2625
"github.com/juju/juju/apiserver/params"
2726
"github.com/juju/juju/core/constraints"
2827
"github.com/juju/juju/core/devices"
29-
"github.com/juju/juju/feature"
3028
"github.com/juju/juju/permission"
3129
"github.com/juju/juju/storage"
3230
)
@@ -398,12 +396,11 @@ func (b *BundleAPI) fillBundleData(model description.Model) (*bundleOutput, erro
398396
}
399397

400398
// Populate offer list
401-
if offerList := application.Offers(); offerList != nil && featureflag.Enabled(feature.CMRAwareBundles) {
399+
if offerList := application.Offers(); offerList != nil {
402400
newApplication.Offers = make(map[string]*charm.OfferSpec)
403401
for _, offer := range offerList {
404402
newApplication.Offers[offer.OfferName()] = &charm.OfferSpec{
405403
Endpoints: offer.Endpoints(),
406-
ACL: offer.ACL(),
407404
}
408405
}
409406
}

apiserver/facades/client/bundle/bundle_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"github.com/juju/juju/apiserver/facades/client/bundle"
1616
"github.com/juju/juju/apiserver/params"
1717
apiservertesting "github.com/juju/juju/apiserver/testing"
18-
"github.com/juju/juju/feature"
1918
coretesting "github.com/juju/juju/testing"
2019
)
2120

@@ -543,7 +542,6 @@ applications:
543542
}
544543

545544
func (s *bundleSuite) TestExportBundleWithApplicationOffers(c *gc.C) {
546-
s.SetFeatureFlags(feature.CMRAwareBundles)
547545
s.st.model = description.NewModel(description.ModelArgs{Owner: names.NewUserTag("magic"),
548546
Config: map[string]interface{}{
549547
"name": "awesome",
@@ -562,12 +560,7 @@ func (s *bundleSuite) TestExportBundleWithApplicationOffers(c *gc.C) {
562560
_ = app.AddOffer(description.ApplicationOfferArgs{
563561
OfferName: "my-offer",
564562
Endpoints: []string{"endpoint-1", "endpoint-2"},
565-
ACL: map[string]string{
566-
"admin": "admin",
567-
"foo": "consume",
568-
},
569563
})
570-
571564
_ = app.AddOffer(description.ApplicationOfferArgs{
572565
OfferName: "my-other-offer",
573566
Endpoints: []string{"endpoint-1", "endpoint-2"},
@@ -592,9 +585,6 @@ applications:
592585
endpoints:
593586
- endpoint-1
594587
- endpoint-2
595-
acl:
596-
admin: admin
597-
foo: consume
598588
my-other-offer:
599589
endpoints:
600590
- endpoint-1

feature/flags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ const MultiCloud = "multi-cloud"
6464

6565
// CMRAwareBundles allows Juju to recognize and handle offer and saas blocks
6666
// when deploying bundles.
67-
const CMRAwareBundles = "bundle-cmr"
67+
const CMRAwareBundles = "cmr-aware-bundles"

state/migration_export.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -770,24 +770,9 @@ func (e *exporter) addApplication(ctx addApplicationContext) error {
770770
for _, ep := range offer.Endpoints {
771771
endpoints = append(endpoints, ep.Name)
772772
}
773-
774-
userMap, err := e.st.GetOfferUsers(offer.OfferUUID)
775-
if err != nil {
776-
return errors.Annotatef(err, "ACL for offer %s", offer.OfferName)
777-
}
778-
779-
var acl map[string]string
780-
if len(userMap) != 0 {
781-
acl = make(map[string]string, len(userMap))
782-
for user, access := range userMap {
783-
acl[user] = accessToString(access)
784-
}
785-
}
786-
787773
_ = exApplication.AddOffer(description.ApplicationOfferArgs{
788774
OfferName: offer.OfferName,
789775
Endpoints: endpoints,
790-
ACL: acl,
791776
})
792777
}
793778

state/migration_export_test.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,7 @@ func (s *MigrationExportSuite) TestMultipleApplications(c *gc.C) {
549549
}
550550

551551
func (s *MigrationExportSuite) TestApplicationExposingOffers(c *gc.C) {
552-
_ = s.Factory.MakeUser(c, &factory.UserParams{Name: "admin"})
553-
fooUser := s.Factory.MakeUser(c, &factory.UserParams{Name: "foo"})
552+
s.Factory.MakeUser(c, &factory.UserParams{Name: "admin"})
554553
_, err := s.State.AddSpace("server", "", nil, true)
555554
c.Assert(err, jc.ErrorIsNil)
556555
_, err = s.State.AddSpace("server-admin", "", nil, true)
@@ -578,14 +577,6 @@ func (s *MigrationExportSuite) TestApplicationExposingOffers(c *gc.C) {
578577
)
579578
c.Assert(err, jc.ErrorIsNil)
580579

581-
// Allow "foo" to consume offer
582-
err = s.State.CreateOfferAccess(
583-
names.NewApplicationOfferTag("my-offer"),
584-
fooUser.UserTag(),
585-
permission.ConsumeAccess,
586-
)
587-
c.Assert(err, jc.ErrorIsNil)
588-
589580
// We only care for the offers
590581
model, err := s.State.ExportPartial(state.ExportConfig{
591582
SkipActions: true,
@@ -615,12 +606,6 @@ func (s *MigrationExportSuite) TestApplicationExposingOffers(c *gc.C) {
615606
endpoints := appOffers[0].Endpoints()
616607
sort.Strings(endpoints)
617608
c.Assert(endpoints, gc.DeepEquals, []string{"server", "server-admin"})
618-
619-
appACL := appOffers[0].ACL()
620-
c.Assert(appACL, gc.DeepEquals, map[string]string{
621-
"admin": "admin",
622-
"foo": "consume",
623-
})
624609
}
625610

626611
func (s *MigrationExportSuite) TestUnits(c *gc.C) {

0 commit comments

Comments
 (0)