Commits
- Commit:
34e59742782b07bf5a86b722b247eeb368e7f013- From:
- Oliver Lowe <o@olowe.co>
- Date:
delete experimental object watcher
- Commit:
8b3445266f32f04c7bd46718dd5948a6e1543f27- From:
- Oliver Lowe <o@olowe.co>
- Date:
delete experimental object watcher
- Commit:
9016a0fbf4855edbd3463ae2edf332d3a8f44466- From:
- Oliver Lowe <o@olowe.co>
- Date:
initial event stream implementation
Documentation too. It's not quite clear enough that callers need to
handle resubscribing on any errors reading the stream. It's documented
for Subscribe but example usage would be good too.
- Commit:
43c71de36cec7d072d2436925b93cf2e94b71606- From:
- Oliver Lowe <o@olowe.co>
- Date:
wip
- Commit:
f21c51c745099616c3451e39569df1b46feae6af- From:
- Oliver Lowe <o@olowe.co>
- Date:
Support icinga 2.12 acknowledgement, state, statetype field
On Debian 11 these fields are floats, not ints (or boolean) for some
reason. This patch allows unmarshalling either floats or integers
depending on what the icinga API sends us.
- Commit:
fb8a219e2a3363c6ac9f5e819b45cca7ca4a1086- From:
- Oliver Lowe <o@olowe.co>
- Date:
link to the new general mailing list
because there's so many subscribers... lol
- Commit:
cb667a50cb18cc38d49e520642743de727bed3ca- From:
- Oliver Lowe <o@olowe.co>
- Date:
Store last Host check result and time
Includes tests and simplified unmarshal test.
- Commit:
a17d3f9dc6856d0cb60bf176e66844dc2752782d- From:
- Oliver Lowe <o@olowe.co>
- Date:
Simplify service JSON marshalling
We don't need to have a MarshalJSON method just so that it can be
created ok. It's clearer to do stuff necessart for object creation at
the time of object creation, not way earlier in some unrelated bit of
the code.
While here simplify the tests to actually test what we're worried about.
- Commit:
8f08828e8134e1160b4be74544d3b6020059366e- From:
- Oliver Lowe <o@olowe.co>
- Date:
store a service's last check result
- Commit:
f4705a64149eb5336dd9f69e1a32ebf7d886a132- From:
- Oliver Lowe <o@olowe.co>
- Date:
icinga_test: Don't assign group for random hosts
We can test hostgroup assignment in other tests if desired.
- Commit:
62bf235cf08fdde3e89d389bdc78b8602069b28c- From:
- Oliver Lowe <o@olowe.co>
- Date:
icinga_test: Inline permissions response
No need for a file on disk; it's only referenced once.
- Commit:
87154adc3ffe738b0e1223d666c0ae63e1926399- From:
- Oliver Lowe <o@olowe.co>
- Date:
Run a full test on builds.sr.ht for every commit
On OpenBSD. Why not?
- Commit:
b717ce9bd51371aefd55ccd6ddf623f83aed8e29- From:
- Oliver Lowe <o@olowe.co>
- Date:
Test against a fake in-processs icinga server
A lot of the testing doesn't really flex what a real icinga2 server
does. We can implement a simple fake server with about 250 lines of
Go, then we get all the benefits of really quick feedback and no
dependency on an icinga2 server (which isn't super easy to set up) for
most tests. More complicated tests are still performed against a real
server listening on loopback (if available).
- Commit:
49e200e1bf5862fe2a396ba4b3fa1646aa09e3ee- From:
- Oliver Lowe <o@olowe.co>
- Date:
Remove unnecessary parseAPIResponse function
All this did was wrap the usual standard library JSON decode
procedure.
- Commit:
9feb16b3670b92265319b98dbd2bdcb5d8f21db7- From:
- Oliver Lowe <o@olowe.co>
- Date:
Remove useless loop
We always returned something on the first iteration, so just remove it.
- Commit:
e4ad50b973973310a1823f00ea975697e93e3182- From:
- Oliver Lowe <o@olowe.co>
- Date:
panic on unlikely test case
We're just in test mode, so it's ok to panic if we reach this highly unlikely
scenario when, for example, the testdata file changes or something.
- Commit:
c26e0f9dab045063f9fb15a64233322532b18dcb- From:
- Oliver Lowe <o@olowe.co>
- Date:
Use default MarshalJSON method
There's no point doing so much manual work and testing just to keep
fields under a "attrs" key when marshalling to JSON. When creating the
object we can just:
1. Marshal the object to JSON
2. Put it all under a "attrs" key.
Now it's easier to imagine the mapping of the structs to JSON, since
they follow the same rules as everything else in Go.
- Commit:
717a9e7823638c994c6620883fcee2ef98da294b- From:
- Oliver Lowe <o@olowe.co>
- Date:
Keep test data in version control
While here also don't log messages in testing unless there's an error.
- Commit:
dca9442c1f7da187028aaaf66f2ebf7c34d6a863- From:
- Oliver Lowe <o@olowe.co>
- Date:
Catch all HostStates and ServiceStates
This is closer to the Icinga spec, anything greater than 2 or 3 is unknown.
- Commit:
e35b73d5e39c5601f8db91e5dc8fc38642d1dea4- From:
- Oliver Lowe <o@olowe.co>
- Date:
Only log on test error
No news is good news!
- Commit:
0324b0fdd256bf328e1eab17200b23aa803d0bd5- From:
- Oliver Lowe <o@olowe.co>
- Date:
Just panic on unlikely user test error
We're just testing, so we don't need super robust error handling code.
And if any of those conditions aren't met then we have serious
problems anyway.
- Commit:
46fe962a8b8f10d81d0281a5097886b71c99afda- From:
- Oliver Lowe <o@olowe.co>
- Date:
Revert "Create a new client interface"
This reverts commit bd3b8a33c54037e66233db80fd1120eb0b6215f1.
It's a bad idea. I'm writing a fake server instead so that we can use
the real client code.
- Commit:
bd3b8a33c54037e66233db80fd1120eb0b6215f1- From:
- Oliver Lowe <o@olowe.co>
- Date:
Create a new client interface
So that testing the client doesn't involve making real HTTP requests.
- Commit:
d762d1d1aeb9ddb5a796ccfe1fefa3edea7e242f- From:
- Oliver Lowe <o@olowe.co>
- Date:
Correctly return ErrNoMatch when rescheduling a check
For some reason the API returns an internal server error status rather
than a Not Found status (as in other methods in the API). We can catch
the condition when results are empty and return ErrNoMatch.
- Commit:
46ca0f68f521c66d60a5d6646a0a15350533c9b8- From:
- Oliver Lowe <o@olowe.co>
- Date:
Marshal using struct tags rather than a custom map
I was excluding some struct fields so I thought I'd need to do some custom marshalling .
But you don't need to do this as you can use struct tags to optionally exclude things
from being put into JSON. Now there's no longer duplicate code between struct tags and keys in a map when marshalling. Handy!
