Commit graph

1972 commits

Author SHA1 Message Date
Julian Brost
336ee4a8ab
Merge pull request #554 from Icinga/553
convertFlappingRows(): fix foreign key error history -> flapping_history
2023-07-31 15:00:39 +02:00
Julian Brost
71c1d2fa4d Migration: refactor output/processing of converted entities
This commit simplifies the `icingaDbOutputStage` type to contain only one
entity slice to be insert/upsert. This allows to simplify the handling in
`migrateOneType()` by removing nested loops.

Additionally, a bit of code inside that function is outsourced into a new
`utils.ChanFromSlice()` function. This makes the body of the loop over the
insert/upsert operation (the loop using the `op` variable) simple enough so
that it can just be unrolled which saves the inline struct and slice definition
for that loop.
2023-07-31 11:10:42 +02:00
Julian Brost
62f7ae9114
Merge pull request #609 from Icinga/percona-xtradb-cluster
Support Percona XtraDB Cluster by not using SERIALIZABLE transactions directly
2023-07-31 10:24:10 +02:00
Julian Brost
b05128ec00
Merge pull request #623 from Icinga/was_started-621
cmd/icingadb-migrate: ignore icinga_downtimehistory#was_started=0 rows
2023-07-28 14:47:25 +02:00
Alexander Aleksandrovič Klimov
99de1079f8
Merge pull request #593 from Icinga/wait-for-database-to-start-rather-than-crashing-561
Merge network and database error retryability detection functions
2023-07-27 17:58:06 +02:00
Alexander A. Klimov
78327c1f34 cmd/icingadb-migrate: ignore icinga_downtimehistory#was_started=0 rows
Such appear e.g. for scheduled but never triggered flexible Downtimes.
Not triggered = no events.
2023-07-27 17:29:33 +02:00
Julian Brost
5ea6831ebc
Merge pull request #551 from Icinga/550
icingadb-migrate: handle NULL event time columns
2023-07-25 16:38:55 +02:00
Julian Brost
68d26a6873
Merge pull request #601 from Icinga/flatten-empty-custom-vars-correctly
Write a hint for empty arrays/dicts into `customvar_flat`
2023-07-25 15:28:07 +02:00
Julian Brost
536c808bca
Merge pull request #605 from Icinga/yaml.DisallowUnknownField
Config parsing: fail on unknown fields and print them
2023-07-25 10:29:29 +02:00
Julian Brost
ef09059549
Merge pull request #612 from Icinga/bool-binary-unixmilli-marshaljson-return-valid-json-not-empty-string
{Bool,Binary,UnixMilli}#MarshalJSON(): return valid JSON, not empty string
2023-07-25 10:28:44 +02:00
Julian Brost
3d66bec268
Merge pull request #598 from Icinga/dependabot/go_modules/github.com/stretchr/testify-1.8.4
build(deps): bump github.com/stretchr/testify from 1.8.3 to 1.8.4
2023-07-25 10:26:29 +02:00
Julian Brost
1c2d912d68
Merge pull request #599 from Icinga/dependabot/go_modules/github.com/mattn/go-sqlite3-1.14.17
build(deps): bump github.com/mattn/go-sqlite3 from 1.14.16 to 1.14.17
2023-07-25 10:26:20 +02:00
Julian Brost
b72b5335f1
Merge pull request #603 from Icinga/dependabot/go_modules/golang.org/x/sync-0.3.0
build(deps): bump golang.org/x/sync from 0.2.0 to 0.3.0
2023-07-25 10:26:06 +02:00
Julian Brost
a55008732f
Merge pull request #619 from Icinga/integration-tests-docker-http-host-header
Make integration tests work with Go 1.20.6
2023-07-25 10:09:14 +02:00
Julian Brost
c856fb9fe0 Make integration tests work with Go 1.20.6
As a security fix, Go implemented stricter checks for the Host header in the
http package. This breaks the Go Docker client library [1] resulting in "http:
invalid Host header" errors in our integration tests.

A fix [2] was merged to the 24.0 branch, but is not yet included in a release.
Therefore, this commit updates the dependency to a specific commit
(`go get -u github.com/docker/docker@24.0`). Once it's included in a release,
this can be switched back to using a release version.

