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

Merged
merged 171 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
171 commits
Select commit Hold shift + click to select a range
c4d5967
Increment juju to 3.1.3
jujubot Mar 29, 2023
24e808c
Use raw transactions to remove user model access.
Mar 29, 2023
f396362
Improve RemoveUser and AddUser txns.
hpidcock Mar 30, 2023
fd038bd
Further refinement of AddUser and RemoveUser txns.
hpidcock Mar 30, 2023
5a3924b
Rename to recreateDeletedUser
hpidcock Mar 30, 2023
9857340
Only prompt to require force when not forcing
jack-w-shaw Mar 30, 2023
dbaae24
Merge pull request #15399 from jack-w-shaw/JUJU-3343_dont_prompt_forc…
jujubot Mar 30, 2023
cf1872b
Merge pull request #15395 from juanmanuel-tirado/JUJU-3391_fix_broken…
jujubot Mar 31, 2023
551d9cf
Bump to 3.2-beta2
hpidcock Apr 3, 2023
5935584
Replace 3.3-beta2 with 3.2-beta2
Apr 3, 2023
c87b8e3
Remove unused variable
SimonRichardson Mar 31, 2023
1b4ade7
Ensure that we scope the readChanges to the tomb
SimonRichardson Mar 30, 2023
59b66b9
Introduce a scoped context for the worker
SimonRichardson Mar 30, 2023
403f1c7
Update the juju/worker package
SimonRichardson Mar 30, 2023
4d69091
Merge pull request #15414 from manadart/3.2-backport-catacomb-context
jujubot Apr 3, 2023
04dc1ab
Revert "Replace 3.3-beta2 with 3.2-beta2"
Apr 3, 2023
e19c84f
Replace 3.3-beta2 with 3.2-beta1
Apr 3, 2023
4d79430
Ignore build number in unit tests that check build number.
hpidcock Apr 4, 2023
051c465
[tests/resources] remove call to nonexistent func
barrettj12 Apr 4, 2023
7f2436b
Merge pull request #15417 from hpidcock/fix-unit-tests
jujubot Apr 4, 2023
183a12f
[tests/resources] use attach-resource, not attach
barrettj12 Apr 4, 2023
e71fe4b
Merge pull request #15418 from barrettj12/resource-func-not-found
jujubot Apr 4, 2023
0ccf756
[branch test] deploy mongodb from 3.6/stable
barrettj12 Apr 4, 2023
972fb56
Merge pull request #15419 from barrettj12/branch-test
jujubot Apr 4, 2023
9805ee0
Merge remote-tracking branch 'upstream/3.0' into merge-2.9-3.0_20230404
Apr 4, 2023
97238bf
Merge pull request #15413 from hpidcock/bump-3.2-beta2
jujubot Apr 4, 2023
749d938
Relocates constants associated with the tracked DB worker to be in the
manadart Apr 4, 2023
0e69838
Merge pull request #15420 from juanmanuel-tirado/merge-2.9-3.0_20230404
jujubot Apr 4, 2023
ddd60f0
Merge remote-tracking branch 'upstream/3.1' into merge-3.0-3.1_20230404
Apr 4, 2023
f24d295
Replaces the DB method on TrackedDB, with TxnNoRetry.
manadart Apr 4, 2023
6fbfb51
Removes TrackedDB mock from worker/leaseexpiry. It is unused.
manadart Apr 4, 2023
0f52ac1
Updates generated mock for TrackedDB in worker/lease/manifold.
manadart Apr 4, 2023
1c124a0
Reinstates usage of defaultTransactionRunner in testing trackedDB.
manadart Apr 4, 2023
feab252
Use focal to deploy local charm.
hmlanigan Apr 4, 2023
f43d417
Merge pull request #15422 from juanmanuel-tirado/merge-3.0-3.1_20230404
jujubot Apr 4, 2023
ed4ecfb
Merge 3.1 into 3.2
barrettj12 Apr 4, 2023
190ced3
Merge pull request #15424 from barrettj12/merge-3.1-3.2
hpidcock Apr 5, 2023
7728ffa
New http client for lxd connections.
tlm Apr 3, 2023
06380f6
[resources test] fix expected status messages
barrettj12 Apr 5, 2023
c98d217
Merge pull request #15416 from tlm/lxd-cert-validation
jujubot Apr 5, 2023
6d83bb2
Merge remote-tracking branch 'juju/2.9' into 2.9-into-3.0
tlm Apr 5, 2023
68ba06d
Merge pull request #15428 from tlm/2.9-into-3.0
jujubot Apr 5, 2023
033499f
Ensures that errors from closing Dqlite are checked in node manager
manadart Apr 5, 2023
c7145e0
Merge pull request #15423 from hmlanigan/refresh-ci-test
jujubot Apr 5, 2023
5c90004
Randomises the port used by the node manager test for WithAddressOption.
manadart Apr 5, 2023
9f3482d
Fix error message for deploying cs: charms on 3.1 controller
cderici Apr 5, 2023
636b9ce
Fix logic typo
cderici Apr 5, 2023
389497b
Merge pull request #15426 from barrettj12/supply-res-rev
jujubot Apr 5, 2023
a55e539
Fix test-manual-aws
jack-w-shaw Apr 5, 2023
87d0d08
Merge remote-tracking branch 'juju/3.0' into 3.0-into-3.1
tlm Apr 5, 2023
990e3ca
Randomises the port used by the node manager test for WithAddressOption.
manadart Apr 5, 2023
75f35f3
Merge pull request #15427 from hpidcock/fix-dqlite-listen
hpidcock Apr 5, 2023
c912115
Merge pull request #15433 from tlm/3.0-into-3.1
jujubot Apr 5, 2023
02d44f0
Merge remote-tracking branch 'juju/3.1' into 3.1-into-3.2
tlm Apr 6, 2023
b09b702
Fix data race in TestWorkerDeletesExpiredLeases.
hpidcock Apr 6, 2023
13a4e8c
Merge pull request #15435 from hpidcock/fix-data-race-leaseexpiry
jujubot Apr 6, 2023
45dd418
Don't try and checkout musl cross make if it exists.
tlm Apr 6, 2023
24e40fd
Merge pull request #15434 from tlm/3.1-into-3.2
jujubot Apr 6, 2023
ae874f2
Merge pull request #15431 from jack-w-shaw/JUJU-3364_fix_manual_aws
jujubot Apr 6, 2023
6f1e663
[deploy test] Fix default series test
barrettj12 Apr 6, 2023
447b3c9
Merge pull request #15437 from barrettj12/deploy-test
jujubot Apr 6, 2023
42c5f5f
Ensure submakes can share jobs with parent make.
hpidcock Apr 6, 2023
9e1b0e5
[CI] smoke tests workflow must always run
barrettj12 Apr 6, 2023
339979d
Updates the gnu source for deps and remakes config.
tlm Apr 6, 2023
f8826d5
Merge pull request #15436 from tlm/musl-fixes
hpidcock Apr 6, 2023
48bdd0a
Merge pull request #15439 from hpidcock/ensure-make-jobserver
hpidcock Apr 6, 2023
f78f944
Add check for explicit base in bundles when image-id constraint is set
nvinuesa Mar 29, 2023
933263f
Remove usage of charmURL in series check for bundles
nvinuesa Apr 4, 2023
ff8a486
Merge pull request #15438 from barrettj12/smoke-required
jujubot Apr 6, 2023
b559816
Include machine constraints in series check for bundles
nvinuesa Apr 4, 2023
6098f73
Fix improper check for musl-cross-make.
hpidcock Apr 6, 2023
65cfc84
Merge pull request #15440 from hpidcock/fix-check-for-musl-cross-make
hpidcock Apr 6, 2023
1fbb20e
Merge pull request #15409 from nvinuesa/juju-3386
jujubot Apr 6, 2023
6610ebd
Merge branch '2.9' into merge-2.9-into-3.0
jack-w-shaw Apr 6, 2023
41e9c69
Merge pull request #15442 from jack-w-shaw/merge-2.9-into-3.0
jujubot Apr 6, 2023
2791635
Merge branch '3.0' into merge-3.0-into-3.1
jack-w-shaw Apr 6, 2023
7009f54
Merge pull request #15443 from jack-w-shaw/merge-3.0-into-3.1
jujubot Apr 6, 2023
62e58bb
Merge branch '3.1' into merge-3.1-into-3.2
jack-w-shaw Apr 6, 2023
43a53dd
Merge pull request #15444 from jack-w-shaw/merge-3.1-into-3.2
jujubot Apr 6, 2023
64c0af6
Add race-test make target.
hpidcock Apr 7, 2023
07fedf5
Add race-test make target.
hpidcock Apr 7, 2023
3d8ae6c
Merge pull request #15447 from hpidcock/add-race-test-target-3.2
jujubot Apr 7, 2023
aee24c1
Merge pull request #15446 from hpidcock/add-race-test-target
jujubot Apr 7, 2023
0aba049
Resolves run_deploy_bundle_overlay_with_image_id_no_base issue and bu…
anvial Apr 7, 2023
c75466b
Add comment about assumption
cderici Apr 7, 2023
ef322c5
Add more info into the error message
cderici Apr 7, 2023
d406be0
Fix data race in openDatabase.
hpidcock Apr 7, 2023
4208ed4
Merge pull request #15448 from anvial/JUJU-3467-fix-test-deploy-test-…
hpidcock Apr 7, 2023
beb4bd9
Merge pull request #15432 from cderici/fix-error-message-deploy-cs-ch…
jujubot Apr 7, 2023
feec37d
Update ppc64le prebuilt sha + Use juju/musl-cross-make.
hpidcock Apr 8, 2023
9fcec32
Github action workflows should always build on tooling changes.
hpidcock Apr 8, 2023
4d9f389
Don't conflate ec2 with aws and gce with google in BOOTSTRAP_PROVIDER.
hpidcock Apr 8, 2023
b4281e4
sqlite3 configure does not save CFLAGS for make command.
hpidcock Apr 10, 2023
057fe03
Merge pull request #15354 from juju/increment-to-3.1.3
hpidcock Apr 10, 2023
c5dc0a6
Merge pull request #15452 from hpidcock/fix-ck-google
jujubot Apr 10, 2023
94dd46c
Merge pull request #15450 from hpidcock/fix-data-race-dbaccessor
jujubot Apr 11, 2023
8cf2071
fix bundle deploy test (w/o fixed revisions)
barrettj12 Apr 11, 2023
5898996
Merge pull request #15453 from barrettj12/test-bundles
jujubot Apr 11, 2023
7b6c6c0
Merge branch '2.9' into 3.0
hpidcock Apr 11, 2023
c6c1483
Merge pull request #15454 from hpidcock/merge-2.9-3.0-20230411
hpidcock Apr 11, 2023
a0420a4
Merge branch '3.0' into merge-3.0-3.1-20230411
hpidcock Apr 11, 2023
9fa852c
Merge pull request #15455 from hpidcock/merge-3.0-3.1-20230411
hpidcock Apr 11, 2023
32df46a
Merge branch '3.1' into merge-3.1-3.2
hpidcock Apr 11, 2023
c267952
Pass CFLAGS directly to sqlite make.
hpidcock Apr 11, 2023
0662af8
Merge pull request #15456 from hpidcock/merge-3.1-3.2
jujubot Apr 11, 2023
6902eb5
Merge pull request #15421 from manadart/3.2-tracked-db-tidy
jujubot Apr 11, 2023
a82abe3
LXD dependency update
SimonRichardson Apr 11, 2023
ac9f5a2
Merge pull request #15451 from hpidcock/update-deps-dqlite-musl
jujubot Apr 11, 2023
40c5a5b
Find subnet via vpc association in manual-deploy-aws
jack-w-shaw Apr 11, 2023
2086baf
Merge pull request #15457 from SimonRichardson/lxd-dependency-update
jujubot Apr 11, 2023
0d4805d
Replace ubuntu charm with tiny-bash in bundles integration test
nvinuesa Apr 11, 2023
c0aede4
Merge pull request #15459 from jack-w-shaw/JUJU-3486_fix_manual_deply…
jujubot Apr 11, 2023
cb58c03
Update use of oracle's oci sdk to v65.
hmlanigan Apr 10, 2023
be9a4a6
Get live shape data rather than hardcoded.
hmlanigan Apr 11, 2023
cc1d20a
Supply more data to oci instance hardwareCharacteristics.
hmlanigan Apr 11, 2023
ab169da
Merge pull request #15460 from nvinuesa/juju-3942
hpidcock Apr 11, 2023
07151f5
Fixes panic with k8s metadata.
tlm Apr 12, 2023
445ca1f
Merge pull request #15462 from tlm/panic-k8s-metadata
jujubot Apr 12, 2023
51bdd60
Fixes typo for storage class metadata.
tlm Apr 12, 2023
9c3763a
Use upstream overlays for ck test.
hpidcock Apr 12, 2023
a3cdb3d
Merge pull request #15463 from tlm/panic-k8s-metadata
jujubot Apr 12, 2023
8513568
Merge pull request #15464 from hpidcock/ck-overlays
hpidcock Apr 12, 2023
1e134ca
Merge remote-tracking branch 'juju/2.9' into 2.9-into-3.0
tlm Apr 12, 2023
330de3e
[bundle test] replace ubuntu/tiny-bash with juju-qa-test
barrettj12 Apr 12, 2023
9bf0cc3
Merge pull request #15466 from tlm/2.9-into-3.0
jujubot Apr 12, 2023
690a002
Merge remote-tracking branch 'juju/3.0' into 3.0-into-3.1
tlm Apr 12, 2023
247c078
Merge pull request #15465 from barrettj12/bundle-arm
jujubot Apr 12, 2023
334384a
Merge pull request #15467 from tlm/3.0-into-3.1
jujubot Apr 12, 2023
7262d8a
Ensures that we do not error out and restart the DB accessor worker when
manadart Apr 12, 2023
25d899d
Avoids returning an error when we the bootstrapped node's db-accessor
manadart Apr 12, 2023
4494eeb
Changes log message level for inadequate server details from debug to
manadart Apr 12, 2023
79b4d12
Merge branch '3.1' into 3.1-3.2-20230412
hpidcock Apr 12, 2023
e05649d
Merge pull request #15468 from manadart/3.2-faster-ha
jujubot Apr 12, 2023
90ba82d
Merge pull request #15469 from hpidcock/3.1-3.2-20230412
jujubot Apr 12, 2023
7aa35de
Use set_verbosity abstraction instead of set
jack-w-shaw Apr 12, 2023
f869d3f
Merge pull request #15470 from jack-w-shaw/JUJU-3486_fix_verbosity
jujubot Apr 12, 2023
c030678
static analysis and review comment nits.
hmlanigan Apr 12, 2023
70f2888
Additional TODOs.
hmlanigan Apr 12, 2023
b4572a5
Merge pull request #15461 from hmlanigan/find-oracle-shapes
jujubot Apr 12, 2023
eaa73e3
Use recommended storage from ck overlay.
hpidcock Apr 12, 2023
e2629e8
Add support for no-prompt to login/change-user-password.
hpidcock Apr 13, 2023
7e1b1dc
Fix non-microk8s cloud finding (e.g. minikube, from kubeconfig)
hpidcock Mar 27, 2023
6184308
Merge pull request #15336 from hpidcock/fix-k8s-cloud-finding
jujubot Apr 13, 2023
9e65818
Merge pull request #15472 from hpidcock/no-prompt-password
jujubot Apr 13, 2023
6e5f3f4
Improve logging for spaces_ec2
jack-w-shaw Apr 13, 2023
ad86299
Merge pull request #15473 from jack-w-shaw/JUJU-3486_improve_logging
jujubot Apr 13, 2023
523ac90
Merge remote-tracking branch 'upstream/2.9' into merge-to-3.0
hmlanigan Apr 13, 2023
37e2743
Merge pull request #15475 from hmlanigan/merge-to-3.0
jujubot Apr 13, 2023
acbfb6b
Merge remote-tracking branch 'upstream/3.0' into merge-3.1
hmlanigan Apr 13, 2023
c95b6de
Merge pull request #15476 from hmlanigan/merge-3.1
jujubot Apr 13, 2023
ba2a4ba
Merge remote-tracking branch 'upstream/3.1' into merge-3.2
hmlanigan Apr 13, 2023
a555ce2
Merge pull request #15477 from hmlanigan/merge-3.2
jujubot Apr 13, 2023
72c80d5
Fix ck test suite and reduce its size.
hpidcock Apr 13, 2023
b540f4e
Fix use of `juju info` in suites, channel-map is now channels.
hpidcock Apr 13, 2023
6a03306
Merge pull request #15478 from hpidcock/fix-channel-map-juju-info-tests
hpidcock Apr 13, 2023
cdcfba5
Merge pull request #15471 from hpidcock/fix-storage-ck
hpidcock Apr 13, 2023
f677096
Merge pull request #15479 from juju/2.9
hpidcock Apr 13, 2023
be2554e
Merge pull request #15480 from juju/3.0
hpidcock Apr 13, 2023
21b728d
Merge pull request #15481 from juju/3.1
hpidcock Apr 13, 2023
e498f77
Update the go-dqlite dependency
SimonRichardson Apr 14, 2023
6abddb5
Changes the expectation for TrackedDB mock termination to be softer.
manadart Apr 14, 2023
1d3fedf
Remove the node yaml hack
SimonRichardson Apr 14, 2023
b395dde
Ensures that when shutting down the DB worker, openDatabase will return
manadart Apr 14, 2023
07e3aac
Only run the database tests if dqlite is enabled
SimonRichardson Apr 14, 2023
0bc0f55
Dynamically configure expected interfaces for spaces_ec2
jack-w-shaw Apr 14, 2023
af29aa5
Merge pull request #15485 from manadart/3.2-fix-db-worker-tests
jujubot Apr 14, 2023
affbb88
Merge pull request #15486 from jack-w-shaw/JUJU-3488_improve_reliabil…
jujubot Apr 14, 2023
29f2e9a
Merge pull request #15484 from SimonRichardson/update-dqlite-dep
jujubot Apr 14, 2023
d54a208
Bump version to 3.2-rc1
hpidcock Apr 17, 2023
0e7baf2
Merge pull request #15491 from hpidcock/bump-3.2-rc1
hpidcock Apr 17, 2023
1141dcd
Merge branch '3.2' into 3.2-into-develop
jack-w-shaw Apr 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- '**.go'
- 'go.mod'
- '.github/workflows/build.yml'
- 'scripts/dqlite/**'
- 'Makefile'
- 'make_functions.sh'
workflow_dispatch:

permissions:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/client-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- '**.go'
- 'go.mod'
- '.github/workflows/client-tests.yml'
- 'scripts/dqlite/**'
- 'Makefile'
- 'make_functions.sh'
workflow_dispatch:

permissions:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
- '**.go'
- 'go.mod'
- '.github/workflows/gen.yml'
- 'Makefile'
- 'make_functions.sh'
workflow_dispatch:

permissions:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/migrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
- 'go.mod'
- 'snap/**'
- '.github/workflows/migrate.yml'
- 'scripts/dqlite/**'
- 'Makefile'
- 'make_functions.sh'
workflow_dispatch:

permissions:
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@ on:
push:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- '**.go'
- 'go.mod'
- 'testcharms/**'
- 'tests/main.sh'
- 'tests/includes/**'
- 'tests/suites/smoke/**'
- '.github/workflows/smoke.yml'
workflow_dispatch:

permissions:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
- 'go.mod'
- 'snap/**'
- '.github/workflows/snap.yml'
- 'scripts/dqlite/**'
- 'Makefile'
- 'make_functions.sh'
workflow_dispatch:

permissions:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
- 'snap/**'
- '.github/workflows/upgrade.yml'
- '.github/setup-lxd/**'
- 'scripts/dqlite/**'
- 'Makefile'
- 'make_functions.sh'
branches-ignore:
- 'develop'
workflow_dispatch:
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,10 @@ else
endif
TEST_TIMEOUT := $(TEST_TIMEOUT)

