| 1 | # ChangeLog |
| 2 | |
| 3 | ## v0.0.18 |
| 4 | |
| 5 | - Added locking to `Fake` to allow it to be safely used concurrently. |
| 6 | (`@npinaeva`) |
| 7 | |
| 8 | - Added a `Flowtable` object, and `Fake` support for correctly parsing |
| 9 | flowtable references. (`@aojea`) |
| 10 | |
| 11 | - Fixed a bug in `Fake.ParseDump`, which accidentally required the |
| 12 | table to have a comment. (`@danwinship`) |
| 13 | |
| 14 | ## v0.0.17 |
| 15 | |
| 16 | - `ListRules()` now accepts `""` for the chain name, meaning to list |
| 17 | all rules in the table. (`@caseydavenport`) |
| 18 | |
| 19 | - `ListElements()` now handles elements with prefix/CIDR values (e.g., |
| 20 | `"192.168.0.0/16"`; these are represented specially in the JSON |
| 21 | format and the old code didn't handle them). (`@caseydavenport`) |
| 22 | |
| 23 | - Added `NumOperations()` to `Transaction` (which lets you figure out |
| 24 | belatedly whether you added anything to the transaction or not, and |
| 25 | could also be used for metrics). (`@fasaxc`) |
| 26 | |
| 27 | - `knftables.Interface` now reuses the same `bytes.Buffer` for each |
| 28 | call to `nft` rather than constructing a new one each time, saving |
| 29 | time and memory. (`@aroradaman`) |
| 30 | |
| 31 | - Fixed map element deletion in `knftables.Fake` to not mistakenly |
| 32 | require that you fill in the `.Value` of the element. (`@npinaeva`) |
| 33 | |
| 34 | - Added `Fake.LastTransaction`, to retrieve the most-recently-executed |
| 35 | transaction. (`@npinaeva`) |
| 36 | |
| 37 | ## v0.0.16 |
| 38 | |
| 39 | - Fixed a bug in `Fake.ParseDump()` when using IPv6. (`@npinaeva`) |
| 40 | |
| 41 | ## v0.0.15 |
| 42 | |
| 43 | - knftables now requires the nft binary to be v1.0.1 or later. This is |
| 44 | because earlier versions (a) had bugs that might cause them to crash |
| 45 | when parsing rules created by later versions of nft, and (b) always |
| 46 | parsed the entire ruleset at startup, even if you were only trying |
| 47 | to operate on a single table. The combination of those two factors |
| 48 | means that older versions of nft can't reliably be used from inside |
| 49 | a container. (`@danwinship`) |
| 50 | |
| 51 | - Fixed a bug that meant we were never setting comments on |
| 52 | tables/chains/sets/etc, even if nft and the kernel were both new |
| 53 | enough to support it. (`@tnqn`) |
| 54 | |
| 55 | - Added `Fake.ParseDump()`, to load a `Fake` from a `Fake.Dump()` |
| 56 | output. (`@npinaeva`) |
| 57 | |
| 58 | ## v0.0.14 |
| 59 | |
| 60 | - Renamed the package `"sigs.k8s.io/knftables"`, reflecting its new |
| 61 | home at https://github.com/kubernetes-sigs/knftables/ |
| 62 | |
| 63 | - Improvements to `Fake`: |
| 64 | |
| 65 | - `Fake.Run()` is now properly transactional, and will have no |
| 66 | side effects if an error occurs. |
| 67 | |
| 68 | - `Fake.Dump()` now outputs all `add chain`, `add set`, and `add |
| 69 | table` commands before any `add rule` and `add element` |
| 70 | commands, to ensure that the dumped ruleset can be passed to |
| 71 | `nft -f` without errors. |
| 72 | |
| 73 | - Conversely, `Fake.Run()` now does enough parsing of rules and |
| 74 | elements that it will notice rules that do lookups in |
| 75 | non-existent sets/maps, and rules/verdicts that jump to |
| 76 | non-existent chains, so it can error out in those cases. |
| 77 | |
| 78 | - Added `nft.Check()`, which is like `nft.Run()`, but using |
| 79 | `nft --check`. |
| 80 | |
| 81 | - Fixed support for ingress and egress hooks (by adding |
| 82 | `Chain.Device`). |
| 83 | |
| 84 | ## v0.0.13 |
| 85 | |
| 86 | - Fixed a bug in `Fake.Run` where it was not properly returning "not |
| 87 | found" / "already exists" errors. |
| 88 | |
| 89 | ## v0.0.12 |
| 90 | |
| 91 | - Renamed the package from `"github.com/danwinship/nftables"` to |
| 92 | `"github.com/danwinship/knftables"`, for less ambiguity. |
| 93 | |
| 94 | - Added `NameLengthMax` and `CommentLengthMax` constants. |
| 95 | |
| 96 | - Changed serialization of `Chain` to convert string-valued `Priority` |
| 97 | to numeric form, if possible. |
| 98 | |
| 99 | - (The `v0.0.11` tag exists but is not usable due to a bad `go.mod`) |
| 100 | |
| 101 | ## v0.0.10 |
| 102 | |
| 103 | - Dropped `Define`, because nft defines turned out to not work the way |
| 104 | I thought (in particular, you can't do "$IP daddr"), so they end up |
| 105 | not really being useful for our purposes. |
| 106 | |
| 107 | - Made `NewTransaction` a method on `Interface` rather than a |
| 108 | top-level function. |
| 109 | |
| 110 | - Added `Transaction.String()`, for debugging |
| 111 | |
| 112 | - Fixed serialization of set/map elements with timeouts |
| 113 | |
| 114 | - Added special treament for `"@"` to `Concat` |
| 115 | |
| 116 | - Changed `nftables.New()` to return an `error` (doing the work that |
| 117 | used to be done by `nft.Present()`.) |
| 118 | |
| 119 | - Add autodetection for "object comment" support, and have |
| 120 | serialization just ignore comments on `Table`/`Chain`/`Set`/`Map` if |
| 121 | nft or the kernel does not support them. |
| 122 | |
| 123 | - Renamed `Optional()` to `PtrTo()` |
| 124 | |
| 125 | ## v0.0.9 |
| 126 | |
| 127 | - Various tweaks to `Element`: |
| 128 | |
| 129 | - Changed `Key` and `Value` from `string` to `[]string` to better |
| 130 | support concatenated types (and dropped the `Join()` and |
| 131 | `Split()` helper functions that were previously used to join and |
| 132 | split concatenated values). |
| 133 | |
| 134 | - Split `Name` into separate `Set` and `Map` fields, which make it |
| 135 | clearer what is being named, and are more consistent with |
| 136 | `Rule.Chain`, and provide more redundancy for distinguishing set |
| 137 | elements from map elements. |
| 138 | |
| 139 | - Fixed serialization of map elements with a comments. |
| 140 | |
| 141 | - Rewrote `ListElements` and `ListRules` to use `nft -j`, for easier / |
| 142 | more reliable parsing. But this meant that `ListRules` no longer |
| 143 | returns the actual text of the rule. |
| 144 | |
| 145 | ## v0.0.8 |
| 146 | |
| 147 | - Fixed `Fake.List` / `Fake.ListRules` / `Fake.ListElements` to return |
| 148 | errors that would be properly recognized by |
| 149 | `IsNotFound`/`IsAlreadyExists`. |
| 150 | |
| 151 | ## v0.0.7 |
| 152 | |
| 153 | - Implemented `tx.Create`, `tx.Insert`, `tx.Replace` |
| 154 | |
| 155 | - Replaced `tx.AddRule` with the `Concat` function |
| 156 | |
| 157 | ## v0.0.6 |
| 158 | |
| 159 | - Added `IsNotFound` and `IsAlreadyExists` error-checking functions |
| 160 | |
| 161 | ## v0.0.5 |
| 162 | |
| 163 | - Moved `Define` from `Transaction` to `Interface` |
| 164 | |
| 165 | ## v0.0.3, v0.0.4 |
| 166 | |
| 167 | - Improvements to `Fake` to handle `Rule` and `Element` |
| 168 | deletion/overwrite. |
| 169 | |
| 170 | - Added `ListRules` and `ListElements` |
| 171 | |
| 172 | - (The `v0.0.3` and `v0.0.4` tags are identical.) |
| 173 | |
| 174 | ## v0.0.2 |
| 175 | |
| 176 | - Made `Interface` be specific to a single family and table. (Before, |
| 177 | that was specified at the `Transaction` level.) |
| 178 | |
| 179 | ## v0.0.1 |
| 180 | |
| 181 | - Initial "release" |