clockoffset

command module
v0.0.0-...-47c196a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2021 License: MIT Imports: 6 Imported by: 0

README

Shows the time offset to the given NTP server in various formats. Breaks if the time offset reaches a given limit.

Useful for initContainers when accurate time is required (e.g. at minikube, when the host has not yet synchronized the time after wakeup).

Usage

-format string
      output formats:
        s    seconds
        ms   miliseconds
        us   microseconds
        h    human readable
       (default "ms")
-limit int
      exit(2) if offset diff is greather than <n> ms
-ntpserver string
      ntp server hostname
-quiet
      suppress output to standard output
-sleep int
      sleep for <n> ms if the limit was exceeded

Docker example

docker run --rm jb5r/clockoffset \
  -ntpserver time.google.com \
  -format h \
  -limit 20000

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL