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

Merged
merged 208 commits into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
208 commits
Select commit Hold shift + click to select a range
c7f8ad1
Ensure that we unsubscribe from the hub when the state pool gets closed
achilleasa Mar 26, 2021
5fc1109
Merge pull request #12827 from achilleasa/2.8-unsubscribe-from-hub-wh…
jujubot Mar 26, 2021
3370f60
Correct default bootstrap-timeout value displayed in help.
hmlanigan Mar 26, 2021
57d39fa
Merge pull request #12829 from hmlanigan/fix-timeout-bootstrap-help
jujubot Mar 26, 2021
a7d223b
Support recursive merging of parsed netplan configurations
achilleasa Mar 31, 2021
a2ab0e5
Constraint tags can be used for pod affinity
wallyworld Mar 31, 2021
fbd3c3f
Merge pull request #12840 from wallyworld/pod-affinity
jujubot Apr 1, 2021
c07fd48
Merge branch '2.8' into merge-2.8-20210401
wallyworld Apr 1, 2021
34bd437
Fix upgrade series agent version handling
wallyworld Apr 1, 2021
6f6aff2
Allow costumization of disk provisioning.
gabriel-samfira Mar 15, 2021
be6120c
Fixed default disk provisioning type & added tests
gabriel-samfira Mar 29, 2021
146c1ce
Rename disk provisioning types
gabriel-samfira Apr 1, 2021
2fafa9c
Add helper for building CIDRs given an IP and netmask
achilleasa Apr 1, 2021
6409056
Include CIDR field when serializing machine addresses into RPC params
achilleasa Apr 1, 2021
fbe64fb
Populate CIDR field when the machiner reports machine addresses
achilleasa Apr 1, 2021
7bc69b5
Calculate network CIDR from observed addrs when populating subnet det…
achilleasa Apr 1, 2021
ffcb567
Replace camel case with lower case
gabriel-samfira Apr 1, 2021
379701f
Merge pull request #12843 from wallyworld/merge-2.8-20210401
jujubot Apr 6, 2021
cb4ac1f
Merge pull request #12794 from gabriel-samfira/add-disk-provisioning-…
jujubot Apr 6, 2021
3bd264b
Merge pull request #12842 from wallyworld/upgrade-series-fix
jujubot Apr 6, 2021
257ceca
Merge pull request #12845 from achilleasa/2.9-restore-spaces-function…
jujubot Apr 6, 2021
3723de5
Increment juju to 2.9-rc10
jujubot Apr 7, 2021
2565b2f
Merge pull request #12851 from jujubot/increment-to-2.9-rc10
wallyworld Apr 7, 2021
26e9b29
Distinguish between missing and empty link-local attr in netplan configs
achilleasa Apr 7, 2021
9de8d59
Merge pull request #12839 from achilleasa/2.8-support-merging-of-netp…
jujubot Apr 7, 2021
411b577
Merge branch '2.8' into 2.9
achilleasa Apr 7, 2021
a04e6ae
Adds types to network-get jujuc command used to serialise NetworkInfo
manadart Apr 7, 2021
ea78216
Adds extra fields for preserving old YAML serialisation of network-get
manadart Apr 7, 2021
d489b48
Merge pull request #12852 from achilleasa/2.9-merge-2.8
jujubot Apr 7, 2021
c704647
Merge pull request #12853 from manadart/2.9-net-info-display
jujubot Apr 7, 2021
5b9de8b
Use Base in Charmhub package and its response structures.
hmlanigan Apr 6, 2021
aa7520e
Fix for LP1921557 sni in Juju login.
tlm Apr 8, 2021
adc914c
Merge pull request #12854 from tlm/lp-1921557-ipsans-2.8
jujubot Apr 8, 2021
62ef3e7
Add ErrorCodeInvalidCharmBase.
hmlanigan Apr 8, 2021
09af67a
Additional series to version changes in tests.
hmlanigan Apr 8, 2021
66890b0
Display suggested series, as series not versions.
hmlanigan Apr 8, 2021
252d85e
Convert to kubernetes, not from kubernetes.
hmlanigan Apr 8, 2021
285c60d
Merge pull request #12850 from hmlanigan/platform-to-base
jujubot Apr 9, 2021
8522c13
Introduces a 5 second wait between shutdown and status detection in
manadart Apr 12, 2021
1930e5b
Integration fixes
SimonRichardson Mar 29, 2021
37148d2
Waits for port on rebooted machine to become available instead of
manadart Apr 12, 2021
8d66ff7
Consistent with brackets
SimonRichardson Apr 12, 2021
870fe74
Tail the current log
SimonRichardson Apr 12, 2021
a43def8
Merge pull request #12858 from manadart/2.8-upgrade-series-wait
jujubot Apr 12, 2021
a4ca262
Fix linters
SimonRichardson Apr 12, 2021
0d26a9e
Removed logging from core annotations.
tlm Apr 13, 2021
090a304
Merge pull request #12860 from tlm/empty-annotations
jujubot Apr 13, 2021
9ffbcba
Do nothing and return nil if no PodSpec and RawK8sSpec provided;
ycliuhw Apr 13, 2021
aa5d56d
Merge branch '2.8' of github.com:juju/juju into 2.8
ycliuhw Apr 13, 2021
c0b4d1b
Add more tests for EnsureService;
ycliuhw Apr 13, 2021
bd772a7
Add support for newer eksctl for juju add-k8s --eks eks;
ycliuhw Apr 13, 2021
3e63700
Use SIGKILL rather than SIGINT
SimonRichardson Apr 13, 2021
dfca7e5
Fix the output from a check
SimonRichardson Apr 13, 2021
656cb4a
Update Pebble version to include new files API
benhoyt Apr 13, 2021
8f35160
Fixes bug where empty error can happen in storage
tlm Apr 13, 2021
6363295
Workaround for k8s dashboard URL with k8s client proxy
wallyworld Apr 13, 2021
6b1b769
Merge pull request #12861 from tlm/empty-error-for-k8-storage
jujubot Apr 13, 2021
101622f
Merge pull request #12865 from benhoyt/update-pebble-4
jujubot Apr 14, 2021
1ede980
Merge pull request #12866 from wallyworld/k8s-dashboard-workaround
jujubot Apr 14, 2021
7fd72d5
Merge pull request #12862 from ycliuhw/fix/lp-1923051
jujubot Apr 14, 2021
450a38b
Add more tests for juju add-k8s --eks eks;
ycliuhw Apr 14, 2021
0c0068f
Merge pull request #12867 from ycliuhw/fix/lp-1923561
jujubot Apr 14, 2021
84ca40c
Merge branch '2.8' into merge-2.8
ycliuhw Apr 14, 2021
805d593
Fix tests for 2.9;
ycliuhw Apr 14, 2021
9f34465
Merge pull request #12868 from ycliuhw/merge-2.8
jujubot Apr 14, 2021
0400559
Increment juju to 2.9-rc11
jujubot Apr 14, 2021
6987d38
Merge pull request #12869 from jujubot/increment-to-2.9-rc11
wallyworld Apr 14, 2021
e116ef7
Updates charm library dependency to the latest v8 patch.
manadart Apr 14, 2021
905e19e
Removes channel logic from core/charm that was copied to the charm
manadart Apr 14, 2021
6a66c24
Updates state package to use charm dependency instead of core/charm for
manadart Apr 14, 2021
7d58712
Updates resourceadapters for relocated channel concerns.
manadart Apr 14, 2021
41db2b9
Updates client facades to work with channel logic from the charm lib.
manadart Apr 14, 2021
81ec35a
Updates controller facades to work with channel logic from the charm …
manadart Apr 14, 2021
4f3b695
Updates api package to work with channel logic from the charm lib.
manadart Apr 14, 2021
bca190a
Updates cmd package to work with channel logic from the charm lib.
manadart Apr 14, 2021
fbaa5bb
Renames CoreChannel method to CharmChannel to correctly represent the
manadart Apr 14, 2021
7c3250c
Fixes test files in deployer package for relocated channel concerns.
manadart Apr 14, 2021
7e50d6a
Fixes tests in cmd/juju/application sub-packages for relocated channel
manadart Apr 14, 2021
6e44385
Merge pull request #12870 from manadart/2.9-use-charm-channel
jujubot Apr 14, 2021
f43ddde
bug: fix for bootstrap fail on vsphere 7 + multi network
Apr 13, 2021
e671adf
Merge '2.9-bases' branch
wallyworld Apr 14, 2021
cbbabe8
Use staging charmhub by default for now
wallyworld Apr 14, 2021
2568ef4
Add support for setting pod affinity topology key
wallyworld Apr 15, 2021
cc2b02c
Merge pull request #12872 from wallyworld/merge-bases-branch
jujubot Apr 15, 2021
084d9af
Use Patch instead of Update for ensuring ingress resources;
ycliuhw Apr 14, 2021
83380e2
Merge pull request #12873 from wallyworld/affinity-topology
jujubot Apr 15, 2021
48e124f
Merge branch '2.8' into merge-2.8-20210415
wallyworld Apr 15, 2021
98f8e2a
Use Patch instead of Update for ensuring ingress resources;
ycliuhw Apr 15, 2021
bf235e0
Merge pull request #12875 from wallyworld/merge-2.8-20210415
jujubot Apr 15, 2021
85805a4
Merge pull request #12874 from ycliuhw/fix/lp-1916621
jujubot Apr 15, 2021
eeb82fb
Merge pull request #12876 from ycliuhw/fix/lp-1916621-2.8
jujubot Apr 15, 2021
44b6da7
Merge pull request #12831 from SimonRichardson/static-test-fixes
jujubot Apr 15, 2021
96fb26f
Allow base channel to also contain a risk
SimonRichardson Apr 15, 2021
a97a54c
Handle the channel risk correctly
SimonRichardson Apr 15, 2021
9b0c870
Test channel track
SimonRichardson Apr 15, 2021
d25ae72
Merge pull request #12879 from SimonRichardson/ensure-refresh-uses-ve…
jujubot Apr 15, 2021
53768cd
Merge pull request #12864 from diddledan/issue-1923606
jujubot Apr 15, 2021
37b7be6
Merge branch '2.8' into merge-2.8-20210416
wallyworld Apr 15, 2021
034f71f
Merge pull request #12880 from wallyworld/merge-2.8-20210416
jujubot Apr 15, 2021
8c84500
Add tmp fix for github action instance issue 3185;
ycliuhw Apr 16, 2021
c584d97
Remove the tmp fix for pinging sha to 5e0b6fcb;
ycliuhw Apr 16, 2021
b353574
Fix ssh with sidecar charms and containers.
hpidcock Apr 16, 2021
0ceca63
Merge pull request #12882 from ycliuhw/fix/kubeflow-precommit-test
wallyworld Apr 16, 2021
1407bce
Merge branch '2.8' into merge-2.8
ycliuhw Apr 16, 2021
54db730
Merge pull request #12885 from ycliuhw/merge-2.8
wallyworld Apr 16, 2021
2a756d7
Initial work to allow juju trust for sidecar charms
wallyworld Apr 16, 2021
9eacd60
Merge pull request #12883 from wallyworld/test-sidecar-charms
jujubot Apr 16, 2021
23a5e32
Ensure we push bases all the way through
SimonRichardson Apr 16, 2021
bb80d5a
Update the users of the charmhub client
SimonRichardson Apr 16, 2021
17a2702
Validate a channel
SimonRichardson Apr 16, 2021
4385eb4
Merge pull request #12884 from hpidcock/fix-container-ssh
jujubot Apr 16, 2021
0e3a680
Update download to take into account bases
SimonRichardson Apr 16, 2021
101dea6
Merge pull request #12886 from SimonRichardson/charmhub-bases
jujubot Apr 16, 2021
0704776
Corrects misspelled PostDestroyAppLife.
manadart Apr 15, 2021
c6a9860
Updates charm dependency to latest v8 patch version.
manadart Apr 15, 2021
1b755a4
Add ComputedSeries.
hmlanigan Apr 15, 2021
c506804
Updates state package for new charm metadata version determination
manadart Apr 15, 2021
5626bfb
Manifest has been renamed to ArchiveMembers in new version of charm
hmlanigan Apr 15, 2021
d367a30
metadata no longer has a Format() method, do it locally.
hmlanigan Apr 15, 2021
860b19c
Use core charm ComputedSeries for charm package update.
hmlanigan Apr 15, 2021
b3df58a
Adding TODO
hmlanigan Apr 15, 2021
e84d848
Move Bases from Meta in params to new Manfest for Charm.
hmlanigan Apr 15, 2021
ebd0e9b
Ensures that ComputedSeries returns "kubernetes" for side-car based
manadart Apr 16, 2021
7c86743
Fixes SSH for containers to determine metadata version without the
manadart Apr 16, 2021
86a6d37
Updates generated mocks for charm refresher tests.
manadart Apr 16, 2021
9c5f648
Fixes application water tests to accomodate latest charm dependency.
manadart Apr 16, 2021
95da6be
Fixes CockroachDB test charm for new manifest/metadata format.
manadart Apr 16, 2021
f47ea71
Fixes caasapplication agent tests for new charm metadata/manifest
manadart Apr 16, 2021
4b98266
Updates generated charm mocks in API server client package.
manadart Apr 16, 2021
7d05343
Updates hand-rolled mocks for CAAS firewaller API test charm.
manadart Apr 16, 2021
6c360ca
Replaces both name and channel when constructing a base for series
manadart Apr 16, 2021
70cf159
pull in bson additions to bases in charm pkg to fix CharmTestHelperSu…
hmlanigan Apr 16, 2021
7da198c
fix test failure related to new charm package
hmlanigan Apr 16, 2021
6c165e0
Fixes caasapplicationprovisioner tests for new charm metadata/manifes…
hmlanigan Apr 16, 2021
e0054bc
CharmArchive Manifest() has been renamed ArchiveMembers in the pkg
hmlanigan Apr 16, 2021
029bdb2
Fix sshContainerSuite tests for new charm metadata/manifest format.
hmlanigan Apr 16, 2021
f443f0e
Add manifest into the charm for test
hmlanigan Apr 16, 2021
22313da
Move bases from metadata to manifest into the charm for test
hmlanigan Apr 16, 2021
2b8595c
Merge pull request #12881 from hmlanigan/use-charm-pkg-updates
jujubot Apr 17, 2021
06fdef4
Ignore projected volume mounts when looking up juju storage
wallyworld Apr 19, 2021
a950546
Fix passing empty string container name to unit params;
ycliuhw Apr 19, 2021
5eabc0d
Add tests for JUJU_CONTAINER_NAMES parsing fix;
ycliuhw Apr 19, 2021
6bf73ac
Remove containerNames from init command;
ycliuhw Apr 19, 2021
6d9150f
Merge pull request #12889 from wallyworld/ignore-volume-projection
jujubot Apr 19, 2021
fbb0e56
Ensure we validate the model target
SimonRichardson Apr 16, 2021
4db5f5e
Remove platforms from find.
SimonRichardson Apr 16, 2021
b885f3e
Attempt to fix some more tests
SimonRichardson Apr 16, 2021
84932f9
Add better comments around validate model target
SimonRichardson Apr 19, 2021
9891adf
Prevent the leaking of internal naming
SimonRichardson Apr 19, 2021
88f48af
Update charn/v8 and remove use of juju/version
wallyworld Apr 19, 2021
a264270
Merge pull request #12890 from ycliuhw/fix/lp-1924280
jujubot Apr 19, 2021
b4e5f4c
Add GH action to enable CLA-checker for pull requests
achilleasa Apr 19, 2021
579f555
Remove codecov GH action
achilleasa Apr 19, 2021
c48a48a
Merge pull request #12891 from wallyworld/update-charm-v8
jujubot Apr 19, 2021
09b370a
Validate series/containers during deployment
SimonRichardson Apr 19, 2021
c6b29a3
CharmInfo CAAS vs IAAS tests
SimonRichardson Apr 19, 2021
baf95fd
Fix more unit/integration tests
SimonRichardson Apr 19, 2021
b9e3bf2
Fixing state migration import tests
SimonRichardson Apr 19, 2021
2976859
Merge pull request #12893 from achilleasa/2.9-add-cla-checker-gh-acti…
jujubot Apr 19, 2021
319d100
Fix the test typo
SimonRichardson Apr 19, 2021
16a006d
Fix the deployment of kubeflow-edge
SimonRichardson Apr 19, 2021
7c9c586
Change default charmhub API endpoint to the production one
achilleasa Apr 19, 2021
f2b4ec0
Merge pull request #12888 from SimonRichardson/validate-model-target
jujubot Apr 19, 2021
d37d4d9
Ensure metadata is correct for the model target
SimonRichardson Apr 16, 2021
1defb5d
Add tests for validating resource
SimonRichardson Apr 16, 2021
74d6879
Fix the error message
SimonRichardson Apr 19, 2021
1de602c
Fix test for error message
SimonRichardson Apr 19, 2021
7ae24ca
Merge pull request #12897 from achilleasa/2.9-use-production-ch-endpoint
jujubot Apr 19, 2021
b763122
Removes usage of systems package from CAAS application provisioner
manadart Apr 19, 2021
c64167e
go fmt
hmlanigan Apr 19, 2021
2780d24
fix ineffassign
hmlanigan Apr 19, 2021
40abe2f
removed unused charmMeta type
hmlanigan Apr 19, 2021
8696629
go mod tidy to remove systems
hmlanigan Apr 19, 2021
022a592
Merge pull request #12898 from manadart/2.9-remove-parsebasefromseries
jujubot Apr 19, 2021
582cf79
CAAS bundle deployments
SimonRichardson Apr 19, 2021
7fbfce0
When deploying a kubernetes bundle, ensure that the seriesSelector is
SimonRichardson Apr 19, 2021
b198106
Merge pull request #12887 from SimonRichardson/resource-validation-error
jujubot Apr 19, 2021
c8b049f
Add Format.
hmlanigan Apr 19, 2021
e2ff8e5
Add test for metadata v2 kubernetes AddApplication
hmlanigan Apr 19, 2021
c884215
Ensure that supportedSeries slice has kubernetes only once
hmlanigan Apr 19, 2021
4a799ce
bases no longer part of metadata, remove from test
hmlanigan Apr 19, 2021
8bf9d88
Bump up Pebble version to include user/group in list-files
benhoyt Apr 19, 2021
ea085aa
Use core charm.Format instead of local computations.
hmlanigan Apr 19, 2021
18d096b
Use gomock instead.
hmlanigan Apr 19, 2021
d0df34f
Merge pull request #12899 from SimonRichardson/caas-bundle-deployment
jujubot Apr 19, 2021
f4f432d
fix tests - Manifest called by Format in ComputedSeries
hmlanigan Apr 19, 2021
d25beb6
Merge pull request #12900 from benhoyt/update-pebble-5
jujubot Apr 19, 2021
1969af1
Merge pull request #12901 from hmlanigan/format
jujubot Apr 20, 2021
c5842ca
Add IsKubnernetes.
hmlanigan Apr 19, 2021
bbe2e28
Update ValidateModelTarget to use IsKubernetes from core charm.
hmlanigan Apr 19, 2021
2047da0
Use IsKubernetes instead of computing locally
hmlanigan Apr 19, 2021
f9527de
now using core charm and arch
hmlanigan Apr 19, 2021
f67714d
Display ... for really long k8s app versions in status
wallyworld Apr 20, 2021
6abe884
A couple of unit test fixes
wallyworld Apr 20, 2021
b418e58
Merge pull request #12903 from wallyworld/k8s-app-version
jujubot Apr 20, 2021
22a3f06
A couple of unit test fixes
wallyworld Apr 20, 2021
305a9f2
Merge pull request #12902 from hmlanigan/is-kubernetes
jujubot Apr 20, 2021
af7c3a7
Filter out more full registry paths for app version in status
wallyworld Apr 20, 2021
bac78f2
Merge pull request #12904 from wallyworld/k8s-app-version
jujubot Apr 20, 2021
777e45e
Fix k8s bundle deploys with v2 charms
wallyworld Apr 20, 2021
3fa7b06
Register resource-get for containeragent binary;
ycliuhw Apr 20, 2021
265d162
Ensure all k8s charms have 'kubernetes' as the series in status
wallyworld Apr 20, 2021
3abd2cf
Merge pull request #12905 from wallyworld/fix-k8s-bundles
jujubot Apr 20, 2021
f83fe7f
Increment juju to 2.9-rc12
jujubot Apr 20, 2021
d04be94
Merge pull request #12908 from jujubot/increment-to-2.9-rc12
wallyworld Apr 20, 2021
7ba01e7
Add test for RegisterForContainerAgent;
ycliuhw Apr 21, 2021
3b1d1e8
Merge pull request #12906 from ycliuhw/fix/lp-1922936
jujubot Apr 21, 2021
469eda5
Merge branch '2.9' into merge-2.9-20210421
wallyworld Apr 21, 2021
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
Prev Previous commit
Next Next commit
Fixed default disk provisioning type & added tests
  * Fixed the default disk provisioning type if the model does not
