- do not close connection of exec process before having read everything
- as a backwards-compatible fix, we now read all logs into a new
bufio.Reader so we can savely close the connection and original reader
- start tools node with --add-host=host.k3d.internal:host-gateway
(docker feature) and use it for getHostIP on DfD (TODO: we can use this
on all platforms)
- use `k3d-tools` (classic) image importing for remote docker hosts
- use direct streaming into the nodes (node exec with stdin) on local docker connections
- new special internal role `initServer` used only to determine the correct ready-log-message
- ready-log-messages now looked up by role and new `Intent` type (cluster-create/cluster-start/node-create/node-start), as especially for the init server there are different log messages indicating that we can proceed with the next step
- moving types around:
- K3s env vars now under .../types/k3s/env.go
- defaults now under .../types/defaults.go
- ...
- improved waiting for log messages
- not checking the whole log again and again in a loop
- follow log with a single reader (and retry in case we see a fatal error, meaning that the K3s container will restart -> backoff after 10 tries)
- BREAKING: new `*runtimeTypes.NodeLogsOpts` parameter in GetNodeLogs
- `--cluster` flag parsed for `https://` prefix and node creation treated differently accordingly
- new `--network` string array flag to add the node to multiple networks (primary network when adding to a remote cluster)
- new `--token` flag to provide the cluster token
This comes with several fixes/improvements
- only consider containers that have the default object label (app=k3d)
- handle network deletion
- check if there are other k3d containers connected
- if there are only registries, disconnect them
- if there are non-registry nodes, leave everything as it is
- if there are any containers connected, that are not automatically
disconnected, log a warning and continue
- sometimes, the exec process returns a non-zero exit code but still has
logs which are helpful for us
- sometimes everything fails and we should gracefully handle this
- loads images from tarballs and runtime
- only tries to do something if respective lists are not empty
- only creates tools node if it's not present yet
- uses new tools image to remove tarballs after process
- fixes startCluster's --wait/--timeout functionality
--> now doesn't check all the logs (e.g. from previous run)
----> no more false positives when checking for a specifc log message
only in the current run
- we now use the full containerJSON details when getting a node
- we now use as many details as possible to copy k3d settings from an
existing node when adding a new node to a running cluster