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

Merged
merged 30 commits into from
Sep 26, 2022
Merged

Merge 2.9 #14661

merged 30 commits into from
Sep 26, 2022

Conversation

wallyworld
Copy link
Member

Merge 2.9

#14637
#14638
#14641
#14612
#14646
#14647
#14649
#14628
#14654

Conflicts

# Conflicts:
#       apiserver/facades/client/application/deploy.go
#       apiserver/facades/client/charmhub/charmhub_test.go
#       apiserver/facades/client/charmhub/convert.go
#       apiserver/facades/client/charms/conversions.go
#       apiserver/facades/client/machinemanager/machinemanager.go
#       apiserver/facades/client/machinemanager/machinemanager_test.go
#       apiserver/facades/client/machinemanager/register.go
#       apiserver/facades/client/resources/repository.go
#       apiserver/facades/schema.json
#       cmd/juju/application/deploy_test.go
#       cmd/juju/application/deployer/bundlehandler.go
#       cmd/juju/machine/add.go
#       core/charm/strategies.go
#       core/charm/strategies_test.go
#       core/series/supportedseries.go
#       core/series/supportedseries_test.go
#       environs/manual/winrmprovisioner/provisioner_test.go
#       rpc/params/applications.go
#       rpc/params/params.go
#       state/charm.go
#       tests/includes/storage.sh

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
  • [ ] Integration tests, with comments saying what you're testing
  • [ ] doc.go added or updated in changed packages

QA steps

See PRs

hmlanigan and others added 28 commits September 19, 2022 16:09
In case an OS for the Series is not provided in the Platform, determine
the OS if a series is specified. Helps to ensure that charmhub requests
are valid.
In case an OS for the Series is not provided in the Platform, determine
the OS if a series is specified. Helps to ensure that charmhub requests
are valid.

Validate the origin has a platform.
Represent changes to DeduceOrigin and Resolve charm where an OS is added
to the origin if a series is present.
[JUJU-1830] [CONTRIBUTING.md] Add CLA section + other small fixes
juju#14638

This PR sets up a log sender for the model operator.
Also as a drive-by, add missing tests for the model operator manifold package.

## 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 add-model t1 --config logging-config="<root>=INFO;juju.worker.caasadmission=TRACE;"
Added 't1' model on microk8s/localhost with credential 'microk8s' for user 'admin'

$ juju deploy snappass-test
Located charm "snappass-test" in charm-hub, revision 9
Deploying "snappass-test" from charm-hub charm "snappass-test", revision 9 in channel stable on focal