hold a valid option
  * Added tests
  • Loading branch information
gabriel-samfira committed Apr 1, 2021
commit be6120ca7913d3558ce40fe7536ee932fa520c90
33 changes: 21 additions & 12 deletions provider/vsphere/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,17 @@ func (c *environConfig) forceVMHardwareVersion() int64 {
func (c *environConfig) diskProvisioningType() vsphereclient.DiskProvisioningType {
provType, ok := c.attrs[cfgDiskProvisioningType]
if !ok {
return vsphereclient.DiskTypeThin
// Return the default in case none is set.
return vsphereclient.DefaultDiskProvisioningType
}
return vsphereclient.DiskProvisioningType(provType.(string))

provTypeStr, ok := provType.(string)
if !ok || provTypeStr == "" {
// We got an invalid value set, return default.
return vsphereclient.DefaultDiskProvisioningType
}

return vsphereclient.DiskProvisioningType(provTypeStr)
}

// validate checks vmware-specific config values.
Expand All @@ -141,22 +149,23 @@ func (c environConfig) validate() error {
}

if diskProvType, ok := c.attrs[cfgDiskProvisioningType]; ok {

diskProvTypeStr, ok := diskProvType.(string)
if !ok {
return errors.Errorf("%s must be a string", cfgDiskProvisioningType)
}

found := false
for _, val := range vsphereclient.ValidDiskProvisioningTypes {
if vsphereclient.DiskProvisioningType(diskProvTypeStr) == val {
found = true
break
if diskProvTypeStr != "" {
found := false
for _, val := range vsphereclient.ValidDiskProvisioningTypes {
if vsphereclient.DiskProvisioningType(diskProvTypeStr) == val {
found = true
break
}
}
if !found {
return errors.Errorf(
"%q must be one of %q", cfgDiskProvisioningType, vsphereclient.ValidDiskProvisioningTypes)
}
}
if !found {
return errors.Errorf(
"%q must be one of %q", cfgDiskProvisioningType, vsphereclient.ValidDiskProvisioningTypes)
}
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion provider/vsphere/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func fakeConfigAttrs(attrs ...testing.Attrs) testing.Attrs {
"external-network": "",
"enable-disk-uuid": true,
"force-vm-hardware-version": 0,
"disk-provisioning-type": "thin",
"disk-provisioning-type": "",
})
for _, attrs := range attrs {
merged = merged.Merge(attrs)
Expand Down
96 changes: 95 additions & 1 deletion provider/vsphere/environ_broker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (s *legacyEnvironBrokerSuite) TestStartInstance(c *gc.C) {
UpdateProgressInterval: 5 * time.Second,
EnableDiskUUID: true,
IsBootstrap: true,
DiskProvisioningType: vsphereclient.DiskTypeThin,
DiskProvisioningType: vsphereclient.DefaultDiskProvisioningType,
})

ovaLocation, ovaReadCloser, err := readOVA()
Expand Down Expand Up @@ -188,6 +188,100 @@ func (s *legacyEnvironBrokerSuite) TestStartInstanceNetwork(c *gc.C) {
c.Assert(createVMArgs.NetworkDevices[1].Network, gc.Equals, "bar")
}

func (s *legacyEnvironBrokerSuite) TestStartInstanceDiskProvisioningMissingModelConfigOption(c *gc.C) {
env, err := s.provider.Open(environs.OpenParams{
Cloud: fakeCloudSpec(),
Config: fakeConfig(c, coretesting.Attrs{
"image-metadata-url": s.imageServer.URL,
}),
})
c.Assert(err, jc.ErrorIsNil)

result, err := env.StartInstance(s.callCtx, s.createStartInstanceArgs(c))
c.Assert(err, jc.ErrorIsNil)
c.Assert(result, gc.NotNil)

call := s.client.Calls()[4]
createVMArgs := call.Args[1].(vsphereclient.CreateVirtualMachineParams)
c.Assert(createVMArgs.DiskProvisioningType, gc.Equals, vsphereclient.DefaultDiskProvisioningType)
}

func (s *legacyEnvironBrokerSuite) TestStartInstanceDiskProvisioningDefaultOption(c *gc.C) {
env, err := s.provider.Open(environs.OpenParams{
Cloud: fakeCloudSpec(),
Config: fakeConfig(c, coretesting.Attrs{
"image-metadata-url": s.imageServer.URL,
"disk-provisioning-type": "",
}),
})
c.Assert(err, jc.ErrorIsNil)

result, err := env.StartInstance(s.callCtx, s.createStartInstanceArgs(c))
c.Assert(err, jc.ErrorIsNil)
c.Assert(result, gc.NotNil)

call := s.client.Calls()[4]
createVMArgs := call.Args[1].(vsphereclient.CreateVirtualMachineParams)
c.Assert(createVMArgs.DiskProvisioningType, gc.Equals, vsphereclient.DefaultDiskProvisioningType)
}

func (s *legacyEnvironBrokerSuite) TestStartInstanceDiskProvisioningThinDisk(c *gc.C) {
env, err := s.provider.Open(environs.OpenParams{
Cloud: fakeCloudSpec(),
Config: fakeConfig(c, coretesting.Attrs{
"image-metadata-url": s.imageServer.URL,
"disk-provisioning-type": "thin",
}),
})
c.Assert(err, jc.ErrorIsNil)

result, err := env.StartInstance(s.callCtx, s.createStartInstanceArgs(c))
c.Assert(err, jc.ErrorIsNil)
c.Assert(result, gc.NotNil)

call := s.client.Calls()[4]
createVMArgs := call.Args[1].(vsphereclient.CreateVirtualMachineParams)
c.Assert(createVMArgs.DiskProvisioningType, gc.Equals, vsphereclient.DiskTypeThin)
}

func (s *legacyEnvironBrokerSuite) TestStartInstanceDiskProvisioningThickDisk(c *gc.C) {
env, err := s.provider.Open(environs.OpenParams{
Cloud: fakeCloudSpec(),
Config: fakeConfig(c, coretesting.Attrs{
"image-metadata-url": s.imageServer.URL,
"disk-provisioning-type": "thick",
}),
})
c.Assert(err, jc.ErrorIsNil)

result, err := env.StartInstance(s.callCtx, s.createStartInstanceArgs(c))
c.Assert(err, jc.ErrorIsNil)
c.Assert(result, gc.NotNil)

call := s.client.Calls()[4]
createVMArgs := call.Args[1].(vsphereclient.CreateVirtualMachineParams)
c.Assert(createVMArgs.DiskProvisioningType, gc.Equals, vsphereclient.DiskTypeThick)
}

func (s *legacyEnvironBrokerSuite) TestStartInstanceDiskProvisioningThickEagerZeroDisk(c *gc.C) {
env, err := s.provider.Open(environs.OpenParams{
Cloud: fakeCloudSpec(),
Config: fakeConfig(c, coretesting.Attrs{
"image-metadata-url": s.imageServer.URL,
"disk-provisioning-type": "thickEagerZero",
}),
})
c.Assert(err, jc.ErrorIsNil)

result, err := env.StartInstance(s.callCtx, s.createStartInstanceArgs(c))
c.Assert(err, jc.ErrorIsNil)
c.Assert(result, gc.NotNil)

call := s.client.Calls()[4]
createVMArgs := call.Args[1].(vsphereclient.CreateVirtualMachineParams)
c.Assert(createVMArgs.DiskProvisioningType, gc.Equals, vsphereclient.DiskTypeThickEagerZero)
}

func (s *legacyEnvironBrokerSuite) TestStartInstanceLongModelName(c *gc.C) {
env, err := s.provider.Open(environs.OpenParams{
Cloud: fakeCloudSpec(),
Expand Down
5 changes: 4 additions & 1 deletion provider/vsphere/internal/vsphereclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const (
// DiskTypeThickEagerZero sets the provisioning type for disks to
// "thick eager zeroed". The entire size of the virtual disk will be
// deducted from the underlying datastore. Any unwritten disk areas
// will be zeroed out during cloning. This is the default setting.
// will be zeroed out during cloning.
DiskTypeThickEagerZero DiskProvisioningType = "thickEagerZero"
)

Expand All @@ -63,6 +63,9 @@ var (
DiskTypeThick,
DiskTypeThickEagerZero,
}
// DefaultDiskProvisioningType is the default disk provisioning type
// if none is selected in the model config.
DefaultDiskProvisioningType = DiskTypeThickEagerZero
)

// ErrExtendDisk is returned if we timed out trying to extend the root
Expand Down
6 changes: 3 additions & 3 deletions provider/vsphere/internal/vsphereclient/createvm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,12 @@ func (s *clientSuite) TestCreateVirtualMachineForceHWVersion(c *gc.C) {
_, err := client.CreateVirtualMachine(context.Background(), args)
c.Assert(err, jc.ErrorIsNil)

s.roundTripper.CheckCall(c, 41, "RetrieveProperties", "FakeVm1")
s.roundTripper.CheckCall(c, 42, "QueryConfigOption", "FakeEnvironmentBrowser")
s.roundTripper.CheckCall(c, 42, "RetrieveProperties", "FakeVm1")
s.roundTripper.CheckCall(c, 43, "QueryConfigOption", "FakeEnvironmentBrowser")
// Mock server max version is vmx-13
// Mock template VM version is vmx-10
// We requested vmx-11. This should match the call to UpgradeVM_Task.
s.roundTripper.CheckCall(c, 43, "UpgradeVM_Task", "vmx-11")
s.roundTripper.CheckCall(c, 44, "UpgradeVM_Task", "vmx-11")
}

func (s *clientSuite) TestCreateVirtualMachineNoDiskUUID(c *gc.C) {
Expand Down