talos/internal/integration/base
Andrey Smirnov dc6ea74c35 fix: random failures in cluster health checks
The problem was that some of the health checks sort the list of the
nodes in place (via `sort.Strings()`). If cluster info provider returns
original slice, it might be mutated in such a way that it gets
corrupted.

We never noticed it before CAPI clusters, as in our tests IPs are
assigned sequentially, and sort operation is a no-op.

Specifically, the problem was with the `Nodes()` function, it returns
`append(controlPlaneNodes, workerNodes...)` slice, which by definition
might share memory with `controlPlaneNodes` slice. For example,
if control plane nodes were `4, 5, 6` and worker nodes were `3`, the
returned slice will be `4, 5, 6, 3`, and it shares memory with
`controlPlaneNodes` slice (firs three items). If we apply `sort` to the
returned slice, it re-orders it as `3, 4, 5, 6`, but as it is done
in-place, the `controlPlaneNodes` slice is now `3, 4, 5`, which is
obviously wrong.

Fix that by always returning a copy of the slice from the functions
implementing `ClusterInfo` interface.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-10-08 07:13:24 -07:00
..
api.go refactor: extract packages loadbalancer and retry 2020-09-02 13:46:22 -07:00
base.go refactor: expose provision as public package 2020-08-12 05:12:05 -07:00
cli.go refactor: extract packages loadbalancer and retry 2020-09-02 13:46:22 -07:00
cluster.go fix: random failures in cluster health checks 2020-10-08 07:13:24 -07:00
discovery_k8s.go refactor: move external API packages into machinery/ 2020-08-17 09:56:14 -07:00
discovery_nok8s.go refactor: move external API packages into machinery/ 2020-08-17 09:56:14 -07:00
flags.go test: implement new class of tests: provision tests (upgrades) 2020-02-21 07:04:03 -08:00
k8s.go chore: enable godot linter 2020-06-30 10:39:56 -07:00
run.go chore: enable godot linter 2020-06-30 10:39:56 -07:00