Added dashboard

This commit is contained in:
Anders Roos 2022-11-10 23:32:26 +01:00
parent d744c34886
commit 130429b10a
22 changed files with 2986 additions and 14 deletions

View file

@ -88,12 +88,12 @@ func (client MockClient) ExecuteCommand(_ t.ContainerID, command string, _ int)
}
// IsContainerStale is true if not explicitly stated in TestData for the mock client
func (client MockClient) IsContainerStale(cont container.Container) (bool, t.ImageID, error) {
func (client MockClient) IsContainerStale(cont container.Container) (bool, t.ImageID, string, error) {
stale, found := client.TestData.Staleness[cont.Name()]
if !found {
stale = true
}
return stale, "", nil
return stale, "", "", nil
}
// WarnOnHeadPullFailed is always true for the mock client

View file

@ -34,7 +34,7 @@ func Update(client container.Client, params types.UpdateParams) (types.Report, e
staleCheckFailed := 0
for i, targetContainer := range containers {
stale, newestImage, err := client.IsContainerStale(targetContainer)
stale, newestImage, _, err := client.IsContainerStale(targetContainer)
shouldUpdate := stale && !params.NoRestart && !params.MonitorOnly && !targetContainer.IsMonitorOnly()
if err == nil && shouldUpdate {
// Check to make sure we have all the necessary information for recreating the container

View file

@ -163,6 +163,12 @@ func RegisterSystemFlags(rootCmd *cobra.Command) {
viper.GetBool("WATCHTOWER_HTTP_API_PERIODIC_POLLS"),
"Also run periodic updates (specified with --interval and --schedule) if HTTP API is enabled")
flags.BoolP(
"http-web-dashboard",
"",
viper.GetBool("WATCHTOWER_HTTP_WEB_DASHBOARD"),
"Enables the web dashboard at http://localhost:8001")
// https://no-color.org/
flags.BoolP(
"no-color",