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 3.2 into 3.3 #15561

Merged
merged 84 commits into from
May 9, 2023
Merged

Merge 3.2 into 3.3 #15561

merged 84 commits into from
May 9, 2023

Conversation

barrettj12
Copy link
Contributor

Merges the following patches:

Conflicts

None.

jack-w-shaw and others added 30 commits April 14, 2023 14:09
Most of the time they're constant, ens5 primary and ens6 hotplugged, but
this is not always the case. This was causing occassional failures. Fix
this by using ip to figure out which interfaces we should use instead of
hard coding them
…ability_of_spaces_ec2_2.9

juju#15487

Most of the time they're constant, ens5 primary and ens6 hotplugged, but this is not always the case. This was causing occasional failures. Fix this by using ip to figure out which interfaces we should use instead of hard coding them

## Checklist

- [x] Code style: imports ordered, good names, simple structure, etc
- [x] Comments saying why design decisions were made
- ~[ ] Go unit tests, with comments saying what you're testing~
- [x] [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
./main.sh -v -c aws -R eu-west-2 spaces_ec2 test_upgrade_charm_with_bind
./main.sh -v -c aws -R eu-west-2 spaces_ec2 test_juju_bind
```

Should both pass
Add juju- to aks test resource group name for easy cleanup.
Improve convertCharmOrigin to deduce a platform where the origin is not
available. This can happen when deploying or refreshing charms with an
old juju client unaware of an origin.
juju#15492

The interactive add-cloud is painful because it will often reject the endpoint URL without giving any reason why. See https://bugs.launchpad.net/juju/+bug/1908630
```
Enter the API endpoint url for the cloud []: 172.31.47.119
Can't validate endpoint: No Openstack server running at 172.31.47.119

Enter the API endpoint url for the cloud []: http://172.31.47.119/
Can't validate endpoint: No Openstack server running at http://172.31.47.119/

Enter the API endpoint url for the cloud []: http://172.31.47.119/identity/v3
Can't validate endpoint: No Openstack server running at http://172.31.47.119/identity/v3

Enter the API endpoint url for the cloud []: 172.31.47.119/identity
Can't validate endpoint: No Openstack server running at 172.31.47.119/identity

Enter the API endpoint url for the cloud []: http://172.31.47.119/identity
Can't validate endpoint: No Openstack server running at http://172.31.47.119/identity
```

In the Openstack provider's `Ping` method, at least pass on the error information to the user, to make it a little less painful.
```
Enter the API endpoint url for the cloud []: 172.31.47.119
Can't validate endpoint: No Openstack server running at 172.31.47.119: auth options fetching failed
caused by: request available auth options: failed executing the request /
caused by: Get "/": unsupported protocol scheme ""

Enter the API endpoint url for the cloud []: http://172.31.47.119
Can't validate endpoint: No Openstack server running at http://172.31.47.119: auth options fetching failed
caused by: request available auth options: failed executing the request http://172.31.47.119/
caused by: Get "http://172.31.47.119/": dial tcp 172.31.47.119:80: connect: no route to host
```

Do the same with the MAAS and LXD providers.

Also, fix a silly check in the LXD provider's `Ping` method that was rejecting perfectly good URLs. We're already using `lxd.EnsureHostPort(endpoint)` to fill in the scheme/port if not provided, but we were checking the returned value equals the input (and returning an unhelpful error if not). Remove this check.

## Checklist

*If an item is not applicable, use `~strikethrough~`.*

- [x] Code style: imports ordered, good names, simple structure, etc
- ~[ ] 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

Run `juju add-cloud` interactively, and provide a bogus URL.
When dealing with invalid yaml in local bundle, the error was treated as
if the file was not present, therefore continuing to treat the input as
a charm bundle url. This fix returns the error if it's a NotValid error.
In future versions more firewall related tests will be added
…e_ec2_to_firewall

juju#15499

In future versions more firewall related tests have be added

Change the name here to keep the suite names consistent

## Checklist

- ~[ ] Code style: imports ordered, good names, simple structure, etc~
- ~[ ] Comments saying why design decisions were made~
- ~[ ] Go unit tests, with comments saying what you're testing~
- [x] [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
./main.sh -v -c aws -p ec2 firewall
```
Split out into its 2 functions, handling existing origins and creating
a new origin for special cases. Much easier to read.
Test SetCharm from v12, which is used with clients older than 2.9 and cannot contain
an origin or base.
juju#15497

When dealing with invalid yaml in local bundle, the error was treated as if the file was not present, therefore continuing to treat the input as a charm bundle url. 

This patch fixes the returned error if it's a NotValid error.

## 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

Having an empty juju model and this test.yaml bundle:
```yaml
series: focal
applications:
 ubuntu:
 charm: ubuntu
 channel: stable
 revision: 21
 num_units: 1
 to:
 - "0"
 constraints: arch=amd64
va
machines:
 "0":
 constraints: arch=amd64
```
then you should get this error:
```sh
$ juju diff-bundle test.yaml
ERROR cannot unmarshal bundle contents: unmarshal document 0: yaml: line 12: could not find expected ':'
```
if you remove line 12 then:
```sh
$ juju diff-bundle test.yaml
applications:
 ubuntu:
 missing: model
machines:
 "0":
 missing: model
```
## Bug reference

https://bugs.launchpad.net/juju/+bug/2015315
Assert the DocID hasn't been created. The DocID is based on the offer name
not the application name.

Group refcount doc creation by application name as there may be more
than on offer per application. Use new method newnewApplicationOffersRefOp
to allow for specifying the count used.
…igration-txn-fail

juju#15508

There were 2 things preventing model migration when more than one cmr offers for an application. 

One was the docID asserting a doc wasn't there, did always match the docID of what was being inserted. A mismatch between offerName and appName.

The second was having 2 refcount docs with a count of 1 based on appName instead of 1 refcount doc with a count of 2 where there were 2 offers on the same application. At first glance, incApplicationOffersRefOp should have returned a doc with a count of 2, however all cmr offer data was run as a single txn rather than multiple, thus the doc couldn't be found to be changed.

## 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 bootstrap localhost dst
$ juju bootstrap localhost src
$ juju add-model moveme
$ juju deploy mongodb --channel candidate 
$ juju offer mongodb:database 
$ juju offer mongodb:database mongdo-database
$ juju migrate moveme dst
```


## Bug reference

https://bugs.launchpad.net/juju/+bug/2016333
…ails-refresh

[JUJU-3518] fix lp 1999640 local charm fails refresh
juju#15506

Merges:
- juju#15487
- juju#15490
- juju#15492
- juju#15499
- juju#15497

Conflicts solved trivially:
- provider/maas/environprovider.go
- tests/suites/spaces_ec2/util.sh
- Specifically testing fix for macos
The following installs musl on darwin via homebrew, which in turns
allows building jujud. Once musl is installed there is no change
to the make file as that's correctly setup to handle this case.

As sha256sum isn't available by default on a mac, we need to check
it's available otherwise the error is rather cryptic.
Some legacy code has left behind some usual abstractions. Previously
to open/close ports, an implementing class 'neutronFirewaller' called a
method on the base class, which did very little other than call a method
on passed into it

Drop this to simplify both structs
The following wires up the db accessor to the engine report. It does
this, by just conforming to the Report interface.

For now we're only exposing a few things about the internals of the
worker. These include:

 1. How many db replacements have take place. A high number indicates
    issues with the underlying db.
 2. The max ping duration and ping duration.
 3. How many attempts it took to ping in the retry, for the last ping.
    This should show any issues with the underlying db. Higher attempts
    the more likely there is contention issues.
juju#15510

Updates the mgo lib in 3.1 onwards. This to bring in the latest change that deals with some macos testing issues.

## 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
- [x] [Integration tests](https://github.com/juju/juju/tree/develop/tests), with comments saying what you're testing
- [x] [doc.go](https://discourse.charmhub.io/t/readme-in-packages/451) added or updated in changed packages

## QA steps

Run juju tests

## Documentation changes

N/A

## Bug reference

N/A
juju#15518

Merge branch '2.9' into 3.0

```
# Conflicts:
# apiserver/facades/client/application/application.go
# apiserver/facades/client/application/application_unit_test.go
```
juju#15520

Merge remote-tracking branch 'upstream/3.0' into 3.1:

```
# Conflicts:
# apiserver/facades/client/application/application.go
# apiserver/facades/client/application/application_unit_test.go
# cmd/juju/application/diffbundle.go
```
jujubot and others added 24 commits April 27, 2023 12:27
juju#15537

This PR implements updating/setting owner labels by using secret-get for:
- owner units;
- leader unit for application owned secrets; 

## 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

```
juju exec --unit snappass-test/0 'secret-add ownedby=snappass-test'
secret:ch52creffbas7aip1bjg

juju exec --unit snappass-test/0 'secret-add ownedby=snappass-test/0 --owner unit'
secret:ch52csmffbas7aip1bk0

juju exec --unit snappass-test/0 -- secret-get ch52creffbas7aip1bjg --label=snappass-test
ownedby: snappass-test

juju exec --unit snappass-test/0 -- secret-get --label=snappass-test
ownedby: snappass-test

juju exec --unit snappass-test/1 -- secret-get --label=snappass-test
ownedby: snappass-test

juju exec --unit snappass-test/0 -- secret-get ch52csmffbas7aip1bk0 --label=snappass-test/0
ownedby: snappass-test/0

juju exec --unit snappass-test/0 -- secret-get --label=snappass-test/0
ownedby: snappass-test/0

```

## Documentation changes

No

## Bug reference

https://bugs.launchpad.net/juju/+bug/2017042
juju#15534

This is the first step in fixing the problematic arch supported list from LXD. Whilst investigating that bug, it seems that we still support 32-bit word sizes. Except that, we no longer want to support 32-bit word sizes with dqlite, as the number of jujud permutations explodes and so it's best to completely remove the support. We officially dropped support for 32-bit architectures over 3 years ago, although we didn't actively remove the code to drop support.

This brings in what the juju/utils arch support had, with the addition of a UnsupportedArches field, which will ensure that we can at least say what we use to support, but no longer do. This doesn't bring in the changes from [juju/utils PR](juju/utils#330) as technically we don't need a new version of juju/utils sans arch package to do this.

## 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

## QA steps

```sh
$ juju bootstrap lxd test --build-agent
```

## Bug reference

https://bugs.launchpad.net/juju/+bug/2013869
This PR starts running client only tests with the race flag. It's important
that tests are run and detecting race conditions. Even more so that we
are blocking merging on detected problems.

This is direct feedback from retrospective to get better test coverage
of Juju.
juju#15541

This PR starts running client only tests with the race flag. It's important that tests are run and detecting race conditions. Even more so that we are blocking merging on detected problems.

This is direct feedback from retrospective to get better test coverage of Juju.

## Checklist

*If an item is not applicable, use `~strikethrough~`.*

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

## QA steps

Let the github actions on this PR run to completion. The change is directly related to running of GH actions.

## Documentation changes

nil

## Bug reference

nil
juju#15549

Fix typo in run_secret_drain, we should use microk8s kubectl.
Fixes https://bugs.launchpad.net/juju/+bug/1994454
If we try to add-model for a namespace which already exists, and the
annotations are not what Juju expects, then it returns a strange "not valid"
error. Catch this error on the client side in the add-model command. Add a unit
test for this.

Also, fix a bug in the ModelManager API client (method CreateModel) where the
RPC error code was being discarded.
juju#15552

If we try to add-model for a namespace which already exists, and the annotations are not what Juju expects, then it returns a strange "not valid" error:
```
failed to open kubernetes client: annotations map[controller.juju.is/id:e911779d-c210-4207-8a37-586029693d85 model.juju.is/id:b36d5a71-fe97-48cb-87f7-479c98a741df] for namespace "borked" must include map[model.juju.is/id:f58485c2-4f08-4571-88c4-2e6b9ece955c]
```
Catch this error on the client side in the `add-model` command. Add a unit test for this.

Also, fix a bug in the ModelManager API client (method CreateModel) where the RPC error code was being discarded.

## 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

```console
$ juju bootstrap microk8s c
$ juju add-model m
$ juju add-model m
ERROR cannot create model "m": a namespace called "m" already exists on this k8s cluster. Please pick a different model name.
```

## Bug reference

https://bugs.launchpad.net/juju/+bug/1994454
Fix typo in secret_owned_by_easyrsa;
juju#15558

Merge branch '3.1' into merge-3.1-20230505

- juju#15554
- juju#15555
- juju#15553
- juju#15552
- juju#15549
- juju#15538
- juju#15541
- juju#15537
- juju#15530

```
# Conflicts:
# .github/workflows/client-tests.yml
# apiserver/facades/agent/secretsmanager/secrets.go
# tests/suites/secrets_iaas/task.sh
```
Copy link
Contributor

@juanmanuel-tirado juanmanuel-tirado left a comment

Choose a reason for hiding this comment

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

LG2M

@barrettj12
Copy link
Contributor Author

/merge

@jujubot jujubot merged commit 6c86fae into juju:3.3 May 9, 2023
17 checks passed
@barrettj12 barrettj12 deleted the merge-3.2-3.3-20230509 branch May 9, 2023 23:57
@barrettj12 barrettj12 mentioned this pull request May 10, 2023
jujubot added a commit that referenced this pull request May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet