13 Commits

Author SHA1 Message Date
Andrey Smirnov
8560fb9662 chore: enable nlreturn linter
Most of the fixes were automatically applied.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-11-09 06:48:07 -08:00
Andrew Rynhard
562ab1d572 chore: update golangci-lint
Brings in the latest version of golangci-lint and addresses errors.

Signed-off-by: Andrew Rynhard <andrew@rynhard.io>
2020-11-02 20:34:05 -08:00
Andrey Smirnov
f6ecf000c9 refactor: extract packages loadbalancer and retry
This removes in-tree packages in favor of:

* github.com/talos-systems/go-retry
* github.com/talos-systems/go-loadbalancer

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-09-02 13:46:22 -07:00
Andrew Rynhard
d4f103ffcb fix: pass config via stdin
In order to perform upgrades the way we would like, it is important that
we avoid any bind mounts into containers. This change ensures that all
system services get their config via stdin.

Signed-off-by: Andrew Rynhard <andrew@rynhard.io>
2020-08-20 15:26:13 -07:00
Andrey Smirnov
bddd4f1bf6 refactor: move external API packages into machinery/
This moves `pkg/config`, `pkg/client` and `pkg/constants`
under `pkg/machinery` umbrella.

And `pkg/machinery` is published as Go module inside Talos repository.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-08-17 09:56:14 -07:00
Andrey Smirnov
47608fb874 refactor: make pkg/config not rely on machined/../internal/runtime
This makes `pkg/config` directly importable from other projects.

There should be no functional changes.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-07-29 12:40:12 -07:00
Andrey Smirnov
e9d6271549 fix: update status when adjusting the time
Status big `STA_UNSYNC` should be cleared otherwise kernel assumes that
time is not sync. `STA_PLL` is set to notify kernel that we apply offset
adjustments periodically.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-07-29 10:53:38 -07:00
Andrey Smirnov
020aea1b89 fix: fail ntpd service if initial time sync fails
Talos depends on accurate time for many actions, so many services depend
on timed successful health check. If timed fails to do initial sync, it
enters pretty long wait loop for the next attempt which might not come
in time for the boot timeout. Instead, fail timed service on initial
sync and rely on service restart for another attempt.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-07-28 08:44:58 -07:00
Andrey Smirnov
686dcc6743 chore: enable 'testpackage' linter
This linter makes sure tests are excercising only public package API.

I fixed all the tests which touch only public API of the packages. For
other test packages I added proper `//nolint` directive.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-06-30 16:42:28 -07:00
Andrey Smirnov
81d1c2bfe7 chore: enable godot linter
Issues were fixed automatically.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-06-30 10:39:56 -07:00
Andrey Smirnov
d1a4e6ee64 feat: adjust time properly in timed via adjtime()
This should be proper way to adjust time incrementally without causing
jumps one in +/- direction. Time-sensitive services might be confused by
huge jumps.

This also implements timed healh check based on first successful time
sync.

Fixed some random health check related issues in other services.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-06-03 09:39:48 -07:00
Andrew Rynhard
49307d554d refactor: improve machined
This is a rewrite of machined. It addresses some of the limitations and
complexity in the implementation. This introduces the idea of a
controller. A controller is responsible for managing the runtime, the
sequencer, and a new state type introduced in this PR.

A few highlights are:

- no more event bus
- functional approach to tasks (no more types defined for each task)
  - the task function definition now offers a lot more context, like
    access to raw API requests, the current sequence, a logger, the new
    state interface, and the runtime interface.
- no more panics to handle reboots
- additional initialize and reboot sequences
- graceful gRPC server shutdown on critical errors
- config is now stored at install time to avoid having to download it at
  install time and at boot time
- upgrades now use the local config instead of downloading it
- the upgrade API's preserve option takes precedence over the config's
  install force option

Additionally, this pulls various packes in under machined to make the
code easier to navigate.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2020-04-28 08:20:55 -07:00
Andrew Rynhard
7cf28dc805 refactor: rename ntpd to timed
This renames the ntpd application to timed.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2020-04-13 15:02:26 -07:00