-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add migration import check for charms without manifest #18141
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot, lot nicer!
Just going to run the QA steps, but very happy with this addition.
internal/migration/precheck.go
Outdated
|
||
err := checkForCharmsWithNoManifest(model) | ||
if err != nil { | ||
return fmt.Errorf("checking model for charms without manifest.yaml: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the internal errors package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
@@ -71,6 +74,20 @@ func SourcePrecheck( | |||
return nil | |||
} | |||
|
|||
// ImportPrecheck checks the data being imported to make sure preconditions for | |||
// importing are met. | |||
func ImportPrecheck( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do wonder if we should revisit how all this is plumbed together. For now, this is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like it would be well worth doing. It would be good to at least move the migration checks that are currently in the upgradevalidation package to here, i.e. move them from the source controller to the target controller. A lot of them use state but it should be possible to just look at the actual model description.
5f7d6d0
to
0451846
Compare
Charms without a manifest.yaml are not supported in 4.0. This check blocks migration of models that contain such charms.
0451846
to
3b6fc99
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but TU are broken, and it may be linked to the fix. I think they need to be updated.
/build |
Looks like random failures tbh, I've just triggered a build, hopefully that gets it. The failing test passed locally and looked a bit racy. |
/merge |
Charms without a manifest.yaml are not supported in 4.0. This check blocks migration of models that contain such charms.
Checklist
QA steps
Migration of 3.6 - 4.0
sj
here is stands for snap juju, which is set to 3.6/edge.'juju' is the compiled 4.0 from this PR.
Check happy path migration:
Links
Launchpad bug: https://bugs.launchpad.net/juju/+bug/2080359
Jira card: JUJU-6727