TEST_ARGS ?=
# Limit concurrency on s390x.
ifeq ($(shell echo "${GOARCH}" | sed -E 's/.*(s390x).*/golang/'), golang)
TEST_ARGS ?= -p 4
else
TEST_ARGS ?=
TEST_ARGS += -p 4
endif

# Enable coverage testing.
Expand Down Expand Up @@ -394,6 +393,11 @@ check: pre-check run-tests
test: run-tests
## test: Verify Juju code using unit tests

.PHONY: race-test
race-test:
## race-test: Verify Juju code using unit tests with the race detector enabled
+make run-tests TEST_ARGS="$(TEST_ARGS) -race"

.PHONY: run-tests run-go-tests
# Can't make the length of the TMP dir too long or it hits socket name length issues.
run-tests: musl-install-if-missing dqlite-install-if-missing
Expand Down
10 changes: 4 additions & 6 deletions apiserver/facades/client/modelupgrader/upgrader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
package modelupgrader_test

import (
"net/http"

"github.com/golang/mock/gomock"
"github.com/juju/errors"
"github.com/juju/names/v4"
Expand Down Expand Up @@ -195,7 +193,7 @@ func (s *modelUpgradeSuite) assertUpgradeModelForControllerModelJuju3(c *gc.C, d
server := upgradevalidationmocks.NewMockServer(ctrl)
serverFactory := upgradevalidationmocks.NewMockServerFactory(ctrl)
s.PatchValue(&upgradevalidation.NewServerFactory,
func(httpClient *http.Client) lxd.ServerFactory {
func(_ lxd.NewHTTPClientFunc) lxd.ServerFactory {
return serverFactory
},
)
Expand Down Expand Up @@ -319,7 +317,7 @@ func (s *modelUpgradeSuite) TestUpgradeModelForControllerModelJuju3Failed(c *gc.
server := upgradevalidationmocks.NewMockServer(ctrl)
serverFactory := upgradevalidationmocks.NewMockServerFactory(ctrl)
s.PatchValue(&upgradevalidation.NewServerFactory,
func(httpClient *http.Client) lxd.ServerFactory {
func(_ lxd.NewHTTPClientFunc) lxd.ServerFactory {
return serverFactory
},
)
Expand Down Expand Up @@ -446,7 +444,7 @@ func (s *modelUpgradeSuite) assertUpgradeModelJuju3(c *gc.C, dryRun bool) {
server := upgradevalidationmocks.NewMockServer(ctrl)
serverFactory := upgradevalidationmocks.NewMockServerFactory(ctrl)
s.PatchValue(&upgradevalidation.NewServerFactory,
func(httpClient *http.Client) lxd.ServerFactory {
func(_ lxd.NewHTTPClientFunc) lxd.ServerFactory {
return serverFactory
},
)
Expand Down Expand Up @@ -525,7 +523,7 @@ func (s *modelUpgradeSuite) TestUpgradeModelJuju3Failed(c *gc.C) {
server := upgradevalidationmocks.NewMockServer(ctrl)
serverFactory := upgradevalidationmocks.NewMockServerFactory(ctrl)
s.PatchValue(&upgradevalidation.NewServerFactory,
func(httpClient *http.Client) lxd.ServerFactory {
func(_ lxd.NewHTTPClientFunc) lxd.ServerFactory {
return serverFactory
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ func (s *CAASProvisionerSuite) assertProvisioningInfo(c *gc.C, isRawK8sSpec bool
},
})
c.Assert(err, jc.ErrorIsNil)
expectedVersion := jujuversion.Current
expectedVersion.Build = 666
// Maps are harder to check...
// http://ci.jujucharms.com/job/make-check-juju/4853/testReport/junit/github/com_juju_juju_apiserver_facades_controller_caasunitprovisioner/TestAll/
expectedResult := &params.KubernetesProvisioningInfo{
Expand All @@ -237,7 +239,7 @@ func (s *CAASProvisionerSuite) assertProvisioningInfo(c *gc.C, isRawK8sSpec bool
ServiceType: "loadbalancer",
},
ImageRepo: params.DockerImageInfo{
RegistryPath: fmt.Sprintf("jujusolutions/jujud-operator:%s", jujuversion.Current.String()+".666"),
RegistryPath: fmt.Sprintf("jujusolutions/jujud-operator:%s", expectedVersion.String()),
},
Devices: []params.KubernetesDeviceParams{
{
Expand Down
6 changes: 4 additions & 2 deletions caas/kubernetes/provider/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,8 @@ func (s *bootstrapSuite) TestBootstrap(c *gc.C) {
}...,
)

expectedVersion := jujuversion.Current
expectedVersion.Build = 666
probCmds := &core.ExecAction{
Command: []string{
"mongo",
Expand Down Expand Up @@ -756,7 +758,7 @@ func (s *bootstrapSuite) TestBootstrap(c *gc.C) {
{
Name: "api-server",
ImagePullPolicy: core.PullIfNotPresent,
Image: "test-account/jujud-operator:" + jujuversion.Current.String() + ".666",
Image: "test-account/jujud-operator:" + expectedVersion.String(),
Env: []core.EnvVar{{
Name: osenv.JujuFeatureFlagEnvKey,
Value: "developer-mode",
Expand Down Expand Up @@ -882,7 +884,7 @@ EOF
statefulSetSpec.Spec.Template.Spec.InitContainers = []core.Container{{
Name: "charm-init",
ImagePullPolicy: core.PullIfNotPresent,
Image: "test-account/jujud-operator:" + jujuversion.Current.String() + ".666",
Image: "test-account/jujud-operator:" + expectedVersion.String(),
WorkingDir: "/var/lib/juju",
Command: []string{"/opt/containeragent"},
Args: []string{"init", "--containeragent-pebble-dir", "/containeragent/pebble", "--charm-modified-version", "0", "--data-dir", "/var/lib/juju", "--bin-dir", "/charm/bin", "--controller"},
Expand Down
18 changes: 7 additions & 11 deletions caas/kubernetes/provider/detectcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,14 @@ func localKubeConfigClouds() ([]cloud.Cloud, error) {

// DetectCloud implements environs.CloudDetector.
func (p kubernetesEnvironProvider) DetectCloud(name string) (cloud.Cloud, error) {
mk8sCloud, err := p.builtinCloudGetter(p.cmdRunner)
if err == nil && name == k8s.K8sCloudMicrok8s {
return mk8sCloud, nil
}

if !errors.IsNotFound(err) && err != nil {
// if the cloud is not microk8s and we get the user group error, return not found so the caller skips the cloud
// https://bugs.launchpad.net/juju/+bug/1937985
if name != k8s.K8sCloudMicrok8s {
return cloud.Cloud{}, errors.NotFoundf("cloud %s", name)
if name == k8s.K8sCloudMicrok8s {
// TODO: this whole thing is poorly written and we need to handle this better.
// Also builtinCloudGetter should really be called, microk8sCloudGetter...
microk8sCloud, err := p.builtinCloudGetter(p.cmdRunner)
if err != nil {
return cloud.Cloud{}, errors.Trace(err)
}
return cloud.Cloud{}, errors.Trace(err)
return microk8sCloud, nil
}

localKubeConfigClouds, err := localKubeConfigClouds()
Expand Down
16 changes: 9 additions & 7 deletions caas/kubernetes/provider/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,17 @@ func GetClusterMetadata(
}
}

if nominatedStorageClass != "" && selectedOperatorSC.Name != nominatedStorageClass {
return nil, &environs.NominatedStorageNotFound{
StorageName: nominatedStorageClass,
if nominatedStorageClass != "" {
if selectedOperatorSC == nil || selectedOperatorSC.Name != nominatedStorageClass {
return nil, &environs.NominatedStorageNotFound{
StorageName: nominatedStorageClass,
}
}
}

if nominatedStorageClass != "" && selectedWorkloadSC.Name != nominatedStorageClass {
return nil, &environs.NominatedStorageNotFound{
StorageName: nominatedStorageClass,
if selectedWorkloadSC == nil || selectedWorkloadSC.Name != nominatedStorageClass {
return nil, &environs.NominatedStorageNotFound{
StorageName: nominatedStorageClass,
}
}
}

Expand Down
21 changes: 21 additions & 0 deletions caas/kubernetes/provider/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -741,3 +741,24 @@ func (s *K8sMetadataSuite) TestNominatedStorageNotFound(c *gc.C) {
c.Assert(errors.As(err, &notFoundError), jc.IsTrue)
c.Assert(notFoundError.StorageName, gc.Equals, "my-nominated-storage")
}

// TestNominatedStorageNotFoundWithNilStorageClasses is a regression test to
// make sure that when no storage classes are defined and a nominated storage
// class has been specified a NominatedStorageNotFoundError is returned.
func (s *K8sMetadataSuite) TestNominatedStorageNotFoundWithNilStorageClasses(c *gc.C) {
clientSet := fake.NewSimpleClientset(
newNode(map[string]string{}),
)

_, err := provider.GetClusterMetadata(
context.TODO(),
"my-nominated-storage",
clientSet.CoreV1().Nodes(),
clientSet.StorageV1().StorageClasses(),
)

var notFoundError *environs.NominatedStorageNotFound
c.Assert(err, gc.NotNil)
c.Assert(errors.As(err, &notFoundError), jc.IsTrue)
c.Assert(notFoundError.StorageName, gc.Equals, "my-nominated-storage")
}
42 changes: 42 additions & 0 deletions cmd/juju/application/deployer/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ func (d *deployBundle) deploy(
}
d.printDryRunUnmarshalErrors(ctx, unmarshalErrors)

err = d.checkExplicitSeries(bundleData)
if err != nil {
return errors.Trace(err)
}

d.bundleDir = d.bundleDataSource.BasePath()

// Short-circuit trust checks if the operator specifies '--force'
Expand Down Expand Up @@ -173,6 +178,43 @@ Please repeat the deploy command with the --trust argument if you consent to tru
return nil
}

// checkExplicitSeries returns an error if the image-id constraint is used and
// there is no series explicitly defined by the user.
func (d *deployBundle) checkExplicitSeries(bundleData *charm.BundleData) error {
for _, applicationSpec := range bundleData.Applications {
// First we check if the app is deployed "to" a machine that
// has the image-id constraint
machineHasImageID := false
for _, to := range applicationSpec.To {
machineCons, err := constraints.Parse(bundleData.Machines[to].Constraints)
if err != nil {
return errors.Trace(err)
}
if machineCons.HasImageID() {
machineHasImageID = true
break
}
}
// Then we check if the constraints declared on the app have
// image-id
appCons, err := constraints.Parse(applicationSpec.Constraints)
if err != nil {
return errors.Trace(err)
}
appHasImageID := appCons.HasImageID()
// Lastly we check if the model constraints have image-id
modelHasImageID := d.modelConstraints.HasImageID()
// We check if series are defined when any of the constraints
// above have image-id
if (appHasImageID || modelHasImageID || machineHasImageID) &&
applicationSpec.Series == "" &&
bundleData.Series == "" {
return errors.Forbiddenf("base must be explicitly provided for %q when image-id constraint is used", applicationSpec.Charm)
}
}
return nil
}

func (d *deployBundle) printDryRunUnmarshalErrors(ctx *cmd.Context, unmarshalErrors []error) {
if !d.dryRun {
return
Expand Down
Loading