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

Stable 5.0 backports #12319

Merged
merged 543 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
543 commits
Select commit Hold shift + click to select a range
10ab5df
lxd/client: Add `GetNetworkAllocations` function
gabrielmougard Jun 15, 2023
c170755
lxd: Implement `networkAllocationsGet` API endpoint
gabrielmougard Jun 15, 2023
865565b
lxc: Add `network list-allocations` command
gabrielmougard Jun 15, 2023
f04c9bb
test: Display IPAM information and check it is correct
gabrielmougard Jul 18, 2023
e969244
doc: generate rest-api.yaml
gabrielmougard Jul 13, 2023
02e8236
doc: Add IPAM howto section
gabrielmougard Jul 17, 2023
b5f1389
doc/clustering: update MicroCloud information
ru-fu Jul 19, 2023
e7778ca
lxc/volume: Fix docstrings to clarify volume operations
roosterfish Jul 18, 2023
2993e05
doc/lxd-migrate: add an example for importing to a VM
ru-fu Jul 18, 2023
deed84c
lxd/instance/drivers/driver/lxc: make limits.memory.swap work properly
mihalicyn Jul 19, 2023
7bce8e2
inclusive identities
eslerm Jul 19, 2023
8d09885
lxd/db: Return nodeID in GetStoragePoolVolumeWithID
monstermunchkin Jul 19, 2023
740946e
lxd/db: Add function to get expired storage volume backups
monstermunchkin Jul 17, 2023
1052ec8
lxd: Add hourly job pruning expired storage volume backups
monstermunchkin Jul 17, 2023
702ca4e
operationtype: Change description of BackupsExpire
monstermunchkin Jul 18, 2023
30cd60b
test: Check backup volume expiry
monstermunchkin Jul 18, 2023
e81368a
lxd/network/allocations: Handle networks that don't implement the Lea…
tomponline Jul 20, 2023
96cc410
lxd/network/allocations: Renames getDefaultCIDRAddr to ipToCIDR for c…
tomponline Jul 20, 2023
5528f8f
lxd/network/allocations: Use better wrapped errors in networkAllocati…
tomponline Jul 20, 2023
7a33ebf
test: Fix integration tests to support network allocation listing wit…
gabrielmougard Jul 20, 2023
02852b2
shared/api/network/addresses: Reworks NetworkAllocations struct to al…
tomponline Jul 21, 2023
8b09616
lxd/network/allocations: Fixes networkAllocationsGet NAT output
tomponline Jul 21, 2023
adb321b
lxc/network-allocations: Output a tabular format instead of JSON format
gabrielmougard Jul 20, 2023
c51762e
doc/rest-api: Refresh swagger YAML
tomponline Jul 21, 2023
ecd3ed4
doc: Update `lxc network list-allocations` output format
gabrielmougard Jul 21, 2023
dfc6504
lxd/client: Mark HasExtension as deprecated
roosterfish Jul 21, 2023
fb35c7d
lxd/storage/drivers/zfs: Allow volume snapshot refresh
roosterfish Jul 20, 2023
a287907
api: Add storage_api_remote_volume_snapshot_copy extension
roosterfish Jul 21, 2023
a5a0c95
lxd/shared/api: Extend StorageVolumeSnapshotPost for remote copy
roosterfish Jul 19, 2023
cfc9fdf
rest-api: Extend StorageVolumeSnapshotPost for remote copy
roosterfish Jul 20, 2023
f410e74
lxc/volume: Use the right path when copying volume snapshots
roosterfish Jul 19, 2023
6bce2d0
lxc/volume: Check for storage_api_remote_volume_snapshot_copy extension
roosterfish Jul 21, 2023
b597690
lxd/api/storage: Add support to copy volume snapshots between remotes
roosterfish Jul 19, 2023
fc8ed97
lxc/volume: Block --volume-only flag when copying volume snapshots
roosterfish Jul 19, 2023
5fe6333
tests: Check various volume snapshot copy operations
roosterfish Jul 19, 2023
33df4b6
tests: Check various volume snapshot remote copy operations
roosterfish Jul 19, 2023
72055e6
test: Fix test_container_devices_disk_ceph tests
tomponline Sep 22, 2023
867b51d
i18n: Update translation templates
tomponline Sep 22, 2023
1f5fea0
doc: add a link to Ubuntu Discourse
ru-fu Jul 24, 2023
3594530
lxc/utils: Support parsing of anonymous nested structs
gabrielmougard Jul 24, 2023
f1b6847
test: Add get timestamp property test with instance snapshot
gabrielmougard Jul 24, 2023
4cce53e
shared/proxy: allow SOCKS5 proxy
montag451 Jul 21, 2023
0683986
lxd/device/disk: Fix boot from Windows ISO by setting correct FSType …
tomponline Jul 25, 2023
5399b70
lxd/storage/drivers/volume: Use vol.IsBlockBacked() in ConfigSize
tomponline Jul 25, 2023
870c0f9
lxd/storage/utils: Use vol.IsBlockBacked in ImageUnpack
tomponline Jul 25, 2023
f105370
lxd/storage/backend/lxd: ImageUnpack usage
tomponline Jul 25, 2023
c88c23e
lxd/storage/backend/lxd: Use the result of FillVolumeConfig in Ensure…
tomponline Jul 25, 2023
09f3872
lxd/storage/drivers/driver/zfs/volumes: Don't populate block volume s…
tomponline Jul 25, 2023
cabad25
lxd/storage/backend/lxd: Removes unused poolBlockFilesystem function
tomponline Jul 25, 2023
0748586
lxd/backup/backup_config_utils: Change helper function to update mult…
MusicDin Jul 26, 2023
b304bcb
lxd/storage/backend: Update instance backup file on instance import
MusicDin Jul 26, 2023
fbb3e25
test/suites/backup.sh: Add test for backup export, import, and recovery
MusicDin Jul 26, 2023
546ff75
test/main.sh: Reference test for imported instance recovery
MusicDin Jul 26, 2023
6a0b43b
lxc/init: Remove project query parameter from instance name
MusicDin Jul 26, 2023
669315c
lxd/storage/drivers/zfs: Tweak getDatasets
stgraber Jul 20, 2023
bd438af
lxd/storage/drivers/zfs: Clarify comment
stgraber Jul 26, 2023
2ea2a4b
lxd/storage/drivers/ceph: Fix typo in comment
stgraber Jul 19, 2023
ce7b856
lxd/storage/zfs: Don't strip leading slash on snapshots
stgraber Jul 19, 2023
dae1ad2
lxd/storage/drivers: Handle newer losetup
stgraber Jul 20, 2023
0b0ee5f
lxd/storage/pool_interface: Add PostHooks to MountInfo
stgraber Jul 26, 2023
3b7f882
lxd/storage: Add MountInfo to MountCustomVolume
stgraber Jul 26, 2023
2c3c133
lxd: Update for MountCustomVolume change
stgraber Jul 26, 2023
5975557
lxd/device/disk: Update for MountCustomVolume change
stgraber Jul 26, 2023
23d2878
lxd/instance/lxc: Update for MountInfo change
stgraber Jul 26, 2023
3acd275
api: zfs_delegate
stgraber Jul 19, 2023
d97d1ef
scripts: Add `zfs.delegate` to bash completion
stgraber Jul 19, 2023
1aeb78b
lxd/storage/drivers/zfs: Detect support for delegation
stgraber Jul 19, 2023
d21e5d8
lxd/storage/drivers/zfs: Add `zfs.delegate`
stgraber Jul 19, 2023
2a17749
lxd/storage/drivers/zfs: Implement recursion
stgraber Jul 19, 2023
2d3904f
lxd/instance/lxc: Add /dev/zfs when delegation is supported
stgraber Jul 19, 2023
5f37c14
lxd/storage/drivers: Add DelegateVolume and CanDelegateVolume
stgraber Jul 19, 2023
dd8ecdd
lxd/storage: Add DelegateVolume to PostHooks
stgraber Jul 26, 2023
14db2ba
tests: Add basic ZFS delegation test
stgraber Jul 20, 2023
f74766c
test/suites/clustering: Add test case for storage config on create vs…
masnax Jul 20, 2023
60752d7
lxd/instance/lxc: Restrict /dev/zfs to unprivileged containers
stgraber Jul 27, 2023
0174472
doc/installing: update link to tutorial on Discourse
ru-fu Jul 27, 2023
fea58ce
doc/cluster: add an example for a ZFS storage pool to preseed
ru-fu Jul 27, 2023
bf36010
lxd/device/device/utils/disk: Look for virtiofsd in /usr/lib/
libricoleur Jul 28, 2023
c1b71c2
SECURITY.md: update the security policy
ru-fu Jul 31, 2023
5a2b21f
lxd/networks: Don't filter config on project owned networks
stgraber Jul 31, 2023
e93fb92
test/suites/config.sh: LXC 2.0 is EOL
simondeziel Jul 31, 2023
148dd61
test/suites/kernel_limits.sh: LXC 2.0 is EOL
simondeziel Jul 31, 2023
0c79c04
test/suites/console.sh: LXC 3.0 is EOL
simondeziel Jul 31, 2023
c6e164e
test/suites/storage_driver_zfs.sh: be extra careful when parsing zfs …
simondeziel Jul 31, 2023
bc2a226
test: Improve skip message
tomponline Jul 28, 2023
e6c4f2c
lxd: Move rbac package to auth
monstermunchkin Jul 19, 2023
bb13ed8
lxd/auth: Add Authorizer interface
monstermunchkin Jul 19, 2023
e3f2380
auth: Add common authorization driver
monstermunchkin Aug 1, 2023
bcf70c8
auth: Add tls authorizer
monstermunchkin Jul 31, 2023
da8695f
lxd: Add Authorizer to daemon
monstermunchkin Jul 20, 2023
d07175c
state: Add Authorizer to state
monstermunchkin Jul 20, 2023
a198361
rbac: Make rbac use the new Authorizer interface
monstermunchkin Jul 28, 2023
1102c1a
Use Authorizer interface across the code base
monstermunchkin Jul 28, 2023
b1b56d8
lxd: Stop status check if RBAC is disabled
monstermunchkin Aug 1, 2023
14b216d
shared/simplestreams: avoid out of bound array access in GetFiles()
simondeziel Jun 27, 2023
e4ef969
lxd/util/kernel: avoid out of bound array access in HugepagesPath()
simondeziel Jun 27, 2023
b571737
lxd-agent/metrics: avoid out of bound array access in getCPUMetrics()
simondeziel Jun 27, 2023
b709718
lxd-agent/metrics: avoid out of bound array access in getDiskMetrics()
simondeziel Aug 1, 2023
b23d42c
lxd-agent/metrics: avoid out of bound array access in getFilesystemMe…
simondeziel Aug 1, 2023
6512e95
lxd-agent/metrics: avoid out of bound array access in getMemoryMetrics()
simondeziel Aug 1, 2023
45ba201
doc: Update IPAM cli output to use documentation-specific IP addresses
gabrielmougard Jul 21, 2023
77976ff
client/simplestreams_images: avoid out of bound array access in GetIm…
simondeziel Aug 1, 2023
39c7809
auth/rbac: Fix uninitialized permission lock
monstermunchkin Aug 2, 2023
6b802f2
rbac: Validate API URL
monstermunchkin Aug 2, 2023
e4f6528
lxd: Pass RBAC agent username to authorizer
monstermunchkin Aug 2, 2023
7039210
rbac: Mention config keys on validation error
monstermunchkin Aug 2, 2023
8848ab2
doc: Remove DNS subheading.
markylaing Aug 2, 2023
010e578
rbac: Use correct function to get projects
monstermunchkin Aug 2, 2023
5d1a45f
Change RaftSpare node to RaftVoter
Jul 18, 2023
bf65602
doc: Add a how to for routed nic devices on VMs.
markylaing Aug 2, 2023
e949156
doc: Link to the VM routed nic how-to from the device reference.
markylaing Aug 2, 2023
ba5c94a
Update .deepsource.toml
monstermunchkin Aug 4, 2023
fab4e65
static-analysis: Fix shellcheck 0.9.x complaints
monstermunchkin Aug 4, 2023
42caae6
test/includes/lxc: avoid printing LXC_LOCAL=1 lxc_remote ...
simondeziel Aug 4, 2023
53a2fca
test/includes/lxc: avoid printing the eval line in DEBUG
simondeziel Aug 4, 2023
1eca2a2
lxd/endpoints_exported_test: s/sss/ss/
simondeziel Aug 7, 2023
c0302f9
lxd/endpoints/network: s/sss/ss/
simondeziel Aug 7, 2023
3aa95b5
lxd/endpoints/pprof: s/sss/ss/
simondeziel Aug 7, 2023
567de4a
lxd/networks: s/sss/ss/
simondeziel Aug 7, 2023
a20964c
shared/validate: s/sss/ss/
simondeziel Aug 7, 2023
c30300d
test/basic: s/sss/ss/
simondeziel Aug 7, 2023
8a9b606
lxd/device/nic_macvlan: s/suppprt/support/
simondeziel Aug 7, 2023
e732e90
lxd/device/nic_macvlan: s/suppprt/support/
simondeziel Aug 7, 2023
5a06125
lxd/storage/drivers/driver_dir_utils: s/ppp/pp/
simondeziel Aug 7, 2023
38f2126
lxd/util/http: s/fff/ff/
simondeziel Aug 7, 2023
36d3616
lxd/network/bridge: s/dbUpdateNeeeded/dbUpdateNeeded/
simondeziel Aug 7, 2023
992c669
lxd/network/macvlan: s/dbUpdateNeeeded/dbUpdateNeeded/
simondeziel Aug 7, 2023
f8d8912
lxd/network/ovn: s/dbUpdateNeeeded/dbUpdateNeeded/
simondeziel Aug 7, 2023
790d120
lxd/network/physical: s/dbUpdateNeeeded/dbUpdateNeeded/
simondeziel Aug 7, 2023
563a426
lxd/network/sriov: s/dbUpdateNeeeded/dbUpdateNeeded/
simondeziel Aug 7, 2023
b11c740
lxd/api_internal_recover: s/neeed/need/
simondeziel Aug 7, 2023
1e334cd
lxd/firewall/nftables: s/adddress/address
simondeziel Aug 7, 2023
d71b5cd
shared/util: fix RandomCryptoString()'s description
simondeziel Aug 9, 2023
f9c9312
shared/util: fix JoinTokenDecode()'s description
simondeziel Aug 9, 2023
a5dec2e
lxd/api_internal_recover: Recover database entry for empty storage pools
MusicDin Aug 1, 2023
8f1554b
lxd/main_recover: Allow recovery of empty storage pools
MusicDin Aug 1, 2023
a98f4a3
test/suites/backup.sh: Update expected no-op recovery output
MusicDin Aug 2, 2023
5c151b8
doc: Clarify scope of nexthop config keys in BGP extension
roosterfish Aug 10, 2023
2d22109
doc/api-extensions: fix extension name for VM support
simondeziel Aug 10, 2023
02683a2
client/lxd_server: use StringInSlice() in HasExtension()
simondeziel Aug 10, 2023
9ab6032
lxc/copy: replace strings.Contains() and .SplitN() by strings.Cut()
simondeziel Aug 10, 2023
16b314c
lxc/init: replace strings.Contains() and .SplitN() by strings.Cut()
simondeziel Aug 10, 2023
55fdfcc
lxc/project: replace strings.Contains() and .SplitN() by strings.Cut()
simondeziel Aug 10, 2023
45d3fe8
lxd-migrate: replace strings.SplitN() by strings.Cut()
simondeziel Aug 10, 2023
de8777c
api/instance: Fix instance movement node selection
roosterfish Aug 11, 2023
8fd9dad
lxd/network: fix bgp.ipv*.nexthop keys not being recognized
mandrav Aug 11, 2023
ceb6672
doc: Align header of macaroon_authentication
monstermunchkin Aug 13, 2023
b3ba4dc
test/migration: Check instance node when moving within cluster group
roosterfish Aug 11, 2023
399c819
fix: helper message typo
0o001 Aug 20, 2023
4e52aae
shared/termios: Use golang.org/x/term instead of golang.org/x/crypto/…
ucpr Aug 11, 2023
1bb4ab0
gomod: Tidy
tomponline Sep 25, 2023
4d2063d
lxd/api_cluster: document `cluster` options
gabrielmougard Jul 21, 2023
3777b06
shared/instance: document instance `miscellaneous` options
gabrielmougard Jul 21, 2023
670f222
shared/instance: document instance `boot-related` options
gabrielmougard Jul 19, 2023
892d6fd
shared/instance: document instance `cloud-init` options
gabrielmougard Jul 20, 2023
04b284e
shared/instance: document instance `limit` options
gabrielmougard Jul 20, 2023
4e6dd85
shared/instance: document instance `nvidia` options
gabrielmougard Jul 21, 2023
f1b4619
shared/instance: document instance `raw` options
gabrielmougard Jul 21, 2023
c38e0db
shared/instance: document instance `snapshots` options
gabrielmougard Jul 21, 2023
6e33f22
doc/cluster: review config option documentation
ru-fu Aug 1, 2023
d428ac6
doc/css: add an orange color to the doc styling
ru-fu Aug 8, 2023
4cb9c14
doc: update link to distrobuilder docs
ru-fu Aug 22, 2023
b624396
lxd/devices: adjust network device hotplug check
mihalicyn Aug 2, 2023
0083904
lxd/instance/drivers/driver_lxc: wait for container to start before s…
mihalicyn Aug 10, 2023
37d0741
api: add operations_get_query_all_projects extension
AuruTus Jul 27, 2023
8b2cef0
lxd/db: add support for getting nodes without project name
AuruTus Jul 26, 2023
7523892
lxd: add all-projects param for operationsGet
AuruTus Jul 26, 2023
71e5a41
lxd: add param swagger doc for operationsGet
AuruTus Jul 26, 2023
3d3cb7e
doc/rest-api: Refresh swagger YAML
AuruTus Jul 26, 2023
338d8be
client: add GetOperationsAllProjects
AuruTus Jul 28, 2023
f9316af
tests: add standalone test cases for operations_get
AuruTus Aug 2, 2023
d6e0ad7
lxd/device/nic_bridgeed: Allow migration if nic parent is managed net…
MusicDin Aug 23, 2023
9a56ce2
lxd/instance/drivers/driver_common: Log warnings when auto-migration …
MusicDin Aug 23, 2023
7c04088
i18n: Update translation templates
tomponline Sep 25, 2023
90ca68c
lxd/auth/rbac: Fix regression
stgraber Aug 25, 2023
afb8d64
lxd/storage/zfs: Fix version handling
stgraber Aug 25, 2023
ef4f0a4
shared/version: Show parsed version on failure
stgraber Aug 25, 2023
06256b1
lxc: Un-hide `lxc pause` command
monstermunchkin Aug 30, 2023
76b478c
lxc: Un-hide `lxc init` command
monstermunchkin Aug 30, 2023
306579d
lxc: Un-hide `lxc monitor` command
monstermunchkin Aug 30, 2023
a5e9d4a
lxc: Un-hide `lxc query` command
monstermunchkin Aug 30, 2023
2b9832e
scripts/bash/lxd-client: fix completion to work for non-default projects
simondeziel Aug 30, 2023
67c8855
scripts/bash/lxd-client: use parentheses around grep -E alternations
simondeziel Aug 30, 2023
cfed2fe
scripts/bash/lxd-client: don't propose "(current)" as valid project
simondeziel Aug 30, 2023
9301e3b
doc: add guide about virt-v2v
mihalicyn Aug 28, 2023
fa575ec
lxd: Use instance lock when updating instance
monstermunchkin Aug 30, 2023
f4ef23f
shared/util: use LC_ALL instead of LANG in RunCommandCLocale()
simondeziel Aug 31, 2023
33e7e4b
lxd/resources: Use `lshw` if DMI is not available
monstermunchkin Sep 1, 2023
b365672
lxd/config: Add ubuntu-minimal and ubuntu-minimal-daily remotes
MusicDin Sep 4, 2023
59ba134
zfs: Disallow block.* settings for regular custom block volumes
monstermunchkin Sep 1, 2023
652c02f
test: Check that custom block volumes cannot set block.*
monstermunchkin Sep 1, 2023
ed5bfe4
doc: Updates routed nic how-to to use pass netplan config via stdin.
markylaing Sep 1, 2023
afa598a
lxd/resources: Use RunCommandCLocale when calling `lshw`
monstermunchkin Sep 5, 2023
d319dfe
drivers: Use StatusError to ensure error code consistency
monstermunchkin Sep 5, 2023
050fcf4
instance_exec: Add contraint validation
monstermunchkin Sep 5, 2023
b9269e1
lxd/cgroup/abstraction: skip loop devices from cgroup2's io.stat
simondeziel Sep 2, 2023
b9a84c9
lxd/cgroup/abstraction: skip loop devices from cgroup1's blkio.thrott…
simondeziel Sep 2, 2023
6abde64
doc/zfs: remove limitation
ru-fu Sep 6, 2023
0e7c767
btrfs: Mention detected FS on detection error
monstermunchkin Sep 7, 2023
9422516
lxd/device/disk: Refactor CanHotPlug
tomponline Sep 7, 2023
468182a
lxd/device/disk: Check that filesytem disks being attached to VMs hav…
tomponline Sep 7, 2023
283e583
lxd/device/disk: Removes unused sourceIsDir function
tomponline Sep 7, 2023
8841ebc
storage/drivers/ceph: Differentiate between a true non-existent OSD p…
gabrielmougard Sep 7, 2023
0773b4f
shared/cmd/ask: Add Asker type with CLI helpers as methods
masnax Sep 12, 2023
45b8323
lxd: Setup global Asker for lxd commands
masnax Sep 12, 2023
8671753
lxc: Setup global Asker for lxc commands
masnax Sep 12, 2023
8878350
lxd-migrate: Setup global Asker for lxd-migrate commands
masnax Sep 12, 2023
3f80690
doc/zfs: document that some features require ZFS 2.2
ru-fu Sep 12, 2023
a0891be
lxd-agent: Skip when already mounted
stgraber Sep 9, 2023
98df490
lxd/instance/qemu: Fix bootorder when using -kernel
stgraber Sep 9, 2023
366fb86
github: Adds CODEOWNERS file
tomponline Sep 13, 2023
4d7865f
lxd/apparmor/instance/qemu: Allow /etc/machine-id
stgraber Sep 12, 2023
69ccdbe
lxd/instance/qemu: Avoid old -bios syntax
stgraber Sep 12, 2023
d1c5e4d
test/backends/ceph: lower OSD pg_num to 8
simondeziel Sep 13, 2023
8021621
lxd/network/openvswitch/ovn: Add function to retrieve all logical swi…
MusicDin Sep 11, 2023
fb970e5
lxd/network/driver_ovn: Fix OVN leases not showing static ips
MusicDin Sep 11, 2023
80d6481
lxd/device/nic_ovn: Use all allocated IPs as dynamic when static IP i…
MusicDin Sep 11, 2023
765e752
lxd/network/driver_ovn: Remove redundant InstanceDevicePortDynamicIPs…
MusicDin Sep 11, 2023
00b0fbf
lxd-agent: Validate fields only for CPU info
monstermunchkin Sep 15, 2023
232ec8a
lxd/storage/drivers/btrfs: Use command instead of walking dir to get …
takonomura Sep 15, 2023
b64ffa7
lxd/auth: Exit goroutine if RBAC has been disabled
monstermunchkin Sep 15, 2023
e2adb60
shared/simplestreams/products: Adds support for incus.tar.xz items
tomponline Sep 15, 2023
ffb2f8b
shared/validate: names starting with a digit are valid
simondeziel Sep 15, 2023
c37fd3b
test/basic: 12test is now a valid instance name
simondeziel Sep 15, 2023
40f0f29
test/basic: test invalid instance name with a period
simondeziel Sep 15, 2023
b2341a1
lxd: Revert server config if it cannot be set
monstermunchkin Sep 6, 2023
75dc82f
lxd/device/device/utils/network: Improve error handling and messaging…
tomponline Sep 18, 2023
c1da83f
test/network: test DNS resolution of instance names
simondeziel Sep 16, 2023
894c7c6
lxd: Return http 429 on repeated shutdowns
masnax Sep 18, 2023
efb10c5
lxd: Fix type field formatting
masnax Sep 18, 2023
44b8e7a
lxd/storage/drivers/driver_zfs_volumes: Disallow setting zfs.block_mo…
MusicDin Sep 18, 2023
18c5e56
lxd/main/forknet: Remove altname if preventing rename of NIC interface
tomponline Sep 19, 2023
4194209
lxc/operation.go: Add missing flag all-projects for command operation…
MusicDin Sep 20, 2023
ac02771
patches: Don't fail if no storage pools were found
monstermunchkin Sep 21, 2023
1a81e01
shared/simplestreams/products: Fix regression in lxd_combined.tar.gz …
tomponline Sep 21, 2023
66d55cb
client: check API extension for `instances_rebuild`
gabrielmougard Sep 22, 2023
388d058
doc: add link to Windows VM tutorial
ru-fu Sep 22, 2023
0aa0834
i18n: Update translation templates
tomponline Sep 26, 2023
d7eb437
test/main: Don't clean up if run inside Github
tomponline Sep 26, 2023
a09afb1
test/suites/storage_driver_cephfs: Sync with main
tomponline Sep 26, 2023
fd50829
test/suites/container_devices_nic_bridged: Check for known firewall d…
tomponline Sep 26, 2023
f7d72bc
test: Backports test_clustering_update_cert_reversion
tomponline Sep 26, 2023
f474fec
shared/api/event: Adds EventTypeOVN
tomponline Sep 26, 2023
e636111
shared/api/event: Adds fields from event_lifecycle_name_and_project
tomponline Sep 26, 2023
f1ac27c
shared/api/resource: Adds types from ovn_nic_acceleration_vdpa
tomponline Sep 26, 2023
ed2f3b6
client: Adds oidc support
tomponline Sep 26, 2023
eb481b2
gomod: Add oidc dependencies
tomponline Sep 26, 2023
cb493ea
lxd/storage/drivers: Keep sync with main
tomponline Sep 26, 2023
83ccd85
doc/rest-api: Refresh swagger YAML
tomponline Sep 26, 2023
5d097c8
test/godeps: Updates list for oidc
tomponline Sep 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .deepsource.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ name = "go"
enabled = true

