-
-
Notifications
You must be signed in to change notification settings - Fork 313
Porting network_acls
to database generator
#2035
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
Conversation
Looks like there's an issue with the name of the foreign key here. Should be |
I have updated the entity name in the generator directives to be |
It seems that now the system tests are all passing, but the entity name being I think the database generator assumes |
I'm waiting for @masnax to look at the DB generator side of things here to get the names to pass |
You should be able to override the computed struct name if you use that as the value given to the
With
and same for methods. |
Ah, spoke too soon. It looks like this PR is necessary first. |
I rebased on main to get @masnax's change and renamed to NetworkACL. Now what's missing is actually nuking |
Signed-off-by: Aryan Khatri <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
Right, so that took a bit of effort to sort it all out to a satisfying state. Basically what I did is that for all the cases where we were only dealing with minimal data manipulations, I just moved the logic from Then for the remaining two which dealt with API structs, I moved them over to the |
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [lxc/incus](https://github.com/lxc/incus) | minor | `v6.12.0` -> `v6.13.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>lxc/incus (lxc/incus)</summary> ### [`v6.13.0`](https://github.com/lxc/incus/releases/tag/v6.13.0): Incus 6.13 [Compare Source](lxc/incus@v6.12.0...v6.13.0) ### Announcement https://discuss.linuxcontainers.org/t/incus-6-13-has-been-released/23899 #### What's Changed - Add server side filtering for `incus network list` by [@​Abdomash](https://github.com/Abdomash) in lxc/incus#1989 - doc: Fix default value of ipv4.dhcp.gateway to IPv4 address by [@​hnakamur](https://github.com/hnakamur) in lxc/incus#1991 - doc: Fix default value of ipv6.routes network_bridge by [@​hnakamur](https://github.com/hnakamur) in lxc/incus#1992 - doc: Fix Debian 12 nickname by [@​hnakamur](https://github.com/hnakamur) in lxc/incus#1993 - Fix issues with nftables and address sets by [@​stgraber](https://github.com/stgraber) in lxc/incus#1995 - incusd/dns: fix typo in error log by [@​gwenya](https://github.com/gwenya) in lxc/incus#1998 - Port pci to gendoc by [@​DinglyCoder](https://github.com/DinglyCoder) in lxc/incus#1996 - rename reverters from revert to reverter to not conflict with the package by [@​The127](https://github.com/The127) in lxc/incus#2000 - incusd: Refactor error checks with errors.is and errors.As by [@​The127](https://github.com/The127) in lxc/incus#2002 - Rename vars using builtin names by [@​The127](https://github.com/The127) in lxc/incus#2006 - incusd: Refactor getting heartbeat mode name into a function by [@​The127](https://github.com/The127) in lxc/incus#2005 - Unify receiver types by [@​The127](https://github.com/The127) in lxc/incus#2004 - incusd: Refactor unused parameters by [@​The127](https://github.com/The127) in lxc/incus#2001 - incusd/firewall/nftables: Fix handling of address set deletion by [@​stgraber](https://github.com/stgraber) in lxc/incus#2012 - Add server-side filtering for incus storage bucket list by [@​allisoncchen](https://github.com/allisoncchen) in lxc/incus#2008 - Add support for running the Incus agent on Windows by [@​stgraber](https://github.com/stgraber) in lxc/incus#2014 - incusd/network/ovn: Wait up to 10s for OVN northd to allocate an IP by [@​stgraber](https://github.com/stgraber) in lxc/incus#2024 - Refactor unnecessary if checks by [@​The127](https://github.com/The127) in lxc/incus#2017 - incusd: refactor process kill error being ignored by [@​The127](https://github.com/The127) in lxc/incus#2018 - incusd/instance: fix device finding logic by [@​The127](https://github.com/The127) in lxc/incus#2019 - incusd: remove unreachable code in api internal by [@​The127](https://github.com/The127) in lxc/incus#2016 - Rewrite legacy QEMU config code by [@​bensmrs](https://github.com/bensmrs) in lxc/incus#2011 - incus: refactor admin_init.go config initialization by [@​The127](https://github.com/The127) in lxc/incus#2023 - Extend incus-migrate to support uploading filesystems and disks as custom volumes by [@​presztak](https://github.com/presztak) in lxc/incus#2022 - Add server-side filtering for `incus project list` by [@​rahafjrw](https://github.com/rahafjrw) in lxc/incus#2015 - incusd/network/bridge: Add missing line breaks by [@​stgraber](https://github.com/stgraber) in lxc/incus#2029 - Port ovn network documentation to gendoc by [@​lahariguduru](https://github.com/lahariguduru) in lxc/incus#2027 - Remove gopkg.in/tomb.v2 dependency by [@​nanjj](https://github.com/nanjj) in lxc/incus#2031 - Update gendoc for network_physical and network_bridge by [@​janetkimmm](https://github.com/janetkimmm) in lxc/incus#2030 - incusd/instance/qemu: Don't allow hotplug when at maxmem by [@​stgraber](https://github.com/stgraber) in lxc/incus#2033 - incusd/server/device/nic_routed: Added host_tables by [@​AbhinavTiruvee](https://github.com/AbhinavTiruvee) in lxc/incus#2009 - incusd/storage: Fix migration error due to rounding by [@​stgraber](https://github.com/stgraber) in lxc/incus#2041 - incusd: add missing err handling for transactions by [@​The127](https://github.com/The127) in lxc/incus#2040 - Rename result of `mux.NewRouter()` so they dont collide with the mux package by [@​The127](https://github.com/The127) in lxc/incus#2037 - Rename instances of sha256.New() so they dont collide with the package name by [@​The127](https://github.com/The127) in lxc/incus#2038 - incusd/storage/zfs: Optimize snapshot deletion by [@​stgraber](https://github.com/stgraber) in lxc/incus#2043 - Missing case statements for iota constants by [@​The127](https://github.com/The127) in lxc/incus#2039 - incusd: Refactor error list by [@​The127](https://github.com/The127) in lxc/incus#2026 - Remove redundant map size by [@​The127](https://github.com/The127) in lxc/incus#2053 - internal/dnsutil: remove unused package dnsutil by [@​The127](https://github.com/The127) in lxc/incus#2046 - Rework QEMU config override logic by [@​bensmrs](https://github.com/bensmrs) in lxc/incus#2048 - tools: Add govulncheck by [@​breml](https://github.com/breml) in lxc/incus#2050 - incusd/dnsmasq: refactor DHCPValidIP condition checks by [@​The127](https://github.com/The127) in lxc/incus#2020 - incusd: rename instanceActionToOptype to instanceActionToOpType by [@​The127](https://github.com/The127) in lxc/incus#2047 - internal/iprange: add tests for the iprange.Range struct by [@​The127](https://github.com/The127) in lxc/incus#2045 - Port macvlan network documentation to gendoc by [@​kmxtn](https://github.com/kmxtn) in lxc/incus#2042 - incusd/certificates: Properly handle PEM encoding on POST by [@​stgraber](https://github.com/stgraber) in lxc/incus#2056 - lint: Codespell exclude generated docs by [@​breml](https://github.com/breml) in lxc/incus#2051 - incusd/instance/qemu: Don't allow QEMU RSS to exceed memory limit by [@​stgraber](https://github.com/stgraber) in lxc/incus#2058 - Add server-side filtering for `incus config trust list` by [@​allisoncchen](https://github.com/allisoncchen) in lxc/incus#2057 - Add support for additional disks to `incus-migrate` by [@​presztak](https://github.com/presztak) in lxc/incus#2064 - Restart builtin DNS server on failure by [@​gwenya](https://github.com/gwenya) in lxc/incus#2062 - Port sriov network documentation to gendoc by [@​cory-chang](https://github.com/cory-chang) in lxc/incus#2059 - Db generate fixes by [@​masnax](https://github.com/masnax) in lxc/incus#2066 - Add support for split image publishing by [@​saahirN](https://github.com/saahirN) in lxc/incus#2013 - Added CLI Configuration Option for Default Table Layout by [@​arojas2003](https://github.com/arojas2003) in lxc/incus#2044 - incusd/instance/qemu: Limit memory hotplug slots to 8 by [@​stgraber](https://github.com/stgraber) in lxc/incus#2065 - incusd/device/sriov: Handle cards without configurable spoof checking by [@​stgraber](https://github.com/stgraber) in lxc/incus#2069 - incusd/firewall/nftables: disable UDP checksum validation for packets on bridged network by [@​MaheshPunjabi](https://github.com/MaheshPunjabi) in lxc/incus#2076 - Use snake case entity names for ID column names by [@​masnax](https://github.com/masnax) in lxc/incus#2079 - Allow providing certificates as part of preseed data [#​1804](lxc/incus#1804) by [@​DinglyCoder](https://github.com/DinglyCoder) in lxc/incus#2078 - Porting `network_acls` to database generator by [@​Aryan470](https://github.com/Aryan470) in lxc/incus#2035 - client: Fix required extension for GetNetworkAddressSetsAllProjects by [@​breml](https://github.com/breml) in lxc/incus#2082 - Move cluster resource caching to point of consumption by [@​janetkimmm](https://github.com/janetkimmm) in lxc/incus#2072 - Implement stateful DHCPv6 by [@​rahafjrw](https://github.com/rahafjrw) in lxc/incus#2060 - Adding support for incus storage volume mount by [@​Aryan470](https://github.com/Aryan470) in lxc/incus#2071 - incus/remote: Add "get-client-certificate" and "get-client-token" by [@​stoven2k17](https://github.com/stoven2k17) in lxc/incus#2088 - Ban the use of LLMs and AI assistants/agents by [@​stgraber](https://github.com/stgraber) in lxc/incus#2089 - Add support for .OVA import by [@​presztak](https://github.com/presztak) in lxc/incus#2092 - Add common aliases for add/create remove/delete/rm in the CLI by [@​joecwilson](https://github.com/joecwilson) in lxc/incus#1955 - Improve handling of Windows agent by [@​stgraber](https://github.com/stgraber) in lxc/incus#2103 - Include OS metrics on Incus OS by [@​stgraber](https://github.com/stgraber) in lxc/incus#2104 - incusd/instance/lxc: Refactor inheritInitPidFd by [@​gwenya](https://github.com/gwenya) in lxc/incus#2106 - Removed useless else in Makefile by [@​nanjj](https://github.com/nanjj) in lxc/incus#2115 - incusd/main_forknet: Don't touch resolv.conf when no leases by [@​stgraber](https://github.com/stgraber) in lxc/incus#2118 - incusd/storage/ceph: Fix parent tracking for VMs by [@​stgraber](https://github.com/stgraber) in lxc/incus#2119 - Fix Github test failures by [@​stgraber](https://github.com/stgraber) in lxc/incus#2120 - incus: Simplify code by using modern constructs by [@​nanjj](https://github.com/nanjj) in lxc/incus#2111 - internal: Simplify code by using modern constructs by [@​nanjj](https://github.com/nanjj) in lxc/incus#2113 - Simplify code by using modern constructs by [@​nanjj](https://github.com/nanjj) in lxc/incus#2112 - Simplify code by using modern constructs by [@​nanjj](https://github.com/nanjj) in lxc/incus#2110 - Translations update from Hosted Weblate by [@​weblate](https://github.com/weblate) in lxc/incus#2123 - incusd/instances: Tweak storage migration errors by [@​stgraber](https://github.com/stgraber) in lxc/incus#2131 - Add +invtsc to cpu extensions ensure tsc as current clocksource by [@​nanjj](https://github.com/nanjj) in lxc/incus#2127 - incusd/instance: Fix incorrect cluster.Connect call by [@​stgraber](https://github.com/stgraber) in lxc/incus#2134 - incusd/instances_post: Prevent pointless device overrides by [@​stgraber](https://github.com/stgraber) in lxc/incus#2133 - Use the umoci Go package instead of the command by [@​presztak](https://github.com/presztak) in lxc/incus#1880 - incusd/forkproxy: join the correct mntns for listen by [@​cyphar](https://github.com/cyphar) in lxc/incus#2136 - Fix use of format string functions with constant string by [@​NathanChase22](https://github.com/NathanChase22) in lxc/incus#2107 - incus-migrate: prompt for cluster target by [@​MaheshPunjabi](https://github.com/MaheshPunjabi) in lxc/incus#2124 - Use our own QMP monitor by [@​nanjj](https://github.com/nanjj) in lxc/incus#2105 - incusd/instance/qmp: remove weird qmp bug workaround by [@​nanjj](https://github.com/nanjj) in lxc/incus#2139 - Make sure limits.memory <= root,size.state by [@​nanjj](https://github.com/nanjj) in lxc/incus#2138 - incusd/instance/qmp: Refactor qmpWriteMsg by [@​nanjj](https://github.com/nanjj) in lxc/incus#2140 - Allow overriding the external address (NAT) for OVN NICs by [@​OGCbn](https://github.com/OGCbn) in lxc/incus#2090 - Static Binding of OVN uplink gateway MAC by [@​davidbockelman](https://github.com/davidbockelman) in lxc/incus#2091 - incusd: fix some trivial typos by [@​mrstux](https://github.com/mrstux) in lxc/incus#2147 - incusd/storage: Fix squashfs unpacking to NFS destinations by [@​stgraber](https://github.com/stgraber) in lxc/incus#2149 - Remove pending cluster member on join failure by [@​presztak](https://github.com/presztak) in lxc/incus#2145 - incusd/instance/qmp: associated request/reply with command id by [@​nanjj](https://github.com/nanjj) in lxc/incus#2142 - RTC base enhancement via rtc change event handling by [@​nanjj](https://github.com/nanjj) in lxc/incus#2141 - incusd/storage/linstor: Prevent mounting unreachable pools by [@​bensmrs](https://github.com/bensmrs) in lxc/incus#2101 - Return empty slice instead of nil when no storage pool is present by [@​presztak](https://github.com/presztak) in lxc/incus#2152 - Clear the "volatile.cpu.nodes" if needed by [@​presztak](https://github.com/presztak) in lxc/incus#2153 - vscode: Add VSCode launch.json for incusd "Run and Debug" functionality by [@​mrstux](https://github.com/mrstux) in lxc/incus#2155 - Add support for specifying username in CephFs commands by [@​presztak](https://github.com/presztak) in lxc/incus#2154 - Port network_load_balancers to database generator by [@​davidbockelman](https://github.com/davidbockelman) in lxc/incus#2068 - Porting network zone database functions to database generator. by [@​irhndt](https://github.com/irhndt) in lxc/incus#2108 - Allow updating root disk size and root io.bus simultaneously by [@​presztak](https://github.com/presztak) in lxc/incus#2158 - Fix daily test regressions by [@​stgraber](https://github.com/stgraber) in lxc/incus#2162 #### New Contributors - [@​DinglyCoder](https://github.com/DinglyCoder) made their first contribution in lxc/incus#1996 - [@​The127](https://github.com/The127) made their first contribution in lxc/incus#2000 - [@​allisoncchen](https://github.com/allisoncchen) made their first contribution in lxc/incus#2008 - [@​lahariguduru](https://github.com/lahariguduru) made their first contribution in lxc/incus#2027 - [@​janetkimmm](https://github.com/janetkimmm) made their first contribution in lxc/incus#2030 - [@​cory-chang](https://github.com/cory-chang) made their first contribution in lxc/incus#2059 - [@​arojas2003](https://github.com/arojas2003) made their first contribution in lxc/incus#2044 - [@​Aryan470](https://github.com/Aryan470) made their first contribution in lxc/incus#2035 - [@​stoven2k17](https://github.com/stoven2k17) made their first contribution in lxc/incus#2088 - [@​OGCbn](https://github.com/OGCbn) made their first contribution in lxc/incus#2090 - [@​davidbockelman](https://github.com/davidbockelman) made their first contribution in lxc/incus#2091 **Full Changelog**: lxc/incus@v6.12.0...v6.13.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC41MC4wIiwidXBkYXRlZEluVmVyIjoiNDAuNTAuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Fixes #1798
I wrote the generator directives in a new file, cluster/network_acls.go, and changed the internal implementations of the methods in network_acls.go to use the generated functions, maintaining the same function signatures.
To verify this, I ran
make update-schema && make && make unit-test && make static-analysis
. It passed the unit tests and static analysis on my environment.This is my first contribution so I would appreciate any guidance on anything I missed. Thanks!