$ juju debug-log --color --replay -m k1:t1 --include-module=juju.worker.caasadmission
model-15bab7c8-bf6b-4ccd-8734-b8140c2ab313: 15:19:25 DEBUG juju.worker.caasadmission installing caas admission handler at /k8s/admission/15bab7c8-bf6b-4ccd-8734-b8140c2ab313
model-15bab7c8-bf6b-4ccd-8734-b8140c2ab313: 15:19:25 INFO juju.worker.caasadmission ensuring model k8s webhook configurations
model-15bab7c8-bf6b-4ccd-8734-b8140c2ab313: 15:19:35 DEBUG juju.worker.caasadmission received admission request for snappass-test of /v1, Kind=Service in namespace t1
model-15bab7c8-bf6b-4ccd-8734-b8140c2ab313: 15:19:35 DEBUG juju.worker.caasadmission received admission request for snappass-test of /v1, Kind=Endpoints in namespace t1
model-15bab7c8-bf6b-4ccd-8734-b8140c2ab313: 15:19:35 DEBUG juju.worker.caasadmission received admission request for of discovery.k8s.io/v1, Kind=EndpointSlice in namespace t1
model-15bab7c8-bf6b-4ccd-8734-b8140c2ab313: 15:19:35 DEBUG juju.worker.caasadmission received admission request for snappass-test-endpoints of /v1, Kind=Service in namespace t1
model-15bab7c8-bf6b-4ccd-8734-b8140c2ab313: 15:19:35 DEBUG juju.worker.caasadmission received admission request for snappass-test-endpoints of /v1, Kind=Endpoints in namespace t1
model-15bab7c8-bf6b-4ccd-8734-b8140c2ab313: 15:19:35 DEBUG juju.worker.caasadmission received admission request for of discovery.k8s.io/v1, Kind=EndpointSlice in namespace t1
model-15bab7c8-bf6b-4ccd-8734-b8140c2ab313: 15:19:35 DEBUG juju.worker.caasadmission received admission request for snappass-test-application-config of /v1, Kind=Secret in namespace t1
model-15bab7c8-bf6b-4ccd-8734-b8140c2ab313: 15:19:36 DEBUG juju.worker.caasadmission received admission request for snappass-test of /v1, Kind=ServiceAccount in namespace t1
...
```

## Documentation changes

No

## Bug reference

No
Sometimes ec2 machine spawns only a private and public ip, so we should
not for a third
…age-aws

juju#14641

The recent migration of nw-assess-charm-storage tests from python to bash, created a legitimate test failure situation which was easy to miss most of the times, where the model being destroyed had persistent storage dangling and the ci job had to timeout resulting to a test failure in jenkins. This PR destroys the storage when removing the application and also addresses the situation where the test was trying to assert for the size allocated for a rootfs volume before the storage unit had been attached. Instead now we are waiting for the storage unit (rootfs) to be attached before asserting for the allocated size.

## 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~
- ~[ ] [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
Locally you can run
```
./main.sh -v -p aws -c aws storage run_charm_storage
```
**But most importantly**
`test-storage-aws` should pass in jenkins.
…ror_in_juju_login_in_single_char_login

juju#14612

Juju login panics when the username is too short. For example character `q` as username.

## 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~
- ~[ ] [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
Logout out of current controller. 
```sh
juju login 
Enter username: q

ERROR cannot log into controller "local": user name "q" not valid
A user name may contain any case alpha-numeric characters, '+', '.', and '-'; 
'@' to specify an optional domain. The user name and domain must begin and end 
with alpha-numeric characters. Examples of valid users include bob, Bob@local, bob@somewhere-else, 0-a-f@123
```
Should not panic.
## Bug reference
https://bugs.launchpad.net/juju/+bug/1989182
juju#14646

Introduce a new `OSVersion` struct in the `core/series` package to hold an os name and versions.
When deploying a charm or adding a machine, update the facades to accept the OSVersion info, not series. For add charm, use the charm origin. The series param is kept for older clients and will be removed in juju 3.

The end goal is to avoid passing Series over the API. The next step is to look at return results and charm origin.

For now, the backend still stores series. So in the facade we convert OSVersion back to series. We want to get the api sorted first.

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

bootstrap a 2.9 controller with this PR
use juju client to deploy a charm with --series and add a machine with --series
use a 2.8 client to do the same

repeat the above with a 2.8 controller

deploy this bundle
```yaml
applications:
 juju-qa-test:
 charm: juju-qa-test
 channel: stable
 num_units: 2
 nrpe:
 charm: cs:nrpe-64
 channel: stable
 ntp:
 charm: cs:ntp-40
 channel: stable
 series: bionic
 telegraf:
 charm: cs:telegraf-37
 channel: stable
 ubuntu:
 charm: ubuntu
 series: xenial
 num_units: 2
relations:
- - ntp:juju-info
 - juju-qa-test:juju-info
- - ntp:juju-info
 - ubuntu:juju-info
- - nrpe:general-info
 - ubuntu:juju-info
- - telegraf:juju-info
 - ubuntu:juju-info
```
then edit the bundle to change ubuntu units
```yaml
...
 num_units: 3
 to:
 - "lxd:new"