[analyzers.meta]
import_paths = ["github.com/lxd/lxd"]
import_paths = ["github.com/canonical/lxd"]
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @tomponline
1 change: 0 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ API:
- shared/api/**/*
Documentation:
- doc/**/*
- .sphinx/**/*
80 changes: 56 additions & 24 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@ concurrency:

jobs:
code-tests:
env:
CGO_CFLAGS: "-I/home/runner/work/lxd/lxd-test/vendor/raft/include/ -I/home/runner/work/lxd/lxd-test/vendor/dqlite/include/"
CGO_LDFLAGS: "-L/home/runner/work/lxd/lxd-test/vendor/raft/.libs/ -L/home/runner/work/lxd/lxd-test/vendor/dqlite/.libs/"
LD_LIBRARY_PATH: "/home/runner/work/lxd/lxd-test/vendor/raft/.libs/:/home/runner/work/lxd/lxd-test/vendor/dqlite/.libs/"
CGO_LDFLAGS_ALLOW: "(-Wl,-wrap,pthread_create)|(-Wl,-z,now)"
name: Code tests
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Dependency Review
uses: actions/dependency-review-action@v3
Expand All @@ -30,35 +35,47 @@ jobs:
- name: Install dependencies
run: |
sudo add-apt-repository ppa:ubuntu-lxc/lxc-git-master -y --no-update
sudo add-apt-repository ppa:dqlite/dev -y --no-update
sudo apt-get update