[1] https://github.com/moby/moby/issues/45935
[2] https://github.com/moby/moby/pull/45942
2023-07-24 13:24:11 +02:00
Alexander A. Klimov
af868b1762 Config parsing: unit test failure due to unknown fields 2023-07-11 09:57:54 +02:00
Alexander A. Klimov
b8ed25c87a Test UnixMilli#MarshalJSON() 2023-07-07 16:47:45 +02:00
Alexander A. Klimov
7568c47378 Test Bool#MarshalJSON() 2023-07-07 16:47:45 +02:00
Alexander A. Klimov
0745ba7d9e Test Binary#MarshalJSON() 2023-07-07 16:47:45 +02:00
Alexander A. Klimov
0291c860a1 {Bool,Binary,UnixMilli}#MarshalJSON(): return valid JSON, not empty string
in case an instance is null.
2023-07-04 15:38:17 +02:00
Yonas Habteab
23ac5914aa Add empty custom vars test cases 2023-06-29 13:43:33 +02:00
Yonas Habteab
fa0a712bac Flatten empty custom vars of type array & map correctly 2023-06-29 13:43:33 +02:00
Julian Brost
a57f0cb810
Merge pull request #604 from Icinga/icingadb-migrate-document-tls-support-556
icingadb-migrate: document TLS support
2023-06-28 14:46:53 +02:00
Alexander A. Klimov
6dc4998802 Support Percona XtraDB Cluster by not using SERIALIZABLE transactions directly
The RDBMS rejects them by default. But it doesn't rejects their equivalent:
Append "LOCK IN SHARE MODE" to every SELECT in a REPEATABLE READ transaction.
Now we do the latter with MySQL.
2023-06-22 15:13:40 +02:00
Alexander A. Klimov
3991ee0edb icingadb-migrate: document TLS support 2023-06-21 16:53:29 +02:00
Alexander A. Klimov
a163694dc6 Config parsing: fail on unknown fields and print them
Useful against config validation or runtime failures
caused by wrong field spelling or YAML indentation.
2023-06-19 17:38:52 +02:00
dependabot[bot]
a7068c7e8a
build(deps): bump golang.org/x/sync from 0.2.0 to 0.3.0
Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.2.0 to 0.3.0.
- [Commits](https://github.com/golang/sync/compare/v0.2.0...v0.3.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sync
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-19 10:56:29 +00:00
dependabot[bot]
992d37cc42
build(deps): bump github.com/mattn/go-sqlite3 from 1.14.16 to 1.14.17
Bumps [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) from 1.14.16 to 1.14.17.
- [Release notes](https://github.com/mattn/go-sqlite3/releases)
- [Commits](https://github.com/mattn/go-sqlite3/compare/v1.14.16...v1.14.17)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-sqlite3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-05 10:56:32 +00:00
dependabot[bot]
1930192a37
build(deps): bump github.com/stretchr/testify from 1.8.3 to 1.8.4
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.3 to 1.8.4.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.3...v1.8.4)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-05 10:56:29 +00:00
Julian Brost
78fa223cab
Merge pull request #559 from Icinga/segv
Heartbeat#sendEvent(m): nil-check m before dereferencing it
2023-06-05 12:54:29 +02:00
Julian Brost
049a62b6cb
Merge pull request #583 from Icinga/inconsistent-retry-behavior-between-tcp-and-unix-sockets-543
retry.Retryable(): treat ENOENT (AF_UNIX) like ECONNREFUSED, i.e. also retry
2023-06-05 12:52:02 +02:00
Julian Brost
3c0fbf0e5a
Merge pull request #584 from Icinga/name-column-in-the-notification-table-is-too-short-579
schema: notification: enlarge name and name_ci 255 -> 767
2023-06-05 12:48:17 +02:00
Alexander A. Klimov
a3c1007d47 retry.Retryable(): treat ENOENT (AF_UNIX) like ECONNREFUSED, i.e. also retry
During connect(2) we may get ECONNREFUSED between server's bind(2) and
listen(2), but the most downtime between boot and service start the socket
won't exist, yet. I.e. ENOENT is the de facto ECONNREFUSED of *nix sockets.
2023-06-05 11:21:45 +02:00
dependabot[bot]
50d18e68b0 build(deps): bump github.com/creasty/defaults from 1.6.0 to 1.7.0
Bumps [github.com/creasty/defaults](https://github.com/creasty/defaults) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/creasty/defaults/releases)
- [Commits](https://github.com/creasty/defaults/compare/v1.6.0...v1.7.0)

---
updated-dependencies:
- dependency-name: github.com/creasty/defaults
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-30 10:25:42 +02:00
dependabot[bot]
d4618a07fb build(deps): bump github.com/go-sql-driver/mysql from 1.7.0 to 1.7.1
Bumps [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/go-sql-driver/mysql/releases)
- [Changelog](https://github.com/go-sql-driver/mysql/blob/master/CHANGELOG.md)
- [Commits](https://github.com/go-sql-driver/mysql/compare/v1.7.0...v1.7.1)

---
updated-dependencies:
- dependency-name: github.com/go-sql-driver/mysql
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-30 10:25:22 +02:00
dependabot[bot]
a5bfdb2405 build(deps): bump github.com/lib/pq from 1.10.7 to 1.10.9
Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.10.7 to 1.10.9.
- [Release notes](https://github.com/lib/pq/releases)
- [Commits](https://github.com/lib/pq/compare/v1.10.7...v1.10.9)

---
updated-dependencies:
- dependency-name: github.com/lib/pq
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-30 10:25:00 +02:00
Alexander A. Klimov
3d571548e8 icingadb-migrate: handle NULL event time columns
Ignore such rows.
2023-05-26 12:50:41 +02:00
Alexander A. Klimov
e776c99ede Merge network and database error retryability detection functions
so that connection attempts will also be re-tried on RDBMS-specific errors,
e.g. Postgres' 57P03 (the database system is starting up), not to crash.
On the other hand, SQL operations which are safe to retry on SQL errors
are also safe to retry on network errors.
2023-05-26 12:21:09 +02:00
Alexander Aleksandrovič Klimov
022f6d66a7
Merge pull request #590 from Icinga/dependabot/go_modules/github.com/goccy/go-yaml-1.11.0
build(deps): bump github.com/goccy/go-yaml from 1.9.6 to 1.11.0
2023-05-24 11:12:02 +02:00
Alexander Aleksandrovič Klimov
34ca456771
Merge pull request #570 from Icinga/dependabot/go_modules/tests/golang.org/x/net-0.7.0
build(deps): bump golang.org/x/net from 0.0.0-20211020060615-d418f374d309 to 0.7.0 in /tests
2023-05-24 11:11:31 +02:00
Alexander Aleksandrovič Klimov
6571e6eef6
Merge pull request #592 from Icinga/dependabot/go_modules/tests/github.com/opencontainers/image-spec-1.0.2
build(deps): bump github.com/opencontainers/image-spec from 1.0.1 to 1.0.2 in /tests
2023-05-23 17:37:39 +02:00
Alexander Aleksandrovič Klimov
f1ac1d7d1e
Merge pull request #591 from Icinga/dependabot/go_modules/tests/github.com/docker/distribution-2.8.2incompatible
build(deps): bump github.com/docker/distribution from 2.7.1+incompatible to 2.8.2+incompatible in /tests
2023-05-23 17:33:31 +02:00
dependabot[bot]
08c24fc4a1
build(deps): bump github.com/goccy/go-yaml from 1.9.6 to 1.11.0
Bumps [github.com/goccy/go-yaml](https://github.com/goccy/go-yaml) from 1.9.6 to 1.11.0.
- [Release notes](https://github.com/goccy/go-yaml/releases)
- [Changelog](https://github.com/goccy/go-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/goccy/go-yaml/compare/v1.9.6...v1.11.0)

---
updated-dependencies:
- dependency-name: github.com/goccy/go-yaml
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-23 15:19:36 +00:00
Alexander Aleksandrovič Klimov
c6622e7e12
Merge pull request #588 from Icinga/dependabot/go_modules/golang.org/x/sync-0.2.0
build(deps): bump golang.org/x/sync from 0.0.0-20210220032951-036812b2e83c to 0.2.0
2023-05-23 17:18:52 +02:00
dependabot[bot]
8dfc6d0b2f
build(deps): bump github.com/opencontainers/image-spec in /tests
Bumps [github.com/opencontainers/image-spec](https://github.com/opencontainers/image-spec) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/opencontainers/image-spec/releases)
- [Changelog](https://github.com/opencontainers/image-spec/blob/main/RELEASES.md)
- [Commits](https://github.com/opencontainers/image-spec/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/image-spec
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-23 15:07:17 +00:00
dependabot[bot]
02e3718358
build(deps): bump github.com/docker/distribution in /tests
Bumps [github.com/docker/distribution](https://github.com/docker/distribution) from 2.7.1+incompatible to 2.8.2+incompatible.
- [Release notes](https://github.com/docker/distribution/releases)
- [Commits](https://github.com/docker/distribution/compare/v2.7.1...v2.8.2)

---
updated-dependencies:
- dependency-name: github.com/docker/distribution
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-23 15:07:13 +00:00
Alexander Aleksandrovič Klimov
90ec64771c
Merge pull request #587 from Icinga/dependabot/go_modules/tests/github.com/docker/docker-20.10.24incompatible
build(deps): bump github.com/docker/docker from 20.10.8+incompatible to 20.10.24+incompatible in /tests
2023-05-23 17:06:17 +02:00
Alexander Aleksandrovič Klimov
d3ce245631
Merge pull request #589 from Icinga/dependabot/go_modules/github.com/stretchr/testify-1.8.3
build(deps): bump github.com/stretchr/testify from 1.8.1 to 1.8.3
2023-05-23 17:02:04 +02:00
dependabot[bot]
d6f7affece
build(deps): bump golang.org/x/net in /tests
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20211020060615-d418f374d309 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/commits/v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-23 14:32:11 +00:00
dependabot[bot]
fbbf4edf71
build(deps): bump github.com/stretchr/testify from 1.8.1 to 1.8.3
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.1 to 1.8.3.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.1...v1.8.3)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-23 14:31:20 +00:00