From 50382140094cddf90d0d7a2548f8ca5d21f876c1 Mon Sep 17 00:00:00 2001 From: teutat3s <10206665+teutat3s@users.noreply.github.com> Date: Tue, 25 Oct 2022 12:34:13 +0200 Subject: [PATCH 1/4] Add nix flake: devshell --- .envrc | 13 ++++++ .gitignore | 3 ++ devshell/.gitignore | 1 + devshell/devshell.toml | 4 ++ devshell/flake.lock | 92 ++++++++++++++++++++++++++++++++++++++++++ devshell/flake.nix | 24 +++++++++++ 6 files changed, 137 insertions(+) create mode 100644 .envrc create mode 100644 devshell/.gitignore create mode 100644 devshell/devshell.toml create mode 100644 devshell/flake.lock create mode 100644 devshell/flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 00000000..b027ddb2 --- /dev/null +++ b/.envrc @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# ^ added for shellcheck and file-type detection + +# Watch & reload direnv on change +cd devshell || exit +watch_file devshell.toml + +if [[ $(type -t use_flake) != function ]]; then + echo "ERROR: use_flake function missing." + echo "Please update direnv to v2.30.0 or later." + exit 1 +fi +use flake diff --git a/.gitignore b/.gitignore index f0de52cd..f6a2e888 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,6 @@ cover.html # IDE files .idea *.iml + +# Nix files +.direnv diff --git a/devshell/.gitignore b/devshell/.gitignore new file mode 100644 index 00000000..04744984 --- /dev/null +++ b/devshell/.gitignore @@ -0,0 +1 @@ +/.direnv/ \ No newline at end of file diff --git a/devshell/devshell.toml b/devshell/devshell.toml new file mode 100644 index 00000000..4b8c8bff --- /dev/null +++ b/devshell/devshell.toml @@ -0,0 +1,4 @@ +# https://numtide.github.io/devshell +[[commands]] +package = "devshell.cli" +help = "Per project developer environments" diff --git a/devshell/flake.lock b/devshell/flake.lock new file mode 100644 index 00000000..4fd012a9 --- /dev/null +++ b/devshell/flake.lock @@ -0,0 +1,92 @@ +{ + "nodes": { + "devshell": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1666548262, + "narHash": "sha256-4DyN4KXqQQsCw0vCXkMThw4b5Q4/q87ZZgRb4st8COc=", + "owner": "numtide", + "repo": "devshell", + "rev": "c8ce8ed81726079c398f5f29c4b68a7d6a3c2fa2", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1642700792, + "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1643381941, + "narHash": "sha256-pHTwvnN4tTsEKkWlXQ8JMY423epos8wUOhthpwJjtpc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5efc8ca954272c4376ac929f4c5ffefcc20551d5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1666659249, + "narHash": "sha256-Qbyj7ya2ZTL5Vt5ONMUwgq/shNSqZVbxDInQbmDO5iw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d4f8e53720b554b6dac71c7ec62b3b51158905f9", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "devshell": "devshell", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/devshell/flake.nix b/devshell/flake.nix new file mode 100644 index 00000000..f577c697 --- /dev/null +++ b/devshell/flake.nix @@ -0,0 +1,24 @@ +{ + description = "virtual environments"; + + inputs.devshell.url = "github:numtide/devshell"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, flake-utils, devshell, nixpkgs }: + flake-utils.lib.eachDefaultSystem (system: { + devShell = + let pkgs = import nixpkgs { + inherit system; + + overlays = [ devshell.overlay ]; + }; + in + pkgs.devshell.mkShell { + imports = [ (pkgs.devshell.importTOML ./devshell.toml) ]; + devshell.packages = with pkgs; [ + go + gnumake + ]; + }; + }); +} From ea436c77ca89a63cadd932298889f901508dfba2 Mon Sep 17 00:00:00 2001 From: teutat3s <10206665+teutat3s@users.noreply.github.com> Date: Tue, 25 Oct 2022 12:35:26 +0200 Subject: [PATCH 2/4] Bump min. go version to 1.18, 1.17 is EOL Use go version 1.19 as base image Bump consul version to 1.13.3 Update go.mod dependencies --- Dockerfile | 6 ++--- go.mod | 26 +++++++++--------- go.sum | 77 +++++++++++++++++++++++++++++++++--------------------- 3 files changed, 62 insertions(+), 47 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1905a36a..26340d00 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ -FROM golang:1.18 +FROM golang:1.19 -ENV CONSUL_VERSION=1.11.4 +ENV CONSUL_VERSION=1.13.3 RUN apt-get update \ && apt-get install -y unzip \ && go install honnef.co/go/tools/cmd/staticcheck@latest -RUN export CONSUL_CHECKSUM=5155f6a3b7ff14d3671b0516f6b7310530b509a2b882b95b4fdf25f4219342c8 \ +RUN export CONSUL_CHECKSUM=5370b0b5bf765530e28cb80f90dcb47bd7d6ba78176c1ab2430f56e460ed279c \ && export archive=consul_${CONSUL_VERSION}_linux_amd64.zip \ && curl -Lso /tmp/${archive} https://releases.hashicorp.com/consul/${CONSUL_VERSION}/${archive} \ && echo "${CONSUL_CHECKSUM} /tmp/${archive}" | sha256sum -c \ diff --git a/go.mod b/go.mod index 758e661e..7383c192 100644 --- a/go.mod +++ b/go.mod @@ -1,17 +1,17 @@ module github.com/joyent/containerpilot -go 1.17 +go 1.18 require ( github.com/client9/reopen v1.0.0 github.com/flynn/json5 v0.0.0-20160717195620-7620272ed633 - github.com/hashicorp/consul/api v1.12.0 - github.com/hashicorp/consul/sdk v0.9.0 + github.com/hashicorp/consul/api v1.15.3 + github.com/hashicorp/consul/sdk v0.11.0 github.com/hashicorp/go-cleanhttp v0.5.2 - github.com/mitchellh/mapstructure v1.4.3 - github.com/prometheus/client_golang v1.12.1 - github.com/sirupsen/logrus v1.8.1 - github.com/stretchr/testify v1.7.0 + github.com/mitchellh/mapstructure v1.5.0 + github.com/prometheus/client_golang v1.13.0 + github.com/sirupsen/logrus v1.9.0 + github.com/stretchr/testify v1.8.1 ) require ( @@ -23,9 +23,7 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/hashicorp/go-hclog v1.2.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-msgpack v0.5.5 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect - github.com/hashicorp/go-sockaddr v1.0.2 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/hashicorp/serf v0.9.7 // indirect github.com/kylelemons/godebug v1.1.0 // indirect @@ -35,10 +33,10 @@ require ( github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.33.0 // indirect - github.com/prometheus/procfs v0.7.3 // indirect + github.com/prometheus/common v0.37.0 // indirect + github.com/prometheus/procfs v0.8.0 // indirect github.com/robertkrimen/otto v0.0.0-20211024170158-b87d35c0b86f // indirect - golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect - google.golang.org/protobuf v1.28.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect + golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect + google.golang.org/protobuf v1.28.1 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 34305b72..ce56e16f 100644 --- a/go.sum +++ b/go.sum @@ -63,6 +63,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/client9/reopen v1.0.0 h1:8tpLVR74DLpLObrn2KvsyxJY++2iORGR17WLUdSzUws= github.com/client9/reopen v1.0.0/go.mod h1:caXVCEr+lUtoN1FlsRiOWdfQtdRHIYfcb0ai8qKWtkQ= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -128,8 +129,10 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -143,11 +146,10 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/hashicorp/consul/api v1.12.0 h1:k3y1FYv6nuKyNTqj6w9gXOx5r5CfLj/k/euUeBXj1OY= -github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= -github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= -github.com/hashicorp/consul/sdk v0.9.0 h1:NGSHAU7X3yDCjo8WBUbNOtD3BSqv8u0vu3+zNxgmxQI= -github.com/hashicorp/consul/sdk v0.9.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= +github.com/hashicorp/consul/api v1.15.3 h1:WYONYL2rxTXtlekAqblR2SCdJsizMDIj/uXb5wNy9zU= +github.com/hashicorp/consul/api v1.15.3/go.mod h1:/g/qgcoBcEXALCNZgRRisyTW0nY86++L0KbeAMXYCeY= +github.com/hashicorp/consul/sdk v0.11.0 h1:HRzj8YSCln2yGgCumN5CL8lYlD3gBurnervJRJAZyC4= +github.com/hashicorp/consul/sdk v0.11.0/go.mod h1:yPkX5Q6CsxTFMjQQDJwzeNmUUF5NUGGbrDsv9wTb8cw= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -155,17 +157,20 @@ github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= @@ -174,17 +179,18 @@ github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0S github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= -github.com/hashicorp/memberlist v0.3.0 h1:8+567mCcFDnS5ADl7lrpxPMWiFCElyUEeW0gtj34fMA= github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= +github.com/hashicorp/memberlist v0.3.1 h1:MXgUXLqva1QvpVEDQW1IQLG0wivQAtmFlHRQ+1vWZfM= +github.com/hashicorp/memberlist v0.3.1/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.9.7 h1:hkdgbqizGQHuU5IPqYM1JdSMV8nKfpuOnZYXssk9muY= github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -203,11 +209,13 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -232,12 +240,11 @@ github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceT github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= -github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -261,8 +268,9 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= +github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -273,15 +281,16 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.33.0 h1:rHgav/0a6+uYgGdNt3jwz8FNSesO/Hsang3O0T9A5SE= -github.com/prometheus/common v0.33.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= +github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/robertkrimen/otto v0.0.0-20211024170158-b87d35c0b86f h1:a7clxaGmmqtdNTXyvrp/lVO/Gnkzlhc/+dLs5v965GM= github.com/robertkrimen/otto v0.0.0-20211024170158-b87d35c0b86f/go.mod h1:/mK7FZ3mFYEn9zvNPhpngTyatyehSwte5bJZ4ehL5Xw= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -292,16 +301,21 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -380,6 +394,7 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -400,6 +415,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -425,7 +441,6 @@ golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -450,8 +465,10 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -508,7 +525,6 @@ golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -585,8 +601,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -603,8 +619,9 @@ gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 9b31d52066844fcfc2f3f6680d780f7cf7c52ad8 Mon Sep 17 00:00:00 2001 From: teutat3s <10206665+teutat3s@users.noreply.github.com> Date: Tue, 25 Oct 2022 12:41:26 +0200 Subject: [PATCH 3/4] Support service meta data TritonDataCenter/containerpilot#592 TritonDataCenter/containerpilot#593 All credits and thanks to Luc Willems Co-authored-by: Luc Willems --- config/config_test.go | 1 + config/testdata/test.json5 | 5 ++- discovery/consul_test.go | 39 +++++++++++++++++++ discovery/service.go | 2 + .../30-configuration/32-configuration-file.md | 4 ++ docs/30-configuration/34-jobs.md | 8 ++++ jobs/config.go | 12 +++--- 7 files changed, 65 insertions(+), 6 deletions(-) diff --git a/config/config_test.go b/config/config_test.go index 89b352ae..03e2b2b9 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -33,6 +33,7 @@ func TestValidConfigJobs(t *testing.T) { assert.Equal(job0.Port, 8080, "config for job0.Port") assert.Equal(job0.Exec, "/bin/serviceA", "config for job0.Exec") assert.Equal(job0.Tags, []string{"tag1", "tag2"}, "config for job0.Tags") + assert.Equal(job0.Meta, map[string]string{"keyA": "A"}, "config for job0.Meta") assert.Equal(job0.Restarts, nil, "config for job1.Restarts") job1 := cfg.Jobs[1] diff --git a/config/testdata/test.json5 b/config/testdata/test.json5 index 70c912ae..b2b1bfce 100644 --- a/config/testdata/test.json5 +++ b/config/testdata/test.json5 @@ -18,7 +18,10 @@ interval: 19, ttl: 30, }, - tags: ["tag1","tag2"] + tags: ["tag1","tag2"], + meta: { + keyA: "A", + } }, { name: "serviceB", diff --git a/discovery/consul_test.go b/discovery/consul_test.go index bd6ea898..ba8289db 100644 --- a/discovery/consul_test.go +++ b/discovery/consul_test.go @@ -84,6 +84,7 @@ func TestWithConsul(t *testing.T) { t.Run("TestConsulReregister", testConsulReregister(testServer)) t.Run("TestConsulCheckForChanges", testConsulCheckForChanges(testServer)) t.Run("TestConsulEnableTagOverride", testConsulEnableTagOverride(testServer)) + t.Run("testConsulTagsMeta", testConsulTagsMeta(testServer)) } func testConsulTTLPass(testServer *TestServer) func(*testing.T) { @@ -146,6 +147,39 @@ func testConsulReregister(testServer *TestServer) func(*testing.T) { } } +func contains(s []string, str string) bool { + for _, v := range s { + if v == str { + return true + } + } + + return false +} + +func testConsulTagsMeta(testServer *TestServer) func(*testing.T) { + return func(t *testing.T) { + consul, _ := NewConsul(testServer.HTTPAddr) + name := "TestConsulReregister" + service := generateServiceDefinition(name, consul) + id := service.ID + + service.SendHeartbeat() // force registration and 1st heartbeat + services, _ := consul.Agent().Services() + svc := services[id] + if !contains(svc.Tags, "a") || !contains(svc.Tags, "b") { + t.Fatalf("first tag must containt a & b but is %s", svc.Tags) + } + if svc.Meta["keyA"] != "A" { + t.Fatalf("first meta must containt keyA:A but is %s", svc.Meta["keyA"]) + } + if svc.Meta["keyB"] != "B" { + t.Fatalf("first meta must containt keyB:B but is %s", svc.Meta["keyB"]) + } + + } +} + func testConsulCheckForChanges(testServer *TestServer) func(*testing.T) { return func(t *testing.T) { backend := "TestConsulCheckForChanges" @@ -211,5 +245,10 @@ func generateServiceDefinition(serviceName string, consul *Consul) *ServiceDefin TTL: 5, Port: 9000, Consul: consul, + Tags: []string{"a", "b"}, + Meta: map[string]string{ + "keyA": "A", + "keyB": "B", + }, } } diff --git a/discovery/service.go b/discovery/service.go index b99211bd..8ce302f8 100644 --- a/discovery/service.go +++ b/discovery/service.go @@ -15,6 +15,7 @@ type ServiceDefinition struct { Port int TTL int Tags []string + Meta map[string]string InitialStatus string IPAddress string EnableTagOverride bool @@ -93,6 +94,7 @@ func (service *ServiceDefinition) registerService(status string) error { ID: service.ID, Name: service.Name, Tags: service.Tags, + Meta: service.Meta, Port: service.Port, Address: service.IPAddress, EnableTagOverride: service.EnableTagOverride, diff --git a/docs/30-configuration/32-configuration-file.md b/docs/30-configuration/32-configuration-file.md index 2c3b21ab..75bbfc99 100644 --- a/docs/30-configuration/32-configuration-file.md +++ b/docs/30-configuration/32-configuration-file.md @@ -60,6 +60,10 @@ The following is a completed example of the JSON5 file configuration schema, wit "app", "prod" ], + meta: { + keyA: "A", + keyB: "B", + }, interfaces: [ "eth0", "eth1[1]", diff --git a/docs/30-configuration/34-jobs.md b/docs/30-configuration/34-jobs.md index fac2e032..4e237145 100644 --- a/docs/30-configuration/34-jobs.md +++ b/docs/30-configuration/34-jobs.md @@ -81,6 +81,10 @@ jobs: [ "app", "prod" ], + meta: { + keyA: "A", + keyB: "B", + }, interfaces: [ "eth0", "eth1[1]", @@ -241,6 +245,10 @@ The `initial_status` field is optional and specifies which status to immediately The `tags` field is an optional array of tags to be used when the job is registered as a service in Consul. Other containers can use these tags in `watches` to filter a service by tag. +##### `meta` + +The `meta` field is an optional map key/value to be used when the job is registered as a service in Consul. Key names must be valid JSON5/Ecmascript identifierNames or be quoted and follow consul limitation , practical this means only [a-zA-Z0-9_-] can be used in key names and key names with '-' must be quoted + ##### `interfaces` The `interfaces` field is an optional single or array of interface specifications. If given, the IP of the service will be obtained from the first interface specification that matches. (Default value is `["eth0:inet"]`). The value that ContainerPilot uses for the IP address of the interface will be set as an environment variable with the name `CONTAINERPILOT_{JOB}_IP`. See the [environment variables](./32-configuration-file.md#environment-variables) section. diff --git a/jobs/config.go b/jobs/config.go index a78ffeb3..f0717192 100644 --- a/jobs/config.go +++ b/jobs/config.go @@ -25,11 +25,12 @@ type Config struct { GID int `mapstructure:"gid"` // service discovery - Port int `mapstructure:"port"` - InitialStatus string `mapstructure:"initial_status"` - Interfaces interface{} `mapstructure:"interfaces"` - Tags []string `mapstructure:"tags"` - ConsulExtras *ConsulExtras `mapstructure:"consul"` + Port int `mapstructure:"port"` + InitialStatus string `mapstructure:"initial_status"` + Interfaces interface{} `mapstructure:"interfaces"` + Tags []string `mapstructure:"tags"` + Meta map[string]string `mapstructure:"meta"` + ConsulExtras *ConsulExtras `mapstructure:"consul"` serviceDefinition *discovery.ServiceDefinition // health checking @@ -434,6 +435,7 @@ func (cfg *Config) addDiscoveryConfig(disc discovery.Backend) error { Port: cfg.Port, TTL: cfg.ttl, Tags: cfg.Tags, + Meta: cfg.Meta, InitialStatus: cfg.InitialStatus, IPAddress: ipAddress, DeregisterCriticalServiceAfter: deregAfter, From 8c5e115857f645b5cee4d2ff88190e00b2226916 Mon Sep 17 00:00:00 2001 From: teutat3s <10206665+teutat3s@users.noreply.github.com> Date: Tue, 25 Oct 2022 12:46:07 +0200 Subject: [PATCH 4/4] Fix linter errors Multiple: "io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (SA1019) discovery/consul_test.go:163:11: unnecessary use of fmt.Sprintf (S1039) --- config/config.go | 6 +++--- config/config_test.go | 5 ++--- config/logger/logging_test.go | 3 +-- control/endpoints.go | 5 ++--- control/endpoints_test.go | 4 ++-- core/app_test.go | 3 +-- jobs/config_test.go | 10 +++++----- telemetry/metrics_test.go | 4 ++-- telemetry/telemetry_config_test.go | 4 ++-- watches/config_test.go | 4 ++-- 10 files changed, 22 insertions(+), 26 deletions(-) diff --git a/config/config.go b/config/config.go index 676b3ade..7e220567 100644 --- a/config/config.go +++ b/config/config.go @@ -6,7 +6,7 @@ import ( "bytes" "errors" "fmt" - "io/ioutil" + "os" "strings" "github.com/flynn/json5" @@ -79,7 +79,7 @@ func RenderConfig(configFlag, renderFlag string) error { fmt.Printf("%s", renderedConfig) } else { var err error - if err = ioutil.WriteFile(renderFlag, renderedConfig, 0644); err != nil { + if err = os.WriteFile(renderFlag, renderedConfig, 0644); err != nil { return fmt.Errorf("could not write config file: %s", err) } } @@ -108,7 +108,7 @@ func loadConfigFile(configFlag string) ([]byte, error) { if configFlag == "" { return nil, errors.New("-config flag is required") } - data, err := ioutil.ReadFile(configFlag) + data, err := os.ReadFile(configFlag) if err != nil { return nil, fmt.Errorf("could not read config file: %s", err) } diff --git a/config/config_test.go b/config/config_test.go index 03e2b2b9..f7f99472 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -1,7 +1,6 @@ package config import ( - "io/ioutil" "os" "path/filepath" "testing" @@ -185,8 +184,8 @@ func TestRenderConfigFileStdout(t *testing.T) { temp.Close() os.Stdout = old - renderedOut, _ := ioutil.ReadFile(fname) - renderedFile, _ := ioutil.ReadFile("testJSON.json") + renderedOut, _ := os.ReadFile(fname) + renderedFile, _ := os.ReadFile("testJSON.json") if string(renderedOut) != string(renderedFile) { t.Fatalf("expected the rendered file and stdout to be identical") } diff --git a/config/logger/logging_test.go b/config/logger/logging_test.go index 393fe475..c69372dc 100644 --- a/config/logger/logging_test.go +++ b/config/logger/logging_test.go @@ -1,7 +1,6 @@ package logger import ( - "io/ioutil" "os" "reflect" "strings" @@ -84,7 +83,7 @@ func TestFileLogger(t *testing.T) { // write a log message logMsg := "this is a test" logrus.Info(logMsg) - content, err := ioutil.ReadFile(filename) + content, err := os.ReadFile(filename) if err != nil { t.Errorf("Did not expect error: %v", err) } diff --git a/control/endpoints.go b/control/endpoints.go index 45e3477a..d56be395 100644 --- a/control/endpoints.go +++ b/control/endpoints.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "os" "strconv" @@ -56,7 +55,7 @@ func (pw PostHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { // process. Returns empty response or HTTP422. func (e Endpoints) PutEnviron(r *http.Request) (interface{}, int) { var postEnv map[string]string - jsonBlob, err := ioutil.ReadAll(r.Body) + jsonBlob, err := io.ReadAll(r.Body) defer r.Body.Close() if err != nil { return nil, http.StatusUnprocessableEntity @@ -110,7 +109,7 @@ func (e Endpoints) PostDisableMaintenanceMode(r *http.Request) (interface{}, int // Returns empty response or HTTP422. func (e Endpoints) PostMetric(r *http.Request) (interface{}, int) { var postMetrics map[string]interface{} - jsonBlob, err := ioutil.ReadAll(r.Body) + jsonBlob, err := io.ReadAll(r.Body) defer r.Body.Close() if err != nil { diff --git a/control/endpoints_test.go b/control/endpoints_test.go index 14dbd9bd..e6444fab 100644 --- a/control/endpoints_test.go +++ b/control/endpoints_test.go @@ -3,7 +3,7 @@ package control import ( "context" "fmt" - "io/ioutil" + "io" "net/http" "net/http/httptest" "os" @@ -65,7 +65,7 @@ func TestPostHandler(t *testing.T) { ph.ServeHTTP(w, req) resp := w.Result() defer resp.Body.Close() - body, _ := ioutil.ReadAll(resp.Body) + body, _ := io.ReadAll(resp.Body) status := resp.StatusCode return status, string(body) } diff --git a/core/app_test.go b/core/app_test.go index 66111814..c8d18109 100644 --- a/core/app_test.go +++ b/core/app_test.go @@ -2,7 +2,6 @@ package core import ( "fmt" - "io/ioutil" "os" "strings" "testing" @@ -152,7 +151,7 @@ func TestReloadConfig(t *testing.T) { // write the configuration to a tempfile. caller is responsible // for calling 'defer os.Remove(f.Name())' when done func testCfgToTempFile(t *testing.T, text string) *os.File { - f, err := ioutil.TempFile(".", "test-") + f, err := os.CreateTemp(".", "test-") if err != nil { t.Fatal(err) } diff --git a/jobs/config_test.go b/jobs/config_test.go index be5661f2..ab527db6 100644 --- a/jobs/config_test.go +++ b/jobs/config_test.go @@ -2,7 +2,7 @@ package jobs import ( "fmt" - "io/ioutil" + "os" "testing" "time" @@ -167,7 +167,7 @@ func TestJobConfigConsulExtras(t *testing.T) { } func TestJobConfigSmokeTest(t *testing.T) { - data, _ := ioutil.ReadFile(fmt.Sprintf("./testdata/%s.json5", t.Name())) + data, _ := os.ReadFile(fmt.Sprintf("./testdata/%s.json5", t.Name())) testCfg := tests.DecodeRawToSlice(string(data)) assert := assert.New(t) @@ -287,7 +287,7 @@ func TestJobConfigValidateDiscovery(t *testing.T) { } func TestErrJobConfigConsulEnableTagOverride(t *testing.T) { - testCfg, _ := ioutil.ReadFile(fmt.Sprintf("./testdata/%s.json5", t.Name())) + testCfg, _ := os.ReadFile(fmt.Sprintf("./testdata/%s.json5", t.Name())) _, err := NewConfigs(tests.DecodeRawToSlice(string(testCfg)), noop) if err == nil { t.Errorf("ConsulExtras should have thrown error about EnableTagOverride being a string.") @@ -295,7 +295,7 @@ func TestErrJobConfigConsulEnableTagOverride(t *testing.T) { } func TestErrJobConfigConsulDeregisterCriticalServiceAfter(t *testing.T) { - testCfg, _ := ioutil.ReadFile(fmt.Sprintf("./testdata/%s.json5", t.Name())) + testCfg, _ := os.ReadFile(fmt.Sprintf("./testdata/%s.json5", t.Name())) _, err := NewConfigs(tests.DecodeRawToSlice(string(testCfg)), noop) if err == nil { t.Errorf("error should have been generated for duration 'nope'.") @@ -471,7 +471,7 @@ func TestHealthChecksConfigError(t *testing.T) { var noop = &mocks.NoopDiscoveryBackend{} func loadTestConfig(t *testing.T) []*Config { - data, _ := ioutil.ReadFile(fmt.Sprintf("./testdata/%s.json5", t.Name())) + data, _ := os.ReadFile(fmt.Sprintf("./testdata/%s.json5", t.Name())) testCfg := tests.DecodeRawToSlice(string(data)) jobs, err := NewConfigs(testCfg, noop) diff --git a/telemetry/metrics_test.go b/telemetry/metrics_test.go index 52ac2412..13ab0bef 100644 --- a/telemetry/metrics_test.go +++ b/telemetry/metrics_test.go @@ -3,7 +3,7 @@ package telemetry import ( "context" "fmt" - "io/ioutil" + "io" "net/http" "net/http/httptest" "reflect" @@ -270,7 +270,7 @@ func getFromTestServer(t *testing.T, testServer *httptest.Server) string { t.Fatal(err) } else { defer res.Body.Close() - if resp, err := ioutil.ReadAll(res.Body); err != nil { + if resp, err := io.ReadAll(res.Body); err != nil { t.Fatal(err) } else { response := string(resp) diff --git a/telemetry/telemetry_config_test.go b/telemetry/telemetry_config_test.go index 51ccf377..b2cb4dfc 100644 --- a/telemetry/telemetry_config_test.go +++ b/telemetry/telemetry_config_test.go @@ -2,7 +2,7 @@ package telemetry import ( "fmt" - "io/ioutil" + "os" "strings" "testing" @@ -13,7 +13,7 @@ import ( ) func TestTelemetryConfigParse(t *testing.T) { - data, _ := ioutil.ReadFile(fmt.Sprintf("./testdata/%s.json5", t.Name())) + data, _ := os.ReadFile(fmt.Sprintf("./testdata/%s.json5", t.Name())) testCfg := tests.DecodeRaw(string(data)) telem, err := NewConfig(testCfg, &mocks.NoopDiscoveryBackend{}) if err != nil { diff --git a/watches/config_test.go b/watches/config_test.go index f034afc0..3e644c3b 100644 --- a/watches/config_test.go +++ b/watches/config_test.go @@ -2,7 +2,7 @@ package watches import ( "fmt" - "io/ioutil" + "os" "testing" "github.com/stretchr/testify/assert" @@ -11,7 +11,7 @@ import ( ) func TestWatchesParse(t *testing.T) { - data, _ := ioutil.ReadFile(fmt.Sprintf("./testdata/%s.json5", t.Name())) + data, _ := os.ReadFile(fmt.Sprintf("./testdata/%s.json5", t.Name())) testCfg := tests.DecodeRawToSlice(string(data)) watches, err := NewConfigs(testCfg, nil) if err != nil {