sudo apt-get install --no-install-recommends -y \
build-essential \
curl \
gettext \
git \
libacl1-dev \
libcap-dev \
libdbus-1-dev \
libdqlite-dev \
liblxc-dev \
lxc-templates \
libseccomp-dev \
libselinux-dev \
libsqlite3-dev \
libtool \
libudev-dev \
libuv1-dev \
make \
pkg-config \
shellcheck

python3 -m pip install flake8
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.46.2

- name: Download go dependencies
run: |
go mod download

- name: Make LXD tarball and unpack it
env:
CUSTOM_VERSION: "test"
run: |
make dist
tar -xzf lxd-test.tar.gz -C ~/work/lxd/
rm lxd-test.tar.gz

- name: Build LXD dependencies
run: |
cd ~/work/lxd/lxd-test
make deps

- name: Run LXD build
run: |
make
Expand All @@ -69,14 +86,15 @@ jobs:

- name: Unit tests (all)
run: |
sudo go test ./...
sudo --preserve-env=CGO_CFLAGS,CGO_LDFLAGS,CGO_LDFLAGS_ALLOW,LD_LIBRARY_PATH LD_LIBRARY_PATH=${LD_LIBRARY_PATH} go test ./...

system-tests:
env:
CGO_LDFLAGS_ALLOW: "(-Wl,-wrap,pthread_create)|(-Wl,-z,now)"
LXD_SHIFTFS_DISABLE: "true"
LXD_CEPH_CLUSTER: "ceph"
LXD_CEPH_CEPHFS: "cephfs"
LXD_CONCURRENT: "1"
LXD_VERBOSE: "1"
LXD_OFFLINE: "1"
LXD_TMPFS: "1"
Expand Down Expand Up @@ -104,7 +122,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Go (stable)
uses: actions/setup-go@v4
Expand All @@ -114,7 +132,7 @@ jobs:

- name: Install Go (tip)
run: |
curl -sL https://storage.googleapis.com/go-build-snap/go/linux-amd64/$(git ls-remote https://github.com/golang/go.git HEAD | awk '{print $1;}').tar.gz -o gotip.tar.gz
curl -sSfL https://storage.googleapis.com/go-build-snap/go/linux-amd64/$(git ls-remote https://github.com/golang/go.git HEAD | awk '{print $1;}').tar.gz -o gotip.tar.gz
ls -lah gotip.tar.gz
mkdir -p ~/sdk/gotip
tar -C ~/sdk/gotip -xzf gotip.tar.gz
Expand All @@ -130,13 +148,16 @@ jobs:
sudo apt-get update

sudo snap remove lxd --purge
sudo snap remove core20 --purge || true
sudo apt-get autopurge moby-containerd docker uidmap -y
sudo ip link delete docker0
sudo nft flush ruleset

sudo systemctl mask lxc.service
sudo systemctl mask lxc-net.service

sudo apt-get install --no-install-recommends -y \
curl \
dnsutils \
git \
libacl1-dev \
libcap-dev \
Expand All @@ -156,8 +177,10 @@ jobs:
btrfs-progs \
busybox-static \
dnsmasq-base \
easy-rsa \
gettext \
jq \
lxc-utils \
lvm2 \
nftables \
quota \
Expand All @@ -173,6 +196,10 @@ jobs:
xfsprogs \
xz-utils \
zfsutils-linux

# reclaim some space
sudo apt-get clean

mkdir -p "$(go env GOPATH)/bin"

- name: Download go dependencies
Expand All @@ -187,7 +214,18 @@ jobs:
if: ${{ matrix.backend == 'ceph' }}
run: |
set -x
sudo apt-get install --no-install-recommends -y snapd ceph-common

# If the rootfs and the ephemeral part are on the same physical disk, giving the whole
# disk to microceph would wipe our rootfs. Since it is pretty rare for GitHub Action
# runners to have a single disk, we immediately bail rather than trying to gracefully
# handle it. Once snapd releases with https://github.com/snapcore/snapd/pull/13150,
# we will be able to stop worrying about that special case.
if [ "$(stat -c '%d' /)" = "$(stat -c '%d' /mnt)" ]; then
echo "FAIL: rootfs and ephemeral part on the same disk, aborting"
exit 1
fi

sudo apt-get install --no-install-recommends -y ceph-common
sudo snap install microceph --edge
sleep 5
sudo microceph cluster bootstrap
Expand All @@ -199,17 +237,11 @@ jobs:
for flag in nosnaptrim noscrub nobackfill norebalance norecover noscrub nodeep-scrub; do
sudo microceph.ceph osd set $flag
done
# Use ephemeral disk mounted on /mnt for ceph OSD.
# The block-devices plug doesn't allow accessing /dev/loopX devices so we make those same devices
# available under alternate names (/dev/sdiY) that are not used inside GitHub Action runners.
# Repurpose the ephemeral disk for ceph OSD.
sudo swapoff /mnt/swapfile
sudo rm -f /mnt/swapfile
loop_file="/mnt/ceph-osd.img"
sudo fallocate -l 10G "${loop_file}"
loop_dev="$(sudo losetup --show --direct-io=on --nooverlap -f "${loop_file}")"
devInfo=($(sudo stat -c '%t %T' "${loop_dev}"))
sudo mknod -m 0660 /dev/sdia b 0x"${devInfo[0]}" 0x"${devInfo[1]}"
sudo microceph disk add --wipe /dev/sdia
ephemeral_disk="$(findmnt --noheadings --output SOURCE --target /mnt | sed 's/[0-9]\+$//')"
sudo umount /mnt
sudo microceph disk add --wipe "${ephemeral_disk}"
sudo rm -rf /etc/ceph
sudo ln -s /var/snap/microceph/current/conf/ /etc/ceph
sudo microceph enable rgw
Expand All @@ -226,7 +258,7 @@ jobs:
chmod +x ~
echo "root:1000000:1000000000" | sudo tee /etc/subuid /etc/subgid
cd test
sudo --preserve-env=PATH,GOPATH,LXD_VERBOSE,LXD_BACKEND,LXD_CEPH_CLUSTER,LXD_CEPH_CEPHFS,LXD_CEPH_CEPHOBJECT_RADOSGW,LXD_OFFLINE,LXD_SKIP_TESTS,LXD_REQUIRED_TESTS,LXD_SHIFTFS_DISABLE LXD_BACKEND=${{ matrix.backend }} ./main.sh ${{ matrix.suite }}
sudo --preserve-env=PATH,GOPATH,GITHUB_ACTIONS,LXD_VERBOSE,LXD_BACKEND,LXD_CEPH_CLUSTER,LXD_CEPH_CEPHFS,LXD_CEPH_CEPHOBJECT_RADOSGW,LXD_OFFLINE,LXD_SKIP_TESTS,LXD_REQUIRED_TESTS,LXD_SHIFTFS_DISABLE LXD_BACKEND=${{ matrix.backend }} ./main.sh ${{ matrix.suite }}