```
redeploy bundle
…cripts times out at times waiting for the storage to be removed
juju#14647

Sometimes ec2 machine spawns only a private and public ip, so we should
not for a third

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

```
BOOTSTRAP_CLOUD=aws BOOTSTRAP_PROVIDER=aws BOOTSTRAP_REGION=eu-west-1 ./main.sh -s 'test_upgrade_charm_with_bind,test_juju_bind' -v spaces_ec2
```
…t-storage-tests

juju#14649

This PR makes some minor fixes around the naming of the skipped tests. Replacing hyphen delimiters with underscores and also doing some small house keeping in the includes directory.

## Checklist

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

- ~[ ] 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

*Commands to run to verify that the change works.*

```sh
./main.sh -v -p aws -c aws storage 
```
…o-ch

juju#14628

The charm origin for charmstore charms does not contain an os, but does contain a series. This creates a problem when refreshing an application using the switch flag to go from a charmstore version of the charm to a charmhub version of the charm. The refresh request made to charmhub is containing an Series while missing the OS and fails. 

No upgrade step is necessary due to the validation and fixing done by these changes in this PR. If a series is correct, juju can always determine an OS for it. Do so if DeduceOrigin or ResolveCharm only have a series in the arguments. This is helps protect against bad requests from non juju clients as well when ResolveCharm is called.

Drive by change to not require mongo in testing when it's not used included

## QA steps

```sh
$ juju bootstrap --bootstrap-series bionic localhost 
$ juju deploy cs:aodh-56 csaodh-bionic --series bionic
Located charm "aodh" in charm-store, revision 56
Deploying "csaodh-bionic" from charm-store charm "aodh", revision 56 in channel stable on bionic
$ juju refresh csaodh-bionic --switch ch:aodh --channel latest/stable
Added charm-hub charm "aodh", revision 57 in channel latest/stable, to the model
Leaving endpoints in "alpha": admin, amqp, certificates, cluster, ha, identity-service, internal, mongodb, nrpe-external-master, public, shared-db
```

## Bug reference

This PR fixes part of the bug. To fix the remainer, an `apt update`, `apt upgrade` of the controller machines is required. The `/usr/share/distro-info/ubuntu.csv` file is out of date. Jujud on the controller(s) must be restarted after the file is updated.

https://bugs.launchpad.net/juju/+bug/1990182
juju#14654

In the core charm platform, use channel instead of series. This means that when charm query results come back from charmhub, there's no longer a need to translate channel (eg 20.04) to series (eg focal). The use of channel is propagated throughout the client side, and when params are sent to the server, both channel and series are sent. A 2.9 controller will user series; a 3.0 controller will use channel.

In state, we still store series; this will eventually be updated as well. We also keep using --series for the cli and translate client side to channel.

Even though we could transition away from the centos channel hack (7->centos7), juju still stores centos7 so we need to keep it a bit longer until more work is done.

## 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 info ubuntu
juju info ubuntu --series jammy
juju download ubuntu
juju download ubuntu --series focal

deploy a local charm downloaded above
juju deploy ch:ubuntu
juju deploy ch:ubuntu --series bionic

deploy a bundle
```
applications:
 juju-qa-test:
 charm: juju-qa-test
 channel: stable
 num_units: 2
 nrpe:
 charm: cs:nrpe-64
 channel: stable
 ntp:
 charm: cs:ntp-40
 channel: stable
 series: bionic
 telegraf:
 charm: cs:telegraf-37
 channel: stable
 ubuntu:
 charm: ubuntu
 series: xenial
 num_units: 2
 # to:
 # - "lxd:new"
relations:
- - ntp:juju-info
 - juju-qa-test:juju-info
- - ntp:juju-info
 - ubuntu:juju-info
- - nrpe:general-info
 - ubuntu:juju-info
- - telegraf:juju-info
 - ubuntu:juju-info
```

bootstrap a k8s controller
juju deploy postgrsql-k8s

deploy a bundle
```
bundle: kubernetes
applications:
 istio-ingressgateway:
 charm: istio-gateway
 channel: latest/edge
 revision: 74
 istio-pilot:
 charm: istio-pilot
 channel: latest/edge
 revision: 95
 training-operator:
 charm: training-operator
 channel: 1.3/edge
```
@wallyworld
Copy link
Member Author

/merge

wallyworld and others added 2 commits September 26, 2022 17:59
juju#14662

A couple of small drive by fixes to improve charm platform logic.

- [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~

bootstrap and deploy a small k8s bundle.
@wallyworld
Copy link
Member Author

/merge

@jujubot jujubot merged commit 2736835 into juju:develop Sep 26, 2022
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.

6 participants