rockstardev
0f6717adad
Docker gen multiarch images
Release assets / assets (push) Has been cancelled
Build and publish Docker images / Build and publish image (alpine) (push) Has been cancelled
2023-12-13 13:48:34 +09:00
Nicolas Duchon
78ace42759
style: gofmt linting
2023-07-12 08:24:22 +02:00
guoguangwu
bf159fe3cd
fix: Imports must be ordered lexicographically
...
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
2023-07-11 10:10:19 +08:00
guoguangwu
77efaca970
chore: remove refs to deprecated io/ioutil
...
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
2023-07-10 10:46:33 +08:00
Richard Hansen
63f8ea7e6a
fix: Don't leak signal notification resources ( #504 )
...
Co-authored-by: Nicolas Duchon <nicolas.duchon@gmail.com>
2023-03-21 06:57:11 +01:00
Nicolas Duchon
62cd9899a1
Merge pull request #502 from rhansen/race
...
tests: fix / prevent race conditions in tests
2023-03-14 13:52:52 +01:00
Richard Hansen
bbdbf8a5f3
fix: Don't attempt to catch SIGQUIT or SIGKILL
...
SIGKILL can't be caught so there's no point in trying. SIGQUIT is
intended as a harsh exit for debugging purposes; it should generate a
core dump that accurately depicts the program's state at the time the
SIGQUIT was received.
2023-03-14 03:39:19 -04:00
Richard Hansen
c8cfb0bbad
tests: Slow down generator tests to work around race condition
...
5ms resolution is too fine for reliable tests. Increase delays by a
factor of 10 to improve the chances that the desired path will win the
race.
Ideally the test would be rewritten to remove the races entirely, but
I'll leave that as a future exercise.
2023-03-14 03:39:19 -04:00
Richard Hansen
40e53d22bd
tests: Use atomic integer for counter to avoid data race
2023-03-14 03:39:19 -04:00
Richard Hansen
0df0230939
fix: Update list of watchers serially to avoid a data race
2023-03-14 03:39:19 -04:00
Richard Hansen
9767cfa2cc
fix: Delete "invalid value" debug message accidentally left in
...
Commit e0d71f8165 added an "invalid
value" debug message that I did not intend to commit. Remove it.
2023-02-17 01:59:40 -05:00
Richard Hansen
c9c372fd4a
tests: Refine tests for sortObjectsByKeysAsc and *Desc
...
* Ensure that `sortObjectsByKeysAsc` and `sortObjectsByKeysDesc` do
not mutate the input slice.
* Be more strict when checking the sorted results.
* Improve readability and reduce duplication by converting to
idiomatic table-driven tests.
2023-02-17 01:59:40 -05:00
Richard Hansen
298e6507b8
chore: Use Value.Elem instead of reflect.Indirect for readability
2023-01-23 20:44:21 -05:00
Richard Hansen
218a63df94
fix: Don't dereference pointers in where, groupBy, sort, etc.
2023-01-23 20:44:21 -05:00
Richard Hansen
ba97c3705d
feat: Support indexing slices and arrays in deepGet
2023-01-23 20:44:21 -05:00
Richard Hansen
8648033193
feat: Automatically dereference pointer types in deepGet
...
This matches the behavior of Go, and makes it possible to use `groupBy` and
friends on a slice of `*RuntimeContainers`.
2023-01-23 20:44:21 -05:00
Richard Hansen
a0318cd598
fix: Only strip the first "." from the path passed to deepGet
...
This makes it possible to use the empty string as a map key.
2023-01-23 20:44:21 -05:00
Richard Hansen
e0d71f8165
chore: Refactor deepGet
...
This will make it easier to fix bugs and add new features.
2023-01-23 20:44:21 -05:00
Richard Hansen
c7b991e01d
feat: New eval function to evaluate a template
...
This makes it possible to:
* modularize a template by using an embedded template (defined with
Go's built-in `define` action) as a function whose return value is
the expansion of the template
* post-process the expansion of a template (e.g., pipe it to
Sprig's `indent` function)
For additional context, see
<https://github.com/golang/go/issues/54748 >. Sprig is unlikely to add
an equivalent to this function any time soon: the function must be a
closure around the template, meaning either Sprig or Go would have to
change its API.
2023-01-23 20:43:52 -05:00
Richard Hansen
22eb874943
feat: add template functions from sprig
2022-03-28 12:16:24 +02:00
Richard Hansen
ed4febbfba
tests: Don't panic if template parsing fails
2022-03-27 18:53:35 -04:00
Richard Hansen
f072793bc5
tests: Delete unnecessary template prefix parameter
...
The template name doesn't need to be globally unique.
2022-03-27 18:53:35 -04:00
Richard Hansen
5a35b9ef87
tests: Parallelize templateTestList.run
...
Because why not.
2022-03-27 17:08:05 -04:00
Richard Hansen
f784650d02
tests: Run templateTestList entries as subtests
...
This prevents one failed test case from aborting attempts for the
other test cases, and it makes it easier to iterate on a particular
test case.
2022-03-27 17:06:09 -04:00
Nicolas Duchon
2ef737a45a
tests: sorting template functions
2021-10-26 23:15:49 +02:00
Nicolas Duchon
d50c146dbe
feat: sorting template functions
2021-10-26 23:15:35 +02:00
Nicolas Duchon
025381db4d
tests: add package specific tests
2021-10-26 22:49:26 +02:00
Nicolas Duchon
ec2f6f41fc
refactor: further split code base in packages
2021-09-16 07:51:24 +02:00
Nicolas Duchon
342744e000
Merge pull request #371 from nginx-proxy/tests
...
Additional tests and incremental enhancements
2021-08-08 17:04:28 +02:00
SmalkiGroove
cde65d47f2
feat: add toLower and toUpper template functions
2021-08-08 16:56:36 +02:00
Nicolas Duchon
48c39ac18c
tests: additional tests for context and template
2021-08-08 16:12:12 +02:00
Nicolas Duchon
66b123c821
tests: use testify/assert on context
2021-08-08 16:11:46 +02:00
Nicolas Duchon
331416baf0
tests: replace log.Fatal() with testing.T.Fatal()
2021-08-08 16:10:56 +02:00
Nicolas Duchon
59c838a55c
tests: additional template tests
2021-08-08 13:36:22 +02:00
Nicolas Duchon
4282c41a5b
tests: use assert in template_test.go
2021-08-08 13:35:52 +02:00
Nicolas Duchon
aa2a909885
refactor: replace exists() with pathExists()
...
Both were the exact same function.
2021-08-06 12:54:18 +02:00
Nicolas Duchon
c2595abae9
refactor: move pathExists() to utils.go
2021-08-06 12:52:00 +02:00
Nicolas Duchon
43d66a3f26
style: linting with staticcheck
2021-08-06 11:51:55 +02:00
Nicolas Duchon
79abcabeb9
refactor: clean project structure and dependencies
2021-08-06 11:51:55 +02:00