Skip to content
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

Merge 2.9 20230313 #15279

Merged
merged 9 commits into from
Mar 13, 2023
Merged

Merge 2.9 20230313 #15279

merged 9 commits into from
Mar 13, 2023

Conversation

ycliuhw
Copy link
Member

@ycliuhw ycliuhw commented Mar 13, 2023

Merge 2.9

Conflicts were for deleted code or code that needed to be removed.

# Conflicts:
#       apiserver/resources_mig_test.go
#       apiserver/mocks/resources_mock.go

ycliuhw and others added 8 commits March 8, 2023 13:30
juju#15264

This PR fixes two issues failed migration for models with sidecar applications;
- https://bugs.launchpad.net/juju/+bug/2009566
- https://bugs.launchpad.net/juju/+bug/2008744

## Checklist

- [x] Code style: imports ordered, good names, simple structure, etc
- [x] Comments saying why design decisions were made
- [x] Go unit tests, with comments saying what you're testing
- [] ~[Integration tests](https://github.com/juju/juju/tree/develop/tests), with comments saying what you're testing~
- [ ] ~[doc.go](https://discourse.charmhub.io/t/readme-in-packages/451) added or updated in changed packages~

## QA steps

```sh
juju deploy prometheus-k8s --trust

juju deploy cs:~juju/mariadb-k8s-3

juju migrate k1:t1 k2
Migration started with ID "d2254384-b25c-492b-8e69-798f66e2821c:0"

```

## Documentation changes

No

## Bug reference

- https://bugs.launchpad.net/juju/+bug/2009566
- https://bugs.launchpad.net/juju/+bug/2008744
-
* Add removallog for user entries and permit to add previously removed users.
@ycliuhw
Copy link
Member Author

ycliuhw commented Mar 13, 2023

/merge

// updateExistingUser manipulates the values of an existing user in the db.
// This is particularly useful when reusing existing users that were previously
// deleted.
func (st *State) updateExistingUser(u *User, displayName, password, creator string, secretKey []byte) (*User, error) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juanmanuel-tirado
The TestAddRemovedUser failed in 3.0:
failed to create user: transaction aborted
There might be some assertion failed in this method.
I don't have enough context for this change.
It'd be great if you could fix it by pushing to this PR directly.

* When recreating the user permissions for a removed user, the
transactions are failing. This behaviour does not happen in 2.9.
I split the transactions in two different sets.
@juanmanuel-tirado
Copy link
Contributor

FAIL: worker_test.go:442: WorkerSuite.TestAddMachine failed. I rerun just in case this is an spurious error.

@juanmanuel-tirado
Copy link
Contributor

/build

@juanmanuel-tirado
Copy link
Contributor

I'm going to ignore the failing CLA and merge.

@juanmanuel-tirado juanmanuel-tirado merged commit e39f557 into juju:3.0 Mar 13, 2023
juanmanuel-tirado added a commit that referenced this pull request Mar 13, 2023
* Do not increment CharmModifiedVersion for importing a resource during model migration;

* Patch statefulset valid fields only;

* Fix TestUpgradeStateful;

* Rephrase the error message in caas provisioner worker for less confusion;

* [JUJU-2928] fully remove users (#15266)

* Add removallog for user entries and permit to add previously removed users.

* Split transactions when regenerating previously removed user (#26)

* When recreating the user permissions for a removed user, the
transactions are failing. This behaviour does not happen in 2.9.
I split the transactions in two different sets.

---------

Co-authored-by: Kelvin <kelvin.liu@canonical.com>
Co-authored-by: Juju bot <jujubot@users.noreply.github.com>
@jack-w-shaw jack-w-shaw mentioned this pull request Mar 27, 2023
jujubot added a commit that referenced this pull request Mar 27, 2023
#15346

This merges:
- #15268
- #15275
- #15276
- #15269
- #15279
- #15283
- #15305
- #15308 (but undone manually)

Conflicts:
- api/client/usermanager/client_test.go
- apiserver/facades/controller/crossmodelrelations/crossmodelrelations_test.go
- apiserver/facades/controller/crossmodelrelations/mock_test.go
- apiserver/package_test.go
- container/lxd/initialisation_linux.go
- scripts/win-installer/setup.iss
- snap/snapcraft.yaml
- version/version.go

Resolved trivially
state/user.go Outdated
@@ -186,7 +191,6 @@ func (st *State) updateExistingUser(u *User, displayName, password, creator stri
Assert: txn.DocExists,
Update: updateUser,
}}
updateUserOps = append(updateUserOps, removeControllerOps...)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These really need to done in the same transaction. The problem here is that there is no get to check the the controller even has this user before adding the ops from removeControllerUserOps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants