Skip to content

Commit ae83871

Browse files
Remove CMR guard
Now that CMR for remote applications has landed in develop and we have integration tests for this, we can finally remove the feature flag. This means that moving remote applications should be now possible. If there are any issues then report a bug to https://bugs.launchpad.net/juju/+bugs
1 parent 5655c76 commit ae83871

File tree

4 files changed

+0
-76
lines changed

4 files changed

+0
-76
lines changed

feature/flags.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,3 @@ const MultiCloud = "multi-cloud"
6868

6969
// JujuV3 indicates that new CLI commands and behaviour for v3 should be enabled.
7070
const JujuV3 = "juju-v3"
71-
72-
// CMRMigrations indicates that cross model relations (CMR) can migrate
73-
// information from one controller to another controller.
74-
// This feature is disabled during import and export of information, turning
75-
// this on will allow that to happen.
76-
const CMRMigrations = "cmr-migrations"

state/migration_import.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"github.com/juju/description"
1414
"github.com/juju/errors"
1515
"github.com/juju/loggo"
16-
"github.com/juju/utils/featureflag"
1716
"github.com/juju/version"
1817
"gopkg.in/juju/charm.v6"
1918
"gopkg.in/juju/names.v3"
@@ -27,7 +26,6 @@ import (
2726
"github.com/juju/juju/core/permission"
2827
"github.com/juju/juju/core/status"
2928
"github.com/juju/juju/environs/config"
30-
"github.com/juju/juju/feature"
3129
"github.com/juju/juju/payload"
3230
"github.com/juju/juju/state/cloudimagemetadata"
3331
"github.com/juju/juju/storage"
@@ -52,15 +50,6 @@ func (ctrl *Controller) Import(model description.Model) (_ *Model, _ *State, err
5250
return nil, nil, errors.AlreadyExistsf("model %s", modelUUID)
5351
}
5452

55-
// Ensure that we only enable CMR migrations if the feature flag is enabled
56-
// otherwise just error out as usual.
57-
if !featureflag.Enabled(feature.CMRMigrations) && len(model.RemoteApplications()) != 0 {
58-
// Cross-model relations are currently limited to models on
59-
// the same controller, while migration is for getting the
60-
// model to a new controller.
61-
return nil, nil, errors.New("can't import models with remote applications")
62-
}
63-
6453
// Unfortunately a version was released that exports v4 models
6554
// with the Type field blank. Treat this as IAAS.
6655
modelType := ModelTypeIAAS

state/migration_import_test.go

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
"github.com/juju/juju/core/permission"
3232
"github.com/juju/juju/core/status"
3333
"github.com/juju/juju/environs"
34-
"github.com/juju/juju/feature"
3534
"github.com/juju/juju/payload"
3635
"github.com/juju/juju/state"
3736
"github.com/juju/juju/state/cloudimagemetadata"
@@ -848,8 +847,6 @@ func (s *MigrationImportSuite) TestApplicationsWithExposedOffers(c *gc.C) {
848847
}
849848

850849
func (s *MigrationImportSuite) TestExternalControllers(c *gc.C) {
851-
s.SetFeatureFlags(feature.CMRMigrations)
852-
853850
remoteApp, err := s.State.AddRemoteApplication(state.AddRemoteApplicationParams{
854851
Name: "gravy-rainbow",
855852
URL: "me/model.rainbow",
@@ -2113,61 +2110,7 @@ func (s *MigrationImportSuite) TestPayloads(c *gc.C) {
21132110
c.Check(testPayload.Machine, gc.Equals, machineID)
21142111
}
21152112

2116-
// TODO (stickupkid): Remove this once we remove the CMRMigrations feature
2117-
// flag.
2118-
func (s *MigrationImportSuite) TestRemoteApplicationsWithoutFeatureFlag(c *gc.C) {
2119-
// For now we want to prevent importing models that have remote
2120-
// applications - cross-model relations don't support relations
2121-
// with the models in different controllers.
2122-
_, err := s.State.AddRemoteApplication(state.AddRemoteApplicationParams{
2123-
Name: "gravy-rainbow",
2124-
URL: "me/model.rainbow",
2125-
SourceModel: s.Model.ModelTag(),
2126-
Token: "charisma",
2127-
Endpoints: []charm.Relation{{
2128-
Interface: "mysql",
2129-
Name: "db",
2130-
Role: charm.RoleProvider,
2131-
Scope: charm.ScopeGlobal,
2132-
}, {
2133-
Interface: "mysql-root",
2134-
Name: "db-admin",
2135-
Limit: 5,
2136-
Role: charm.RoleProvider,
2137-
Scope: charm.ScopeGlobal,
2138-
}, {
2139-
Interface: "logging",
2140-
Name: "logging",
2141-
Role: charm.RoleProvider,
2142-
Scope: charm.ScopeGlobal,
2143-
}},
2144-
})
2145-
c.Assert(err, jc.ErrorIsNil)
2146-
2147-
out, err := s.State.Export()
2148-
c.Assert(err, jc.ErrorIsNil)
2149-
2150-
uuid := utils.MustNewUUID().String()
2151-
in := newModel(out, uuid, "new")
2152-
// Models for this version of Juju don't export remote
2153-
// applications but we still want to guard against accidentally
2154-
// importing any that may exist from earlier versions.
2155-
in.AddRemoteApplication(description.RemoteApplicationArgs{
2156-
SourceModel: coretesting.ModelTag,
2157-
OfferUUID: utils.MustNewUUID().String(),
2158-
Tag: names.NewApplicationTag("remote"),
2159-
})
2160-
2161-
_, newSt, err := s.Controller.Import(in)
2162-
if err == nil {
2163-
defer newSt.Close()
2164-
}
2165-
c.Assert(err, gc.ErrorMatches, "can't import models with remote applications")
2166-
}
2167-
21682113
func (s *MigrationImportSuite) TestRemoteApplications(c *gc.C) {
2169-
s.SetFeatureFlags(feature.CMRMigrations)
2170-
21712114
remoteApp, err := s.State.AddRemoteApplication(state.AddRemoteApplicationParams{
21722115
Name: "gravy-rainbow",
21732116
URL: "me/model.rainbow",

tests/suites/model/task.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ test_model() {
1111

1212
file="${TEST_DIR}/test-models.txt"
1313

14-
export JUJU_DEV_FEATURE_FLAGS=cmr-migrations
15-
1614
bootstrap "test-models" "${file}"
1715

1816
# Tests that need to be run are added here.

0 commit comments

Comments
 (0)