client:
name: Client tests
Expand All @@ -243,7 +275,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v4
Expand Down Expand Up @@ -294,7 +326,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install dependencies
run: |
Expand All @@ -313,7 +345,7 @@ jobs:
uses: get-woke/woke-action@v0
with:
fail-on-error: true
woke-args: "*.md **/*.md -c https://github.com/canonical-web-and-design/Inclusive-naming/raw/main/config.yml"
woke-args: "*.md **/*.md -c https://github.com/canonical/Inclusive-naming/raw/main/config.yml"

- name: Run link checker
run: |
Expand All @@ -339,7 +371,7 @@ jobs:
if: ${{ github.repository == 'canonical/lxd' && github.event_name == 'push'}}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Launchpad SSH access
env:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ lxd-migrate/lxd-migrate
lxd-user/lxd-user
test/devlxd-client/devlxd-client
test/macaroon-identity/macaroon-identity
test/syscall/sysinfo/sysinfo

# Sphinx
doc/html/
doc/reference/manpages/**/*.md
doc/.sphinx/deps/
doc/.sphinx/.doctrees/
doc/.sphinx/themes/
doc/.sphinx/venv/
doc/.sphinx/warnings.txt
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ An example of a valid sign-off line is:
Signed-off-by: Random J Developer <[email protected]>
```

Use your real name and a valid e-mail address.
Sorry, no pseudonyms or anonymous contributions are allowed.
Use a known identity and a valid e-mail address.
Sorry, no anonymous contributions are allowed.

We also require each commit be individually signed-off by their author,
even when part of a larger set. You may find `git commit -s` useful.
Expand Down
40 changes: 26 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ POFILES=$(wildcard po/*.po)
MOFILES=$(patsubst %.po,%.mo,$(POFILES))
LINGUAS=$(basename $(POFILES))
POTFILE=po/$(DOMAIN).pot
VERSION=$(shell grep "var Version" shared/version/flex.go | cut -d'"' -f2)
VERSION=$(or ${CUSTOM_VERSION},$(shell grep "var Version" shared/version/flex.go | cut -d'"' -f2))
ARCHIVE=lxd-$(VERSION).tar
HASH := \#
TAG_SQLITE3=$(shell printf "$(HASH)include <dqlite.h>\nvoid main(){dqlite_node_id n = 1;}" | $(CC) ${CGO_CFLAGS} -o /dev/null -xc - >/dev/null 2>&1 && echo "libsqlite3")
Expand Down Expand Up @@ -112,20 +112,27 @@ ifeq "$(LXD_OFFLINE)" ""
endif
swagger generate spec -o doc/rest-api.yaml -w ./lxd -m

.PHONY: update-metadata
update-metadata: build
@echo "Generating golang documentation metadata"
$(GOPATH)/bin/lxd-metadata . --json ./lxd/metadata/configuration.json --txt ./doc/config_options.txt

.PHONY: doc-setup
doc-setup:
doc-setup: client
@echo "Setting up documentation build environment"
python3 -m venv doc/.sphinx/venv
. $(SPHINXENV) ; pip install --upgrade -r doc/.sphinx/requirements.txt
if [ -d "doc/reference/manpages/" ]; then find doc/reference/manpages/ -name "*.md" -type f -delete; fi
rm -Rf doc/html
rm -Rf doc/.sphinx/.doctrees

.PHONY: doc
doc: doc-setup doc-incremental

.PHONY: doc-incremental
doc-incremental:
@echo "Build the documentation"
. $(SPHINXENV) ; sphinx-build -c doc/ -b dirhtml doc/ doc/html/ -w doc/.sphinx/warnings.txt
. $(SPHINXENV) ; LOCAL_SPHINX_BUILD=True sphinx-build -c doc/ -b dirhtml doc/ doc/html/ -d doc/.sphinx/.doctrees -w doc/.sphinx/warnings.txt

.PHONY: doc-serve
doc-serve:
Expand All @@ -137,12 +144,17 @@ doc-spellcheck: doc

.PHONY: doc-linkcheck
doc-linkcheck: doc-setup
. $(SPHINXENV) ; sphinx-build -c doc/ -b linkcheck doc/ doc/html/
. $(SPHINXENV) ; LOCAL_SPHINX_BUILD=True sphinx-build -c doc/ -b linkcheck doc/ doc/html/ -d doc/.sphinx/.doctrees

.PHONY: doc-lint
doc-lint:
doc/.sphinx/.markdownlint/doc-lint.sh

.PHONY: doc-woke
doc-woke:
type woke >/dev/null 2>&1 || { sudo snap install woke; }
woke *.md **/*.md -c https://github.com/canonical/Inclusive-naming/raw/main/config.yml

.PHONY: debug
debug:
ifeq "$(TAG_SQLITE3)" ""
Expand Down Expand Up @@ -228,9 +240,9 @@ po/%.po: po/$(DOMAIN).pot

.PHONY: update-po
update-po:
set -eu; \
for lang in $(LINGUAS); do\
msgmerge -U $$lang.po po/$(DOMAIN).pot; \
rm -f $$lang.po~; \
msgmerge --backup=none -U $$lang.po po/$(DOMAIN).pot; \
done

.PHONY: update-pot
Expand All @@ -245,17 +257,18 @@ build-mo: $(MOFILES)

.PHONY: static-analysis
static-analysis:
ifeq ($(shell command -v golangci-lint 2> /dev/null),)
go install github.com/golangci/golangci-lint/cmd/[email protected]
ifeq ($(shell command -v golangci-lint),)
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin
endif
ifeq ($(shell command -v shellcheck 2> /dev/null),)
ifeq ($(shell command -v shellcheck),)
echo "Please install shellcheck"
exit 1
endif
else
ifneq "$(shell shellcheck --version | grep version: | cut -d ' ' -f2)" "0.8.0"
@echo "WARN: shellcheck version is not 0.8.0"
endif
ifeq ($(shell command -v flake8 2> /dev/null),)
endif
ifeq ($(shell command -v flake8),)
echo "Please install flake8"
exit 1
endif
Expand All @@ -265,6 +278,5 @@ endif
shellcheck test/extras/*.sh
run-parts --exit-on-error --regex '.sh' test/lint

.PHONY: tags
tags: *.go lxd/*.go shared/*.go lxc/*.go
find . -type f -name '*.go' | xargs gotags > tags
tags: */*.go
find . -type f -name '*.go' | gotags -L - -f tags
Loading