From 24ee90cd30b212fab9235ec3f104106d786b53aa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 07:07:21 +0000 Subject: [PATCH 01/17] build(deps): bump xresloader/upload-to-github-release Bumps [xresloader/upload-to-github-release](https://github.com/xresloader/upload-to-github-release) from 1.3.8 to 1.3.9. - [Release notes](https://github.com/xresloader/upload-to-github-release/releases) - [Commits](https://github.com/xresloader/upload-to-github-release/compare/v1.3.8...v1.3.9) --- updated-dependencies: - dependency-name: xresloader/upload-to-github-release dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 882dcfb7..82aa28e3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -150,7 +150,7 @@ jobs: chmod -R 0777 ./bin make build-all - name: Upload binaries - uses: xresloader/upload-to-github-release@v1.3.8 + uses: xresloader/upload-to-github-release@v1.3.9 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: From 5c8cecca910195e6edfeb8a8446129159f890808 Mon Sep 17 00:00:00 2001 From: Xabier Larrakoetxea Date: Sat, 26 Nov 2022 08:21:26 +0100 Subject: [PATCH 02/17] Small refactor on generation cmd Signed-off-by: Xabier Larrakoetxea --- cmd/sloth/commands/generate.go | 84 ++++++++++++++++++++-------------- cmd/sloth/commands/validate.go | 12 +++-- 2 files changed, 58 insertions(+), 38 deletions(-) diff --git a/cmd/sloth/commands/generate.go b/cmd/sloth/commands/generate.go index af33a274..2d5c24ae 100644 --- a/cmd/sloth/commands/generate.go +++ b/cmd/sloth/commands/generate.go @@ -238,6 +238,15 @@ func (g generateCommand) Run(ctx context.Context, config RootConfig) error { } } + gen := generator{ + logger: logger, + windowsRepo: windowsRepo, + disableRecordings: g.disableRecordings, + disableAlerts: g.disableAlerts, + disableOptimizedRules: g.disableOptimizedRules, + extraLabels: g.extraLabels, + } + for _, genTarget := range genTargets { dataB := []byte(genTarget.SLOData) @@ -249,7 +258,7 @@ func (g generateCommand) Run(ctx context.Context, config RootConfig) error { return fmt.Errorf("tried loading raw prometheus SLOs spec, it couldn't: %w", err) } - err = generatePrometheus(ctx, logger, windowsRepo, g.disableRecordings, g.disableAlerts, g.disableOptimizedRules, g.extraLabels, *slos, genTarget.Out) + err = gen.GeneratePrometheus(ctx, *slos, genTarget.Out) if err != nil { return fmt.Errorf("could not generate Prometheus format rules: %w", err) } @@ -260,7 +269,7 @@ func (g generateCommand) Run(ctx context.Context, config RootConfig) error { return fmt.Errorf("tried loading Kubernetes prometheus SLOs spec, it couldn't: %w", err) } - err = generateKubernetes(ctx, logger, windowsRepo, g.disableRecordings, g.disableAlerts, g.disableOptimizedRules, g.extraLabels, *sloGroup, genTarget.Out) + err = gen.GenerateKubernetes(ctx, *sloGroup, genTarget.Out) if err != nil { return fmt.Errorf("could not generate Kubernetes format rules: %w", err) } @@ -271,7 +280,7 @@ func (g generateCommand) Run(ctx context.Context, config RootConfig) error { return fmt.Errorf("tried loading OpenSLO SLOs spec, it couldn't: %w", err) } - err = generateOpenSLO(ctx, logger, windowsRepo, g.disableRecordings, g.disableAlerts, g.disableOptimizedRules, g.extraLabels, *slos, genTarget.Out) + err = gen.GenerateOpenSLO(ctx, *slos, genTarget.Out) if err != nil { return fmt.Errorf("could not generate OpenSLO format rules: %w", err) } @@ -284,22 +293,35 @@ func (g generateCommand) Run(ctx context.Context, config RootConfig) error { return nil } -// generatePrometheus generates the SLOs based on a raw regular Prometheus spec format input and -// outs a Prometheus raw yaml. -func generatePrometheus(ctx context.Context, logger log.Logger, windowsRepo alert.WindowsRepo, disableRecs, disableAlerts, disableOptimizedRules bool, extraLabels map[string]string, slos prometheus.SLOGroup, out io.Writer) error { - logger.Infof("Generating from Prometheus spec") +type generateTarget struct { + Out io.Writer + SLOData string +} + +type generator struct { + logger log.Logger + windowsRepo alert.WindowsRepo + disableRecordings bool + disableAlerts bool + disableOptimizedRules bool + extraLabels map[string]string +} + +// GeneratePrometheus generates the SLOs based on a raw regular Prometheus spec format input and outs a Prometheus raw yaml. +func (g generator) GeneratePrometheus(ctx context.Context, slos prometheus.SLOGroup, out io.Writer) error { + g.logger.Infof("Generating from Prometheus spec") info := info.Info{ Version: info.Version, Mode: info.ModeCLIGenPrometheus, Spec: prometheusv1.Version, } - result, err := generateRules(ctx, logger, info, windowsRepo, disableRecs, disableAlerts, disableOptimizedRules, extraLabels, slos) + result, err := g.generateRules(ctx, info, slos) if err != nil { return err } - repo := prometheus.NewIOWriterGroupedRulesYAMLRepo(out, logger) + repo := prometheus.NewIOWriterGroupedRulesYAMLRepo(out, g.logger) storageSLOs := make([]prometheus.StorageSLO, 0, len(result.PrometheusSLOs)) for _, s := range result.PrometheusSLOs { storageSLOs = append(storageSLOs, prometheus.StorageSLO{ @@ -316,22 +338,21 @@ func generatePrometheus(ctx context.Context, logger log.Logger, windowsRepo aler return nil } -// generateKubernetes generates the SLOs based on a Kuberentes spec format input and -// outs a Kubernetes prometheus operator CRD yaml. -func generateKubernetes(ctx context.Context, logger log.Logger, windowsRepo alert.WindowsRepo, disableRecs, disableAlerts, disableOptimizedRules bool, extraLabels map[string]string, sloGroup k8sprometheus.SLOGroup, out io.Writer) error { - logger.Infof("Generating from Kubernetes Prometheus spec") +// generateKubernetes generates the SLOs based on a Kuberentes spec format input and outs a Kubernetes prometheus operator CRD yaml. +func (g generator) GenerateKubernetes(ctx context.Context, sloGroup k8sprometheus.SLOGroup, out io.Writer) error { + g.logger.Infof("Generating from Kubernetes Prometheus spec") info := info.Info{ Version: info.Version, Mode: info.ModeCLIGenKubernetes, Spec: fmt.Sprintf("%s/%s", kubernetesv1.SchemeGroupVersion.Group, kubernetesv1.SchemeGroupVersion.Version), } - result, err := generateRules(ctx, logger, info, windowsRepo, disableRecs, disableAlerts, disableOptimizedRules, extraLabels, sloGroup.SLOGroup) + result, err := g.generateRules(ctx, info, sloGroup.SLOGroup) if err != nil { return err } - repo := k8sprometheus.NewIOWriterPrometheusOperatorYAMLRepo(out, logger) + repo := k8sprometheus.NewIOWriterPrometheusOperatorYAMLRepo(out, g.logger) storageSLOs := make([]k8sprometheus.StorageSLO, 0, len(result.PrometheusSLOs)) for _, s := range result.PrometheusSLOs { storageSLOs = append(storageSLOs, k8sprometheus.StorageSLO{ @@ -348,22 +369,21 @@ func generateKubernetes(ctx context.Context, logger log.Logger, windowsRepo aler return nil } -// generateOpenSLO generates the SLOs based on a OpenSLO spec format input and -// outs a Prometheus raw yaml. -func generateOpenSLO(ctx context.Context, logger log.Logger, windowsRepo alert.WindowsRepo, disableRecs, disableAlerts, disableOptimizedRules bool, extraLabels map[string]string, slos prometheus.SLOGroup, out io.Writer) error { - logger.Infof("Generating from OpenSLO spec") +// generateOpenSLO generates the SLOs based on a OpenSLO spec format input and outs a Prometheus raw yaml. +func (g generator) GenerateOpenSLO(ctx context.Context, slos prometheus.SLOGroup, out io.Writer) error { + g.logger.Infof("Generating from OpenSLO spec") info := info.Info{ Version: info.Version, Mode: info.ModeCLIGenOpenSLO, Spec: openslov1alpha.APIVersion, } - result, err := generateRules(ctx, logger, info, windowsRepo, disableRecs, disableAlerts, disableOptimizedRules, extraLabels, slos) + result, err := g.generateRules(ctx, info, slos) if err != nil { return err } - repo := prometheus.NewIOWriterGroupedRulesYAMLRepo(out, logger) + repo := prometheus.NewIOWriterGroupedRulesYAMLRepo(out, g.logger) storageSLOs := make([]prometheus.StorageSLO, 0, len(result.PrometheusSLOs)) for _, s := range result.PrometheusSLOs { storageSLOs = append(storageSLOs, prometheus.StorageSLO{ @@ -380,16 +400,15 @@ func generateOpenSLO(ctx context.Context, logger log.Logger, windowsRepo alert.W return nil } -// generate is the main generator logic that all the spec types and storers share. Mainly -// has the logic of the generate app service. -func generateRules(ctx context.Context, logger log.Logger, info info.Info, windowsRepo alert.WindowsRepo, disableRecs, disableAlerts, disableOptimizedRules bool, extraLabels map[string]string, slos prometheus.SLOGroup) (*generate.Response, error) { +// generate is the main generator logic that all the spec types and storers share. Mainly has the logic of the generate app service. +func (g generator) generateRules(ctx context.Context, info info.Info, slos prometheus.SLOGroup) (*generate.Response, error) { // Disable recording rules if required. var sliRuleGen generate.SLIRecordingRulesGenerator = generate.NoopSLIRecordingRulesGenerator var metaRuleGen generate.MetadataRecordingRulesGenerator = generate.NoopMetadataRecordingRulesGenerator - if !disableRecs { + if !g.disableRecordings { // Disable optimized rules if required. sliRuleGen = prometheus.OptimizedSLIRecordingRulesGenerator - if disableOptimizedRules { + if g.disableOptimizedRules { sliRuleGen = prometheus.SLIRecordingRulesGenerator } metaRuleGen = prometheus.MetadataRecordingRulesGenerator @@ -397,24 +416,24 @@ func generateRules(ctx context.Context, logger log.Logger, info info.Info, windo // Disable alert rules if required. var alertRuleGen generate.SLOAlertRulesGenerator = generate.NoopSLOAlertRulesGenerator - if !disableAlerts { + if !g.disableAlerts { alertRuleGen = prometheus.SLOAlertRulesGenerator } // Generate. controller, err := generate.NewService(generate.ServiceConfig{ - AlertGenerator: alert.NewGenerator(windowsRepo), + AlertGenerator: alert.NewGenerator(g.windowsRepo), SLIRecordingRulesGenerator: sliRuleGen, MetaRecordingRulesGenerator: metaRuleGen, SLOAlertRulesGenerator: alertRuleGen, - Logger: logger, + Logger: g.logger, }) if err != nil { return nil, fmt.Errorf("could not create application service: %w", err) } result, err := controller.Generate(ctx, generate.Request{ - ExtraLabels: extraLabels, + ExtraLabels: g.extraLabels, Info: info, SLOGroup: slos, }) @@ -424,8 +443,3 @@ func generateRules(ctx context.Context, logger log.Logger, info info.Info, windo return result, nil } - -type generateTarget struct { - Out io.Writer - SLOData string -} diff --git a/cmd/sloth/commands/validate.go b/cmd/sloth/commands/validate.go index cfd6c532..1dc68cf3 100644 --- a/cmd/sloth/commands/validate.go +++ b/cmd/sloth/commands/validate.go @@ -125,6 +125,12 @@ func (v validateCommand) Run(ctx context.Context, config RootConfig) error { // Split YAMLs in case we have multiple yaml files in a single file. splittedSLOsData := splitYAML(slxData) + gen := generator{ + logger: log.Noop, + windowsRepo: windowsRepo, + extraLabels: v.extraLabels, + } + // Prepare file validation result and start validation result for every SLO in the file. // TODO(slok): Add service meta to validation. validation := &fileValidation{File: input} @@ -138,7 +144,7 @@ func (v validateCommand) Run(ctx context.Context, config RootConfig) error { case promYAMLLoader.IsSpecType(ctx, dataB): slos, promErr := promYAMLLoader.LoadSpec(ctx, dataB) if promErr == nil { - err := generatePrometheus(ctx, log.Noop, windowsRepo, false, false, false, v.extraLabels, *slos, io.Discard) + err := gen.GeneratePrometheus(ctx, *slos, io.Discard) if err != nil { validation.Errs = []error{fmt.Errorf("Could not generate Prometheus format rules: %w", err)} } @@ -150,7 +156,7 @@ func (v validateCommand) Run(ctx context.Context, config RootConfig) error { case kubeYAMLLoader.IsSpecType(ctx, dataB): sloGroup, k8sErr := kubeYAMLLoader.LoadSpec(ctx, dataB) if k8sErr == nil { - err := generateKubernetes(ctx, log.Noop, windowsRepo, false, false, false, v.extraLabels, *sloGroup, io.Discard) + err := gen.GenerateKubernetes(ctx, *sloGroup, io.Discard) if err != nil { validation.Errs = []error{fmt.Errorf("could not generate Kubernetes format rules: %w", err)} } @@ -162,7 +168,7 @@ func (v validateCommand) Run(ctx context.Context, config RootConfig) error { case openSLOYAMLLoader.IsSpecType(ctx, dataB): slos, openSLOErr := openSLOYAMLLoader.LoadSpec(ctx, dataB) if openSLOErr == nil { - err := generateOpenSLO(ctx, log.Noop, windowsRepo, false, false, false, v.extraLabels, *slos, io.Discard) + err := gen.GenerateOpenSLO(ctx, *slos, io.Discard) if err != nil { validation.Errs = []error{fmt.Errorf("Could not generate OpenSLO format rules: %w", err)} } From a4e31abf11e4515d316874f37a2b119ec52c4a6a Mon Sep 17 00:00:00 2001 From: Nicolas Lamirault Date: Mon, 14 Nov 2022 15:06:11 +0100 Subject: [PATCH 03/17] Add: specify logger to use Signed-off-by: Nicolas Lamirault --- deploy/kubernetes/helm/sloth/templates/deployment.yaml | 1 + deploy/kubernetes/helm/sloth/values.yaml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/deploy/kubernetes/helm/sloth/templates/deployment.yaml b/deploy/kubernetes/helm/sloth/templates/deployment.yaml index 55fc1cdc..f4b75491 100644 --- a/deploy/kubernetes/helm/sloth/templates/deployment.yaml +++ b/deploy/kubernetes/helm/sloth/templates/deployment.yaml @@ -59,6 +59,7 @@ spec: {{- if .Values.customSloConfig.enabled }} - --slo-period-windows-path={{ .Values.customSloConfig.path }} {{- end }} + - --logger={{ .Values.sloth.logger }} {{- if .Values.sloth.debug.enabled }} - --debug {{- end}} diff --git a/deploy/kubernetes/helm/sloth/values.yaml b/deploy/kubernetes/helm/sloth/values.yaml index b9c1548a..8c8b309d 100644 --- a/deploy/kubernetes/helm/sloth/values.yaml +++ b/deploy/kubernetes/helm/sloth/values.yaml @@ -27,6 +27,8 @@ sloth: optimizedRules: true # Reduce prom load for calculating period window burnrates. debug: enabled: false + # Could be: default or json + logger: default commonPlugins: enabled: true From 6fba1c2f07edbc4c2b8d5fdf6065da7ab8bcf313 Mon Sep 17 00:00:00 2001 From: Nicolas Lamirault Date: Mon, 14 Nov 2022 15:11:32 +0100 Subject: [PATCH 04/17] Fix: tests for logger Signed-off-by: Nicolas Lamirault --- .../helm/sloth/tests/testdata/output/deployment_custom.yaml | 1 + .../sloth/tests/testdata/output/deployment_custom_no_extras.yaml | 1 + .../tests/testdata/output/deployment_custom_slo_config.yaml | 1 + .../helm/sloth/tests/testdata/output/deployment_default.yaml | 1 + 4 files changed, 4 insertions(+) diff --git a/deploy/kubernetes/helm/sloth/tests/testdata/output/deployment_custom.yaml b/deploy/kubernetes/helm/sloth/tests/testdata/output/deployment_custom.yaml index 86a0a8ed..1b7b0ff1 100644 --- a/deploy/kubernetes/helm/sloth/tests/testdata/output/deployment_custom.yaml +++ b/deploy/kubernetes/helm/sloth/tests/testdata/output/deployment_custom.yaml @@ -50,6 +50,7 @@ spec: - --extra-labels=k2=v2 - --sli-plugins-path=/plugins - --disable-optimized-rules + - --logger=default ports: - containerPort: 8081 name: metrics diff --git a/deploy/kubernetes/helm/sloth/tests/testdata/output/deployment_custom_no_extras.yaml b/deploy/kubernetes/helm/sloth/tests/testdata/output/deployment_custom_no_extras.yaml index 17c9447e..c2d4ab0d 100644 --- a/deploy/kubernetes/helm/sloth/tests/testdata/output/deployment_custom_no_extras.yaml +++ b/deploy/kubernetes/helm/sloth/tests/testdata/output/deployment_custom_no_extras.yaml @@ -49,6 +49,7 @@ spec: - --extra-labels=k1=v1 - --extra-labels=k2=v2 - --disable-optimized-rules + - --logger=default securityContext: allowPrivilegeEscalation: false resources: diff --git a/deploy/kubernetes/helm/sloth/tests/testdata/output/deployment_custom_slo_config.yaml b/deploy/kubernetes/helm/sloth/tests/testdata/output/deployment_custom_slo_config.yaml index 83caaaef..6dbd8b11 100644 --- a/deploy/kubernetes/helm/sloth/tests/testdata/output/deployment_custom_slo_config.yaml +++ b/deploy/kubernetes/helm/sloth/tests/testdata/output/deployment_custom_slo_config.yaml @@ -51,6 +51,7 @@ spec: - --extra-labels=k2=v2 - --disable-optimized-rules - --slo-period-windows-path=/windows + - --logger=default ports: - containerPort: 8081 name: metrics diff --git a/deploy/kubernetes/helm/sloth/tests/testdata/output/deployment_default.yaml b/deploy/kubernetes/helm/sloth/tests/testdata/output/deployment_default.yaml index 27c7f61a..2d19c3a5 100644 --- a/deploy/kubernetes/helm/sloth/tests/testdata/output/deployment_default.yaml +++ b/deploy/kubernetes/helm/sloth/tests/testdata/output/deployment_default.yaml @@ -36,6 +36,7 @@ spec: args: - kubernetes-controller - --sli-plugins-path=/plugins + - --logger=default ports: - containerPort: 8081 name: metrics From dcc4bb01034fb65828d5fe06314f223165f65d31 Mon Sep 17 00:00:00 2001 From: Nicolas Lamirault Date: Mon, 14 Nov 2022 15:12:43 +0100 Subject: [PATCH 05/17] Update: bump chart version Signed-off-by: Nicolas Lamirault --- deploy/kubernetes/helm/sloth/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/kubernetes/helm/sloth/Chart.yaml b/deploy/kubernetes/helm/sloth/Chart.yaml index b855c087..b1250cfc 100644 --- a/deploy/kubernetes/helm/sloth/Chart.yaml +++ b/deploy/kubernetes/helm/sloth/Chart.yaml @@ -4,4 +4,4 @@ description: Base chart for Sloth. type: application home: https://github.com/slok/sloth kubeVersion: ">= 1.19.0-0" -version: 0.6.4 +version: 0.7.0 From 2da8487be4da7a8570f36f0da47e064086ed9a9a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 26 Nov 2022 07:21:03 +0000 Subject: [PATCH 06/17] build(deps): bump github.com/prometheus/prometheus from 0.39.1 to 0.40.3 Bumps [github.com/prometheus/prometheus](https://github.com/prometheus/prometheus) from 0.39.1 to 0.40.3. - [Release notes](https://github.com/prometheus/prometheus/releases) - [Changelog](https://github.com/prometheus/prometheus/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/prometheus/compare/v0.39.1...v0.40.3) --- updated-dependencies: - dependency-name: github.com/prometheus/prometheus dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 35 +++++++++++----------- go.sum | 95 ++++++++++++++++++++++++++++++---------------------------- 2 files changed, 68 insertions(+), 62 deletions(-) diff --git a/go.mod b/go.mod index 0c649012..18408ddb 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/prometheus-operator/prometheus-operator/pkg/client v0.60.1 github.com/prometheus/client_golang v1.14.0 github.com/prometheus/common v0.37.0 - github.com/prometheus/prometheus v0.39.1 + github.com/prometheus/prometheus v0.40.3 github.com/sirupsen/logrus v1.9.0 github.com/slok/reload v0.1.0 github.com/spotahome/kooper/v2 v2.2.0 @@ -18,9 +18,9 @@ require ( github.com/traefik/yaegi v0.14.3 gopkg.in/alecthomas/kingpin.v2 v2.2.6 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.25.1 - k8s.io/apimachinery v0.25.1 - k8s.io/client-go v0.25.1 + k8s.io/api v0.25.3 + k8s.io/apimachinery v0.25.3 + k8s.io/client-go v0.25.3 ) require ( @@ -33,7 +33,7 @@ require ( github.com/Azure/go-autorest/tracing v0.6.0 // indirect github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect - github.com/aws/aws-sdk-go v1.44.102 // indirect + github.com/aws/aws-sdk-go v1.44.128 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -56,10 +56,10 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/gnostic v0.6.9 // indirect - github.com/google/go-cmp v0.5.8 // indirect + github.com/google/go-cmp v0.5.9 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.3.0 // indirect - github.com/grafana/regexp v0.0.0-20220304095617-2e8d9baf4ac2 // indirect + github.com/grafana/regexp v0.0.0-20221005093135-b4c2bcb0a4b6 // indirect github.com/imdario/mergo v0.3.12 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect @@ -80,18 +80,19 @@ require ( github.com/prometheus/procfs v0.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.0 // indirect - go.opentelemetry.io/otel v1.10.0 // indirect - go.opentelemetry.io/otel/trace v1.10.0 // indirect + go.opentelemetry.io/otel v1.11.1 // indirect + go.opentelemetry.io/otel/trace v1.11.1 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/goleak v1.2.0 // indirect - golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect - golang.org/x/net v0.0.0-20220920203100-d0c6ba3f52d9 // indirect - golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect - golang.org/x/sync v0.0.0-20220907140024-f12130a52804 // indirect - golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect - golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect - golang.org/x/text v0.3.7 // indirect - golang.org/x/time v0.0.0-20220920022843-2ce7c2934d45 // indirect + golang.org/x/crypto v0.1.0 // indirect + golang.org/x/exp v0.0.0-20221031165847-c99f073a8326 // indirect + golang.org/x/net v0.1.0 // indirect + golang.org/x/oauth2 v0.1.0 // indirect + golang.org/x/sync v0.1.0 // indirect + golang.org/x/sys v0.1.0 // indirect + golang.org/x/term v0.1.0 // indirect + golang.org/x/text v0.4.0 // indirect + golang.org/x/time v0.1.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index 5ce5ecdc..c9c47904 100644 --- a/go.sum +++ b/go.sum @@ -84,8 +84,8 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV github.com/armon/go-metrics v0.3.10 h1:FR+drcQStOe+32sYyJYyZ7FIdgoGGBnwLl+flodp8Uo= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/aws/aws-sdk-go v1.44.102 h1:6tUCTGL2UDbFZae1TLGk8vTgeXuzkb8KbAe2FiAeKHc= -github.com/aws/aws-sdk-go v1.44.102/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.128 h1:X34pX5t0LIZXjBY11yf9JKMP3c1aZgirh+5PjtaZyJ4= +github.com/aws/aws-sdk-go v1.44.128/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -121,11 +121,11 @@ github.com/dennwc/varint v1.0.0 h1:kGNFFSSw8ToIy3obO/kKr8U9GZYUAxQEVuix4zfDWzE= github.com/dennwc/varint v1.0.0/go.mod h1:hnItb35rvZvJrbTALZtY/iQfDs48JKRG1RPpgziApxA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/digitalocean/godo v1.84.1 h1:VgPsuxhrO9pUygvij6qOhqXfAkxAsDZYRpmjSDMEaHo= +github.com/digitalocean/godo v1.88.0 h1:SAEdw63xOMmzlwCeCWjLH1GcyDPUjbSAR1Bh7VELxzc= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= -github.com/docker/docker v20.10.18+incompatible h1:SN84VYXTBNGn92T/QwIRPlum9zfemfitN7pbsp26WSc= +github.com/docker/docker v20.10.21+incompatible h1:UTLdBmHk3bEY+w8qeO5KttOhy6OmXWsl/FEet9Uswog= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= @@ -140,14 +140,14 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.10.3 h1:xdCVXxEe0Y3FQith+0cj2irwZudqGYvecuLB1HtdexY= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.6.8 h1:B2cR/FAaiMtYDHv5BQpaqtkjGuWQIgr2KQZtHQ7f6i8= +github.com/envoyproxy/protoc-gen-validate v0.6.13 h1:TvDcILLkjuZV3ER58VkBmncKsLUBqBDxra/XctCzuMM= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -252,8 +252,8 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -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/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= @@ -287,14 +287,14 @@ github.com/gophercloud/gophercloud v1.0.0 h1:9nTGx0jizmHxDobe4mck89FyQHVyA3CaXLI github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/grafana/regexp v0.0.0-20220304095617-2e8d9baf4ac2 h1:uirlL/j72L93RhV4+mkWhjv0cov2I0MIgPOG9rMDr1k= -github.com/grafana/regexp v0.0.0-20220304095617-2e8d9baf4ac2/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A= +github.com/grafana/regexp v0.0.0-20221005093135-b4c2bcb0a4b6 h1:A3dhViTeFDSQcGOXuUi6ukCQSMyDtDISBp2z6OOo2YM= +github.com/grafana/regexp v0.0.0-20221005093135-b4c2bcb0a4b6/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/api v1.15.2 h1:3Q/pDqvJ7udgt/60QOOW/p/PeKioQN+ncYzzCdN2av0= +github.com/hashicorp/consul/api v1.15.3 h1:WYONYL2rxTXtlekAqblR2SCdJsizMDIj/uXb5wNy9zU= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/cronexpr v1.1.1 h1:NJZDd87hGXjoZBdvyCF9mX4DCq5Wy7+A/w+A7q0wn6c= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -320,7 +320,7 @@ github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/nomad/api v0.0.0-20220921012004-ddeeb1040edf h1:l/EZ57iRPNs8vd8c9qH0dB4Q+IiZHJouLAgxJ5j25tU= +github.com/hashicorp/nomad/api v0.0.0-20221102143410-8a95f1239005 h1:jKwXhVS4F7qk0g8laz+Anz0g/6yaSJ3HqmSAuSNLUcA= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/serf v0.9.7 h1:hkdgbqizGQHuU5IPqYM1JdSMV8nKfpuOnZYXssk9muY= github.com/hetznercloud/hcloud-go v1.35.3 h1:WCmFAhLRooih2QHAsbCbEdpIHnshQQmrPqsr3rHE1Ow= @@ -352,7 +352,7 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kolo/xmlrpc v0.0.0-20220919000247-3377102c83bd h1:b1taQnM42dp3NdiiQwfmM1WyyucHayZSKN5R0PRYWL0= +github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b h1:udzkj9S/zlT5X367kqJis0QP7YMxobob6zhzq6Yre00= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 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= @@ -368,7 +368,7 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -github.com/linode/linodego v1.9.1 h1:29UpEPpYcGFnbwiJW8mbk/bjBZpgd/pv68io2IKTo34= +github.com/linode/linodego v1.9.3 h1:+lxNZw4avRxhCqGjwfPgQ2PvMT+vOL0OMsTdzixR7hQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -414,6 +414,7 @@ github.com/onsi/ginkgo/v2 v2.1.6 h1:Fx2POJZfKRQcM1pH49qSZiYeu319wji004qX+GDovrU= github.com/onsi/gomega v1.20.1 h1:PA/3qinGoukvymdIDV8pii6tiZgC8kbmJO6Z5+b002Q= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= +github.com/ovh/go-ovh v1.1.0 h1:bHXZmw8nTgZin4Nv7JuaLs0KG5x54EQR7migYTd1zrk= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -461,8 +462,8 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 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/prometheus/prometheus v0.39.1 h1:abZM6A+sKAv2eKTbRIaHq4amM/nT07MuxRm0+QTaTj0= -github.com/prometheus/prometheus v0.39.1/go.mod h1:GjQjgLhHMc0oo4Ko7qt/yBSJMY4hUoiAZwsYQgjaePA= +github.com/prometheus/prometheus v0.40.3 h1:oMw1vVyrxHTigXAcFY6QHrGUnQEbKEOKo737cPgYBwY= +github.com/prometheus/prometheus v0.40.3/go.mod h1:/UhsWkOXkO11wqTW2Bx5YDOwRweSDcaFBlTIzFe7P0Y= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= @@ -535,10 +536,10 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4= -go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ= -go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E= -go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM= +go.opentelemetry.io/otel v1.11.1 h1:4WLLAmcfkmDk2ukNXJyq3/kiz/3UzCaYq6PskJsaou4= +go.opentelemetry.io/otel v1.11.1/go.mod h1:1nNhXBbWSD0nsL38H6btgnFN2k4i0sNLHNNMZMSbUGE= +go.opentelemetry.io/otel/trace v1.11.1 h1:ofxdnzsNrGBYXbP7t7zpUK281+go5rF7dvdIZXF8gdQ= +go.opentelemetry.io/otel/trace v1.11.1/go.mod h1:f/Q9G7vzk5u91PhbmKbg1Qn0rzH1LJ4vbPHFGkTPtOk= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= @@ -556,8 +557,9 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -568,6 +570,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20221031165847-c99f073a8326 h1:QfTh0HpN6hlw6D3vu8DAwC8pBIwikq0AI1evdm+FksE= +golang.org/x/exp v0.0.0-20221031165847-c99f073a8326/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -594,7 +598,7 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= +golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -640,8 +644,8 @@ golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/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/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220920203100-d0c6ba3f52d9 h1:asZqf0wXastQr+DudYagQS8uBO8bHKeYD1vbAvGmFL8= -golang.org/x/net v0.0.0-20220920203100-d0c6ba3f52d9/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -658,8 +662,8 @@ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 h1:lxqLZaMad/dJHMFZH0NiNpiEZI/nhgWhe4wgzpE+MuA= -golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.1.0 h1:isLCZuhj4v+tYv7eskaN4v/TM+A1begWWgyVJDdl1+Y= +golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -671,8 +675,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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-20220907140024-f12130a52804 h1:0SH2R3f1b1VmIMG7BXbEZCBUu2dKmHschSmjqGUrW8A= -golang.org/x/sync v0.0.0-20220907140024-f12130a52804/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/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= @@ -733,12 +737,12 @@ golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBc 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-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 h1:h+EGohizhe9XlX18rfpa8k8RAc5XyaeamM+0VHRd4lc= -golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/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/term v0.0.0-20220722155259-a9ba230a4035 h1:Q5284mrmYTpACcm+eAKjKJH48BBwSyfJqmmGDTtT8Vc= -golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -747,13 +751,14 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220920022843-2ce7c2934d45 h1:yuLAip3bfURHClMG9VBdzPrQvCWjWiWUTBGV+/fCbUs= -golang.org/x/time v0.0.0-20220920022843-2ce7c2934d45/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA= +golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -810,7 +815,7 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= +golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= 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= @@ -907,7 +912,7 @@ google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEc google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006 h1:mmbq5q8M1t7dhkLw320YK4PsOXm6jdnUAkErImaIqOg= +google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c h1:QgY/XxIAIeccR+Ca/rDdKubLIU9rcJ3xfy1DC/Wd2Oo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -933,7 +938,7 @@ google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQ google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw= +google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -985,14 +990,14 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.25.1 h1:yL7du50yc93k17nH/Xe9jujAYrcDkI/i5DL1jPz4E3M= -k8s.io/api v0.25.1/go.mod h1:hh4itDvrWSJsmeUc28rIFNri8MatNAAxJjKcQmhX6TU= +k8s.io/api v0.25.3 h1:Q1v5UFfYe87vi5H7NU0p4RXC26PPMT8KOpr1TLQbCMQ= +k8s.io/api v0.25.3/go.mod h1:o42gKscFrEVjHdQnyRenACrMtbuJsVdP+WVjqejfzmI= k8s.io/apiextensions-apiserver v0.25.0 h1:CJ9zlyXAbq0FIW8CD7HHyozCMBpDSiH7EdrSTCZcZFY= k8s.io/apiextensions-apiserver v0.25.0/go.mod h1:3pAjZiN4zw7R8aZC5gR0y3/vCkGlAjCazcg1me8iB/E= -k8s.io/apimachinery v0.25.1 h1:t0XrnmCEHVgJlR2arwO8Awp9ylluDic706WePaYCBTI= -k8s.io/apimachinery v0.25.1/go.mod h1:hqqA1X0bsgsxI6dXsJ4HnNTBOmJNxyPp8dw3u2fSHwA= -k8s.io/client-go v0.25.1 h1:uFj4AJKtE1/ckcSKz8IhgAuZTdRXZDKev8g387ndD58= -k8s.io/client-go v0.25.1/go.mod h1:rdFWTLV/uj2C74zGbQzOsmXPUtMAjSf7ajil4iJUNKo= +k8s.io/apimachinery v0.25.3 h1:7o9ium4uyUOM76t6aunP0nZuex7gDf8VGwkR5RcJnQc= +k8s.io/apimachinery v0.25.3/go.mod h1:jaF9C/iPNM1FuLl7Zuy5b9v+n35HGSh6AQ4HYRkCqwo= +k8s.io/client-go v0.25.3 h1:oB4Dyl8d6UbfDHD8Bv8evKylzs3BXzzufLiO27xuPs0= +k8s.io/client-go v0.25.3/go.mod h1:t39LPczAIMwycjcXkVc+CB+PZV69jQuNx4um5ORDjQA= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.80.0 h1:lyJt0TWMPaGoODa8B8bUuxgHS3W/m/bNr2cca3brA/g= k8s.io/klog/v2 v2.80.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= From fc57f1a28dc7b6ca24eac7bbc72484b822479092 Mon Sep 17 00:00:00 2001 From: Xabier Larrakoetxea Date: Sat, 26 Nov 2022 12:22:43 +0100 Subject: [PATCH 07/17] Update prometeus operator dependecies Signed-off-by: Xabier Larrakoetxea --- go.mod | 32 +++++++-------- go.sum | 67 +++++++++++++++---------------- internal/k8sprometheus/storage.go | 2 +- 3 files changed, 49 insertions(+), 52 deletions(-) diff --git a/go.mod b/go.mod index 18408ddb..3bf52b60 100644 --- a/go.mod +++ b/go.mod @@ -6,8 +6,8 @@ require ( github.com/OpenSLO/oslo v0.2.2-0.20210629193748-b882029ce777 github.com/go-playground/validator/v10 v10.11.1 github.com/oklog/run v1.1.0 - github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.60.1 - github.com/prometheus-operator/prometheus-operator/pkg/client v0.60.1 + github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.61.1 + github.com/prometheus-operator/prometheus-operator/pkg/client v0.61.1 github.com/prometheus/client_golang v1.14.0 github.com/prometheus/common v0.37.0 github.com/prometheus/prometheus v0.40.3 @@ -18,9 +18,9 @@ require ( github.com/traefik/yaegi v0.14.3 gopkg.in/alecthomas/kingpin.v2 v2.2.6 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.25.3 - k8s.io/apimachinery v0.25.3 - k8s.io/client-go v0.25.3 + k8s.io/api v0.25.4 + k8s.io/apimachinery v0.25.4 + k8s.io/client-go v0.25.4 ) require ( @@ -39,7 +39,7 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/dennwc/varint v1.0.0 // indirect github.com/edsrzf/mmap-go v1.1.0 // indirect - github.com/emicklei/go-restful/v3 v3.9.0 // indirect + github.com/emicklei/go-restful/v3 v3.10.0 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect @@ -86,22 +86,22 @@ require ( go.uber.org/goleak v1.2.0 // indirect golang.org/x/crypto v0.1.0 // indirect golang.org/x/exp v0.0.0-20221031165847-c99f073a8326 // indirect - golang.org/x/net v0.1.0 // indirect - golang.org/x/oauth2 v0.1.0 // indirect + golang.org/x/net v0.2.0 // indirect + golang.org/x/oauth2 v0.2.0 // indirect golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.1.0 // indirect - golang.org/x/term v0.1.0 // indirect + golang.org/x/sys v0.2.0 // indirect + golang.org/x/term v0.2.0 // indirect golang.org/x/text v0.4.0 // indirect - golang.org/x/time v0.1.0 // indirect + golang.org/x/time v0.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.25.0 // indirect - k8s.io/klog/v2 v2.80.0 // indirect - k8s.io/kube-openapi v0.0.0-20220803164354-a70c9af30aea // indirect - k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73 // indirect - sigs.k8s.io/controller-runtime v0.12.3 // indirect + k8s.io/apiextensions-apiserver v0.25.4 // indirect + k8s.io/klog/v2 v2.80.1 // indirect + k8s.io/kube-openapi v0.0.0-20221110221610-a28e98eb7c70 // indirect + k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 // indirect + sigs.k8s.io/controller-runtime v0.13.1 // indirect sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect sigs.k8s.io/yaml v1.3.0 // indirect diff --git a/go.sum b/go.sum index c9c47904..75a16d6d 100644 --- a/go.sum +++ b/go.sum @@ -129,8 +129,8 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= -github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= -github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.10.0 h1:X4gma4HM7hFm6WMeAsTfqA0GOfdNoCzBIkHGoRLGXuM= +github.com/emicklei/go-restful/v3 v3.10.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -163,7 +163,6 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= @@ -425,10 +424,10 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.60.1 h1:A46xpyCEQpMFymrNJOaL5aAu3ZWgEKwJUXZrB5D3IUM= -github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.60.1/go.mod h1:MNl09GdaKb/vE8QdcCWyICDV7XAbGX6gKKQAS43XW1c= -github.com/prometheus-operator/prometheus-operator/pkg/client v0.60.1 h1:siNzJzzxj9xvNEvltDvpMTRzc1ESU6MbPFLMV3flokE= -github.com/prometheus-operator/prometheus-operator/pkg/client v0.60.1/go.mod h1:+PXJ5jLYWH9jfjltfwJa6hbQEVko8XxCjCe9KWWnKRk= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.61.1 h1:ViIkBYnAUumtx9D7PiVPc1n8kNvwm+WMepDZWTZCBPc= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.61.1/go.mod h1:j51242bf6LQwvJ1JPKWApzTnifmCwcQq0i1p29ylWiM= +github.com/prometheus-operator/prometheus-operator/pkg/client v0.61.1 h1:y5ILBCB26Jztm/lgPwm7EcIPxfG20NbY8irIvCIZfKg= +github.com/prometheus-operator/prometheus-operator/pkg/client v0.61.1/go.mod h1:hnvR2Lm/j9sLB1mZHl9gwnuzHuC3iyX4eUPx1SVogF8= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -488,7 +487,6 @@ github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9 github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -644,8 +642,8 @@ golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/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/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -662,8 +660,8 @@ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.1.0 h1:isLCZuhj4v+tYv7eskaN4v/TM+A1begWWgyVJDdl1+Y= -golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= +golang.org/x/oauth2 v0.2.0 h1:GtQkldQ9m7yvzCL1V+LrYow3Khe0eJH0w7RbX/VbaIU= +golang.org/x/oauth2 v0.2.0/go.mod h1:Cwn6afJ8jrQwYMxQDTpISoXmXW9I6qF6vDeuuoX3Ibs= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -737,12 +735,12 @@ golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBc 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-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= +golang.org/x/sys v0.2.0/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/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -757,8 +755,8 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA= -golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.2.0 h1:52I/1L54xyEQAYdtcSuxtiT84KGYTBGXwayxmIpNJhE= +golang.org/x/time v0.2.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -990,26 +988,25 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.25.3 h1:Q1v5UFfYe87vi5H7NU0p4RXC26PPMT8KOpr1TLQbCMQ= -k8s.io/api v0.25.3/go.mod h1:o42gKscFrEVjHdQnyRenACrMtbuJsVdP+WVjqejfzmI= -k8s.io/apiextensions-apiserver v0.25.0 h1:CJ9zlyXAbq0FIW8CD7HHyozCMBpDSiH7EdrSTCZcZFY= -k8s.io/apiextensions-apiserver v0.25.0/go.mod h1:3pAjZiN4zw7R8aZC5gR0y3/vCkGlAjCazcg1me8iB/E= -k8s.io/apimachinery v0.25.3 h1:7o9ium4uyUOM76t6aunP0nZuex7gDf8VGwkR5RcJnQc= -k8s.io/apimachinery v0.25.3/go.mod h1:jaF9C/iPNM1FuLl7Zuy5b9v+n35HGSh6AQ4HYRkCqwo= -k8s.io/client-go v0.25.3 h1:oB4Dyl8d6UbfDHD8Bv8evKylzs3BXzzufLiO27xuPs0= -k8s.io/client-go v0.25.3/go.mod h1:t39LPczAIMwycjcXkVc+CB+PZV69jQuNx4um5ORDjQA= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.80.0 h1:lyJt0TWMPaGoODa8B8bUuxgHS3W/m/bNr2cca3brA/g= -k8s.io/klog/v2 v2.80.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20220803164354-a70c9af30aea h1:3QOH5+2fGsY8e1qf+GIFpg+zw/JGNrgyZRQR7/m6uWg= -k8s.io/kube-openapi v0.0.0-20220803164354-a70c9af30aea/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU= -k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73 h1:H9TCJUUx+2VA0ZiD9lvtaX8fthFsMoD+Izn93E/hm8U= -k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/api v0.25.4 h1:3YO8J4RtmG7elEgaWMb4HgmpS2CfY1QlaOz9nwB+ZSs= +k8s.io/api v0.25.4/go.mod h1:IG2+RzyPQLllQxnhzD8KQNEu4c4YvyDTpSMztf4A0OQ= +k8s.io/apiextensions-apiserver v0.25.4 h1:7hu9pF+xikxQuQZ7/30z/qxIPZc2J1lFElPtr7f+B6U= +k8s.io/apiextensions-apiserver v0.25.4/go.mod h1:bkSGki5YBoZWdn5pWtNIdGvDrrsRWlmnvl9a+tAw5vQ= +k8s.io/apimachinery v0.25.4 h1:CtXsuaitMESSu339tfhVXhQrPET+EiWnIY1rcurKnAc= +k8s.io/apimachinery v0.25.4/go.mod h1:jaF9C/iPNM1FuLl7Zuy5b9v+n35HGSh6AQ4HYRkCqwo= +k8s.io/client-go v0.25.4 h1:3RNRDffAkNU56M/a7gUfXaEzdhZlYhoW8dgViGy5fn8= +k8s.io/client-go v0.25.4/go.mod h1:8trHCAC83XKY0wsBIpbirZU4NTUpbuhc2JnI7OruGZw= +k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= +k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20221110221610-a28e98eb7c70 h1:zfqQc1V6/ZgGpvrOVvr62OjiqQX4lZjfznK34NQwkqw= +k8s.io/kube-openapi v0.0.0-20221110221610-a28e98eb7c70/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= +k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 h1:GfD9OzL11kvZN5iArC6oTS7RTj7oJOIfnislxYlqTj8= +k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/controller-runtime v0.12.3 h1:FCM8xeY/FI8hoAfh/V4XbbYMY20gElh9yh+A98usMio= -sigs.k8s.io/controller-runtime v0.12.3/go.mod h1:qKsk4WE6zW2Hfj0G4v10EnNB2jMG1C+NTb8h+DwCoU0= +sigs.k8s.io/controller-runtime v0.13.1 h1:tUsRCSJVM1QQOOeViGeX3GMT3dQF1eePPw6sEE3xSlg= +sigs.k8s.io/controller-runtime v0.13.1/go.mod h1:Zbz+el8Yg31jubvAEyglRZGdLAjplZl+PgtYNI6WNTI= sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= diff --git a/internal/k8sprometheus/storage.go b/internal/k8sprometheus/storage.go index 1a0817df..1f31f833 100644 --- a/internal/k8sprometheus/storage.go +++ b/internal/k8sprometheus/storage.go @@ -138,7 +138,7 @@ func promRulesToKubeRules(rules []rulefmt.Rule) []monitoringv1.Rule { Record: r.Record, Alert: r.Alert, Expr: intstr.FromString(r.Expr), - For: forS, + For: monitoringv1.Duration(forS), Labels: r.Labels, Annotations: r.Annotations, }) From 93269f14caa22c88bb7a4f0ee19a4c2a9796bd27 Mon Sep 17 00:00:00 2001 From: Will Bollock Date: Tue, 13 Jun 2023 19:52:30 -0400 Subject: [PATCH 08/17] feat: adjustable rule_group interval This allows for more expensive SLO recording rules by letting users create a custom Prometheus `rule_group.interval`. https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/#rule_group Now instead of all rule groups using the default global evaluation interval, a custom interval can be set on all sets of recording rules for an SLO. If no `interval` is set then the global default will be assumed, matching current Sloth behavior. Resolves: https://github.com/slok/sloth/issues/367 --- internal/prometheus/model.go | 21 +++++++++++---------- internal/prometheus/spec.go | 19 ++++++++++--------- internal/prometheus/storage.go | 25 ++++++++++++++++--------- pkg/prometheus/api/v1/v1.go | 2 ++ 4 files changed, 39 insertions(+), 28 deletions(-) diff --git a/internal/prometheus/model.go b/internal/prometheus/model.go index f2ac02c1..09dd2519 100644 --- a/internal/prometheus/model.go +++ b/internal/prometheus/model.go @@ -39,16 +39,17 @@ type AlertMeta struct { // SLO represents a service level objective configuration. type SLO struct { - ID string `validate:"required,name"` - Name string `validate:"required,name"` - Description string - Service string `validate:"required,name"` - SLI SLI `validate:"required"` - TimeWindow time.Duration `validate:"required"` - Objective float64 `validate:"gt=0,lte=100"` - Labels map[string]string `validate:"dive,keys,prom_label_key,endkeys,required,prom_label_value"` - PageAlertMeta AlertMeta - TicketAlertMeta AlertMeta + ID string `validate:"required,name"` + Name string `validate:"required,name"` + Description string + Service string `validate:"required,name"` + RuleGroupInterval string + SLI SLI `validate:"required"` + TimeWindow time.Duration `validate:"required"` + Objective float64 `validate:"gt=0,lte=100"` + Labels map[string]string `validate:"dive,keys,prom_label_key,endkeys,required,prom_label_value"` + PageAlertMeta AlertMeta + TicketAlertMeta AlertMeta } type SLOGroup struct { diff --git a/internal/prometheus/spec.go b/internal/prometheus/spec.go index 1935aa38..5164005a 100644 --- a/internal/prometheus/spec.go +++ b/internal/prometheus/spec.go @@ -69,15 +69,16 @@ func (y YAMLSpecLoader) mapSpecToModel(ctx context.Context, spec prometheusv1.Sp models := make([]SLO, 0, len(spec.SLOs)) for _, specSLO := range spec.SLOs { slo := SLO{ - ID: fmt.Sprintf("%s-%s", spec.Service, specSLO.Name), - Name: specSLO.Name, - Description: specSLO.Description, - Service: spec.Service, - TimeWindow: y.windowPeriod, - Objective: specSLO.Objective, - Labels: mergeLabels(spec.Labels, specSLO.Labels), - PageAlertMeta: AlertMeta{Disable: true}, - TicketAlertMeta: AlertMeta{Disable: true}, + ID: fmt.Sprintf("%s-%s", spec.Service, specSLO.Name), + RuleGroupInterval: specSLO.RuleGroupInterval, + Name: specSLO.Name, + Description: specSLO.Description, + Service: spec.Service, + TimeWindow: y.windowPeriod, + Objective: specSLO.Objective, + Labels: mergeLabels(spec.Labels, specSLO.Labels), + PageAlertMeta: AlertMeta{Disable: true}, + TicketAlertMeta: AlertMeta{Disable: true}, } // Set SLIs. diff --git a/internal/prometheus/storage.go b/internal/prometheus/storage.go index 9b37ca92..c60dcc4b 100644 --- a/internal/prometheus/storage.go +++ b/internal/prometheus/storage.go @@ -48,24 +48,31 @@ func (i IOWriterGroupedRulesYAMLRepo) StoreSLOs(ctx context.Context, slos []Stor ruleGroups := ruleGroupsYAMLv2{} for _, slo := range slos { + ruleGroupIntervalDuration, err := prommodel.ParseDuration(slo.SLO.RuleGroupInterval) + if err != nil { + return fmt.Errorf("could not parse rule_group interval duration %w", err) + } if len(slo.Rules.SLIErrorRecRules) > 0 { ruleGroups.Groups = append(ruleGroups.Groups, ruleGroupYAMLv2{ - Name: fmt.Sprintf("sloth-slo-sli-recordings-%s", slo.SLO.ID), - Rules: slo.Rules.SLIErrorRecRules, + Name: fmt.Sprintf("sloth-slo-sli-recordings-%s", slo.SLO.ID), + RuleGroupInterval: ruleGroupIntervalDuration, + Rules: slo.Rules.SLIErrorRecRules, }) } if len(slo.Rules.MetadataRecRules) > 0 { ruleGroups.Groups = append(ruleGroups.Groups, ruleGroupYAMLv2{ - Name: fmt.Sprintf("sloth-slo-meta-recordings-%s", slo.SLO.ID), - Rules: slo.Rules.MetadataRecRules, + Name: fmt.Sprintf("sloth-slo-meta-recordings-%s", slo.SLO.ID), + RuleGroupInterval: ruleGroupIntervalDuration, + Rules: slo.Rules.MetadataRecRules, }) } if len(slo.Rules.AlertRules) > 0 { ruleGroups.Groups = append(ruleGroups.Groups, ruleGroupYAMLv2{ - Name: fmt.Sprintf("sloth-slo-alerts-%s", slo.SLO.ID), - Rules: slo.Rules.AlertRules, + Name: fmt.Sprintf("sloth-slo-alerts-%s", slo.SLO.ID), + RuleGroupInterval: ruleGroupIntervalDuration, + Rules: slo.Rules.AlertRules, }) } } @@ -112,7 +119,7 @@ type ruleGroupsYAMLv2 struct { } type ruleGroupYAMLv2 struct { - Name string `yaml:"name"` - Interval prommodel.Duration `yaml:"interval,omitempty"` - Rules []rulefmt.Rule `yaml:"rules"` + Name string `yaml:"name"` + RuleGroupInterval prommodel.Duration `yaml:"interval,omitempty"` + Rules []rulefmt.Rule `yaml:"rules"` } diff --git a/pkg/prometheus/api/v1/v1.go b/pkg/prometheus/api/v1/v1.go index d81d367d..0a608466 100644 --- a/pkg/prometheus/api/v1/v1.go +++ b/pkg/prometheus/api/v1/v1.go @@ -89,6 +89,8 @@ type SLO struct { // Alerting is the configuration with all the things related with the SLO // alerts. Alerting Alerting `yaml:"alerting"` + // RuleGroupInterval is an optional value for how often the Prometheus rule_group should be evaluated. + RuleGroupInterval string `yaml:"interval,omitempty"` } // SLI will tell what is good or bad for the SLO. From 6649a5ab0da2c6e6af21eff3cbe71c8c692b1ff1 Mon Sep 17 00:00:00 2001 From: Will Bollock Date: Tue, 13 Jun 2023 20:06:50 -0400 Subject: [PATCH 09/17] docs: add example file for custom rule groups --- examples/custom_rule_group_interval.yml | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 examples/custom_rule_group_interval.yml diff --git a/examples/custom_rule_group_interval.yml b/examples/custom_rule_group_interval.yml new file mode 100644 index 00000000..a8d4aa0d --- /dev/null +++ b/examples/custom_rule_group_interval.yml @@ -0,0 +1,30 @@ +# This example shows how you can adjust the Prometheus rule_group interval for expensive SLOs +# https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/#rule_group +# The SLO SLI measures the rate of CPU seconds spent performing softirqs +# +# `sloth generate -i ./examples/custom_rule_group_interval.yml` +# +version: "prometheus/v1" +service: "myapp" +labels: + owner: "myteam" +slos: + - name: "cpu-availability" + objective: 99.99 + description: "Example, expensive SLO. Recording rules will run every 2 minutes." + interval: "2m" + sli: + events: + error_query: | + sum( + rate(node_cpu_seconds_total{mode="softirq"}[{{.window}}]) + ) + total_query: | + sum( + rate(node_cpu_seconds_total[{{.window}}]) + ) + alerting: + page_alert: + disable: true + ticket_alert: + disable: true From e6ea8b54557b0a9047df0cfdde28798e8b7fce78 Mon Sep 17 00:00:00 2001 From: Will Bollock Date: Wed, 14 Jun 2023 17:44:27 -0400 Subject: [PATCH 10/17] ref: only append RuleGroupInterval when not empty Related to how the unit test coverage works, this will make sure RuleGroupInterval is not appended to RuleGroups unless it is defined and not empty. Not requring the `yaml` file does an okay job of this but expliclity writing the rules without RuleGroupInterval is safer. It's a bit ugly and repetitive but I think that's just how Go works.. --- internal/prometheus/storage.go | 75 +++++++++++++++++++++++++--------- 1 file changed, 56 insertions(+), 19 deletions(-) diff --git a/internal/prometheus/storage.go b/internal/prometheus/storage.go index c60dcc4b..94cc6d9c 100644 --- a/internal/prometheus/storage.go +++ b/internal/prometheus/storage.go @@ -48,32 +48,69 @@ func (i IOWriterGroupedRulesYAMLRepo) StoreSLOs(ctx context.Context, slos []Stor ruleGroups := ruleGroupsYAMLv2{} for _, slo := range slos { - ruleGroupIntervalDuration, err := prommodel.ParseDuration(slo.SLO.RuleGroupInterval) - if err != nil { - return fmt.Errorf("could not parse rule_group interval duration %w", err) - } if len(slo.Rules.SLIErrorRecRules) > 0 { - ruleGroups.Groups = append(ruleGroups.Groups, ruleGroupYAMLv2{ - Name: fmt.Sprintf("sloth-slo-sli-recordings-%s", slo.SLO.ID), - RuleGroupInterval: ruleGroupIntervalDuration, - Rules: slo.Rules.SLIErrorRecRules, - }) + if slo.SLO.RuleGroupInterval != "" { + + ruleGroupIntervalDuration, err := prommodel.ParseDuration(slo.SLO.RuleGroupInterval) + if err != nil { + return fmt.Errorf("could not parse rule_group interval duration %w", err) + } + + ruleGroups.Groups = append(ruleGroups.Groups, ruleGroupYAMLv2{ + Name: fmt.Sprintf("sloth-slo-sli-recordings-%s", slo.SLO.ID), + RuleGroupInterval: ruleGroupIntervalDuration, + Rules: slo.Rules.SLIErrorRecRules, + }) + } else { + ruleGroups.Groups = append(ruleGroups.Groups, ruleGroupYAMLv2{ + Name: fmt.Sprintf("sloth-slo-sli-recordings-%s", slo.SLO.ID), + Rules: slo.Rules.SLIErrorRecRules, + }) + + } } if len(slo.Rules.MetadataRecRules) > 0 { - ruleGroups.Groups = append(ruleGroups.Groups, ruleGroupYAMLv2{ - Name: fmt.Sprintf("sloth-slo-meta-recordings-%s", slo.SLO.ID), - RuleGroupInterval: ruleGroupIntervalDuration, - Rules: slo.Rules.MetadataRecRules, - }) + if slo.SLO.RuleGroupInterval != "" { + + ruleGroupIntervalDuration, err := prommodel.ParseDuration(slo.SLO.RuleGroupInterval) + if err != nil { + return fmt.Errorf("could not parse rule_group interval duration %w", err) + } + + ruleGroups.Groups = append(ruleGroups.Groups, ruleGroupYAMLv2{ + Name: fmt.Sprintf("sloth-slo-meta-recordings-%s", slo.SLO.ID), + RuleGroupInterval: ruleGroupIntervalDuration, + Rules: slo.Rules.MetadataRecRules, + }) + } else { + ruleGroups.Groups = append(ruleGroups.Groups, ruleGroupYAMLv2{ + Name: fmt.Sprintf("sloth-slo-meta-recordings-%s", slo.SLO.ID), + Rules: slo.Rules.MetadataRecRules, + }) + } } if len(slo.Rules.AlertRules) > 0 { - ruleGroups.Groups = append(ruleGroups.Groups, ruleGroupYAMLv2{ - Name: fmt.Sprintf("sloth-slo-alerts-%s", slo.SLO.ID), - RuleGroupInterval: ruleGroupIntervalDuration, - Rules: slo.Rules.AlertRules, - }) + if slo.SLO.RuleGroupInterval != "" { + + ruleGroupIntervalDuration, err := prommodel.ParseDuration(slo.SLO.RuleGroupInterval) + if err != nil { + return fmt.Errorf("could not parse rule_group interval duration %w", err) + } + + ruleGroups.Groups = append(ruleGroups.Groups, ruleGroupYAMLv2{ + Name: fmt.Sprintf("sloth-slo-alerts-%s", slo.SLO.ID), + RuleGroupInterval: ruleGroupIntervalDuration, + Rules: slo.Rules.AlertRules, + }) + + } else { + ruleGroups.Groups = append(ruleGroups.Groups, ruleGroupYAMLv2{ + Name: fmt.Sprintf("sloth-slo-alerts-%s", slo.SLO.ID), + Rules: slo.Rules.AlertRules, + }) + } } } From d1f6a1eed7cf9b52a6bb1c4a69176a366f07dea3 Mon Sep 17 00:00:00 2001 From: Will Bollock Date: Wed, 14 Jun 2023 17:46:33 -0400 Subject: [PATCH 11/17] test: update tests for custom rule_group interval This updates tests include `interval`'s and also includes a test to make sure the rules render correctly when interval is not included. --- internal/prometheus/storage_test.go | 45 ++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/internal/prometheus/storage_test.go b/internal/prometheus/storage_test.go index 545c692b..eeaa977f 100644 --- a/internal/prometheus/storage_test.go +++ b/internal/prometheus/storage_test.go @@ -33,7 +33,7 @@ func TestIOWriterGroupedRulesYAMLRepoStore(t *testing.T) { "Having a single SLI recording rule should render correctly.": { slos: []prometheus.StorageSLO{ { - SLO: prometheus.SLO{ID: "test1"}, + SLO: prometheus.SLO{ID: "test1", RuleGroupInterval: "2m"}, Rules: prometheus.SLORules{ SLIErrorRecRules: []rulefmt.Rule{ { @@ -52,6 +52,7 @@ func TestIOWriterGroupedRulesYAMLRepoStore(t *testing.T) { groups: - name: sloth-slo-sli-recordings-test1 + interval: 2m rules: - record: test:record expr: test-expr @@ -91,7 +92,7 @@ groups: "Having a single SLO alert rule should render correctly.": { slos: []prometheus.StorageSLO{ { - SLO: prometheus.SLO{ID: "test1"}, + SLO: prometheus.SLO{ID: "test1", RuleGroupInterval: "2m"}, Rules: prometheus.SLORules{ AlertRules: []rulefmt.Rule{ { @@ -111,6 +112,7 @@ groups: groups: - name: sloth-slo-alerts-test1 + interval: 2m rules: - alert: testAlert expr: test-expr @@ -120,11 +122,40 @@ groups: test-annot: one `, }, + "Having a single a blank or empty rule_group interval render correctly.": { + slos: []prometheus.StorageSLO{ + { + SLO: prometheus.SLO{ID: "test1", RuleGroupInterval: ""}, + Rules: prometheus.SLORules{ + SLIErrorRecRules: []rulefmt.Rule{ + { + Record: "test:record", + Expr: "test-expr", + Labels: map[string]string{"test-label": "one"}, + }, + }, + }, + }, + }, + expYAML: ` +--- +# Code generated by Sloth (dev): https://github.com/slok/sloth. +# DO NOT EDIT. + +groups: +- name: sloth-slo-sli-recordings-test1 + rules: + - record: test:record + expr: test-expr + labels: + test-label: one +`, + }, "Having a multiple SLO alert and recording rules should render correctly.": { slos: []prometheus.StorageSLO{ { - SLO: prometheus.SLO{ID: "testa"}, + SLO: prometheus.SLO{ID: "testa", RuleGroupInterval: "3m"}, Rules: prometheus.SLORules{ SLIErrorRecRules: []rulefmt.Rule{ { @@ -167,7 +198,7 @@ groups: }, }, { - SLO: prometheus.SLO{ID: "testb"}, + SLO: prometheus.SLO{ID: "testb", RuleGroupInterval: "1h"}, Rules: prometheus.SLORules{ SLIErrorRecRules: []rulefmt.Rule{ { @@ -201,6 +232,7 @@ groups: groups: - name: sloth-slo-sli-recordings-testa + interval: 3m rules: - record: test:record-a1 expr: test-expr-a1 @@ -211,6 +243,7 @@ groups: labels: test-label: a-2 - name: sloth-slo-meta-recordings-testa + interval: 3m rules: - record: test:record-a3 expr: test-expr-a3 @@ -221,6 +254,7 @@ groups: labels: test-label: a-4 - name: sloth-slo-alerts-testa + interval: 3m rules: - alert: testAlertA1 expr: test-expr-a1 @@ -235,18 +269,21 @@ groups: annotations: test-annot: a-2 - name: sloth-slo-sli-recordings-testb + interval: 1h rules: - record: test:record-b1 expr: test-expr-b1 labels: test-label: b-1 - name: sloth-slo-meta-recordings-testb + interval: 1h rules: - record: test:record-b2 expr: test-expr-b2 labels: test-label: b-2 - name: sloth-slo-alerts-testb + interval: 1h rules: - alert: testAlertB1 expr: test-expr-b1 From dc622641e2e19fa0a75106011cadef88f337e286 Mon Sep 17 00:00:00 2001 From: Will Bollock Date: Mon, 26 Jun 2023 16:11:12 -0400 Subject: [PATCH 12/17] ref: add rule intervals per rule type Instead of a singular global default, now a rule_group interval can be set for every individual type of rule_group Sloth generates. The generic, `interval:all` rule will also stay and can "fill in" any missing per-rule group defaults. Along with the default behavior of doing nothing if no `interval` is specified. --- internal/prometheus/model.go | 38 +++++++++++++++++++++++---------- internal/prometheus/spec.go | 23 +++++++++++--------- internal/prometheus/storage.go | 39 ++++++++++++++++++++++++++++------ pkg/prometheus/api/v1/v1.go | 19 +++++++++++++++-- 4 files changed, 90 insertions(+), 29 deletions(-) diff --git a/internal/prometheus/model.go b/internal/prometheus/model.go index 09dd2519..4b7f2c42 100644 --- a/internal/prometheus/model.go +++ b/internal/prometheus/model.go @@ -39,17 +39,20 @@ type AlertMeta struct { // SLO represents a service level objective configuration. type SLO struct { - ID string `validate:"required,name"` - Name string `validate:"required,name"` - Description string - Service string `validate:"required,name"` - RuleGroupInterval string - SLI SLI `validate:"required"` - TimeWindow time.Duration `validate:"required"` - Objective float64 `validate:"gt=0,lte=100"` - Labels map[string]string `validate:"dive,keys,prom_label_key,endkeys,required,prom_label_value"` - PageAlertMeta AlertMeta - TicketAlertMeta AlertMeta + ID string `validate:"required,name"` + Name string `validate:"required,name"` + Description string + Service string `validate:"required,name"` + RuleGroupInterval time.Duration `validate:"time"` + SLIErrorRulesInterval time.Duration `validate:"time"` + MetadataRulesInterval time.Duration `validate:"time"` + AlertRulesInterval time.Duration `validate:"time"` + SLI SLI `validate:"required"` + TimeWindow time.Duration `validate:"required"` + Objective float64 `validate:"gt=0,lte=100"` + Labels map[string]string `validate:"dive,keys,prom_label_key,endkeys,required,prom_label_value"` + PageAlertMeta AlertMeta + TicketAlertMeta AlertMeta } type SLOGroup struct { @@ -87,6 +90,7 @@ var modelSpecValidate = func() *validator.Validate { mustRegisterValidation(v, "name", validateName) mustRegisterValidation(v, "required_if_enabled", validateRequiredEnabledAlertName) mustRegisterValidation(v, "template_vars", validateTemplateVars) + mustRegisterValidation(v, "time", validateTime) v.RegisterStructValidation(validateOneSLI, SLI{}) v.RegisterStructValidation(validateSLOGroup, SLOGroup{}) v.RegisterStructValidation(validateSLIEvents, SLIEvents{}) @@ -182,6 +186,18 @@ func validateName(fl validator.FieldLevel) bool { return nameRegexp.MatchString(s) } +// validateTime implements validator.CustomTypeFunc by validating +// a time duration. +func validateTime(fl validator.FieldLevel) bool { + s, ok := fl.Field().Interface().(time.Duration) + if !ok { + return false + } + + _, err := time.ParseDuration(s.String()) + return err == nil +} + func validateRequiredEnabledAlertName(fl validator.FieldLevel) bool { alertMeta, ok := fl.Parent().Interface().(AlertMeta) if !ok { diff --git a/internal/prometheus/spec.go b/internal/prometheus/spec.go index 5164005a..eb499b36 100644 --- a/internal/prometheus/spec.go +++ b/internal/prometheus/spec.go @@ -69,16 +69,19 @@ func (y YAMLSpecLoader) mapSpecToModel(ctx context.Context, spec prometheusv1.Sp models := make([]SLO, 0, len(spec.SLOs)) for _, specSLO := range spec.SLOs { slo := SLO{ - ID: fmt.Sprintf("%s-%s", spec.Service, specSLO.Name), - RuleGroupInterval: specSLO.RuleGroupInterval, - Name: specSLO.Name, - Description: specSLO.Description, - Service: spec.Service, - TimeWindow: y.windowPeriod, - Objective: specSLO.Objective, - Labels: mergeLabels(spec.Labels, specSLO.Labels), - PageAlertMeta: AlertMeta{Disable: true}, - TicketAlertMeta: AlertMeta{Disable: true}, + ID: fmt.Sprintf("%s-%s", spec.Service, specSLO.Name), + RuleGroupInterval: specSLO.Interval.RuleGroupInterval, + SLIErrorRulesInterval: specSLO.Interval.SLIErrorRulesInterval, + MetadataRulesInterval: specSLO.Interval.MetadataRulesInterval, + AlertRulesInterval: specSLO.Interval.AlertRulesInterval, + Name: specSLO.Name, + Description: specSLO.Description, + Service: spec.Service, + TimeWindow: y.windowPeriod, + Objective: specSLO.Objective, + Labels: mergeLabels(spec.Labels, specSLO.Labels), + PageAlertMeta: AlertMeta{Disable: true}, + TicketAlertMeta: AlertMeta{Disable: true}, } // Set SLIs. diff --git a/internal/prometheus/storage.go b/internal/prometheus/storage.go index 94cc6d9c..72422739 100644 --- a/internal/prometheus/storage.go +++ b/internal/prometheus/storage.go @@ -49,9 +49,19 @@ func (i IOWriterGroupedRulesYAMLRepo) StoreSLOs(ctx context.Context, slos []Stor ruleGroups := ruleGroupsYAMLv2{} for _, slo := range slos { if len(slo.Rules.SLIErrorRecRules) > 0 { - if slo.SLO.RuleGroupInterval != "" { - ruleGroupIntervalDuration, err := prommodel.ParseDuration(slo.SLO.RuleGroupInterval) + // 0s is default empty string value for time.Duration + if slo.SLO.RuleGroupInterval.String() != "0s" || slo.SLO.SLIErrorRulesInterval.String() != "0s" { + var ruleGroupIntervalDuration prommodel.Duration + var err error + + // if we have a valid meta rule rule_group interval, use that first and overwrite any generic ones + if slo.SLO.SLIErrorRulesInterval.String() != "0s" { + ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.SLIErrorRulesInterval.String()) + } else { + ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.RuleGroupInterval.String()) + } + if err != nil { return fmt.Errorf("could not parse rule_group interval duration %w", err) } @@ -71,9 +81,18 @@ func (i IOWriterGroupedRulesYAMLRepo) StoreSLOs(ctx context.Context, slos []Stor } if len(slo.Rules.MetadataRecRules) > 0 { - if slo.SLO.RuleGroupInterval != "" { + // if either of these aren't empty we'll be adding a custom rule interval + if slo.SLO.RuleGroupInterval.String() != "0s" || slo.SLO.MetadataRulesInterval.String() != "0s" { + var ruleGroupIntervalDuration prommodel.Duration + var err error + + // if we have a valid meta rule rule_group interval, use that firs + if slo.SLO.MetadataRulesInterval.String() != "0s" { + ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.MetadataRulesInterval.String()) + } else { + ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.RuleGroupInterval.String()) + } - ruleGroupIntervalDuration, err := prommodel.ParseDuration(slo.SLO.RuleGroupInterval) if err != nil { return fmt.Errorf("could not parse rule_group interval duration %w", err) } @@ -92,9 +111,17 @@ func (i IOWriterGroupedRulesYAMLRepo) StoreSLOs(ctx context.Context, slos []Stor } if len(slo.Rules.AlertRules) > 0 { - if slo.SLO.RuleGroupInterval != "" { + if slo.SLO.RuleGroupInterval.String() != "0s" || slo.SLO.AlertRulesInterval.String() != "0s" { + var ruleGroupIntervalDuration prommodel.Duration + var err error + + // if we have a valid meta rule rule_group interval, use that firs + if slo.SLO.AlertRulesInterval.String() != "0s" { + ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.AlertRulesInterval.String()) + } else { + ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.RuleGroupInterval.String()) + } - ruleGroupIntervalDuration, err := prommodel.ParseDuration(slo.SLO.RuleGroupInterval) if err != nil { return fmt.Errorf("could not parse rule_group interval duration %w", err) } diff --git a/pkg/prometheus/api/v1/v1.go b/pkg/prometheus/api/v1/v1.go index 0a608466..44f71a3c 100644 --- a/pkg/prometheus/api/v1/v1.go +++ b/pkg/prometheus/api/v1/v1.go @@ -54,6 +54,8 @@ // disable: true package v1 +import "time" + const Version = "prometheus/v1" //go:generate gomarkdoc -o ./README.md ./ @@ -89,8 +91,9 @@ type SLO struct { // Alerting is the configuration with all the things related with the SLO // alerts. Alerting Alerting `yaml:"alerting"` - // RuleGroupInterval is an optional value for how often the Prometheus rule_group should be evaluated. - RuleGroupInterval string `yaml:"interval,omitempty"` + // Interval is the configuration for all things related to SLO rule_group intervals + // for specific rule groups and all rules. + Interval Interval `yaml:"interval,omitempty"` } // SLI will tell what is good or bad for the SLO. @@ -150,6 +153,18 @@ type Alerting struct { TicketAlert Alert `yaml:"ticket_alert,omitempty"` } +type Interval struct { + // RuleGroupInterval is an optional value for how often the Prometheus rule_group should be evaluated. + // RuleGroupInterval string `yaml:"rulegroup_interval,omitempty"` + RuleGroupInterval time.Duration `yaml:"all,omitempty"` + // Otherwise, specify custom rule_group intervals for each set of recording rules. + // RuleGroupInterval will "fill-in" for any non-specified individual groups + // but individual group settings override RuleGroupInterval. + SLIErrorRulesInterval time.Duration `yaml:"slierror,omitempty"` + MetadataRulesInterval time.Duration `yaml:"metadata,omitempty"` + AlertRulesInterval time.Duration `yaml:"alert,omitempty"` +} + // Alert configures specific SLO alert. type Alert struct { // Disable disables the alert and makes Sloth not generating this alert. This From e7da98ee6ab39e8adffffcd81128c45da709fa1b Mon Sep 17 00:00:00 2001 From: Will Bollock Date: Mon, 26 Jun 2023 16:55:48 -0400 Subject: [PATCH 13/17] test: add tests for custom rule group intervals Specific ones and general/specific combined --- internal/prometheus/storage_test.go | 160 ++++++++++++++++++++++++++-- 1 file changed, 154 insertions(+), 6 deletions(-) diff --git a/internal/prometheus/storage_test.go b/internal/prometheus/storage_test.go index eeaa977f..b550b2a0 100644 --- a/internal/prometheus/storage_test.go +++ b/internal/prometheus/storage_test.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "testing" + "time" "github.com/prometheus/prometheus/model/rulefmt" "github.com/stretchr/testify/assert" @@ -12,7 +13,29 @@ import ( "github.com/slok/sloth/internal/prometheus" ) +func parseDuration(durationStr string, t *testing.T) time.Duration { + duration, err := time.ParseDuration(durationStr) + if err != nil { + t.Errorf("could not parse duration: %v", err) + return 0 + } + return duration +} + func TestIOWriterGroupedRulesYAMLRepoStore(t *testing.T) { + // set intervals ahead of time + ruleGroupInterval := parseDuration("2m", t) + // 0s = default/blank + ruleGroupIntervalBlank := parseDuration("0s", t) + // A/B for multiple group test + ruleGroupIntervalA := parseDuration("3m", t) + ruleGroupIntervalB := parseDuration("1h", t) + // for individual settings + sliErrorRulesInterval := parseDuration("4m", t) + metadataRulesInterval := parseDuration("5m", t) + alertRulesInterval := parseDuration("6m", t) + // need test for mix of rulegroupinterval and individual + tests := map[string]struct { slos []prometheus.StorageSLO expYAML string @@ -30,10 +53,11 @@ func TestIOWriterGroupedRulesYAMLRepoStore(t *testing.T) { expErr: true, }, - "Having a single SLI recording rule should render correctly.": { + "Having a single SLI recording rule with the generic rule_group interval should render correctly.": { + slos: []prometheus.StorageSLO{ { - SLO: prometheus.SLO{ID: "test1", RuleGroupInterval: "2m"}, + SLO: prometheus.SLO{ID: "test1", RuleGroupInterval: ruleGroupInterval}, Rules: prometheus.SLORules{ SLIErrorRecRules: []rulefmt.Rule{ { @@ -92,7 +116,7 @@ groups: "Having a single SLO alert rule should render correctly.": { slos: []prometheus.StorageSLO{ { - SLO: prometheus.SLO{ID: "test1", RuleGroupInterval: "2m"}, + SLO: prometheus.SLO{ID: "test1", RuleGroupInterval: ruleGroupInterval}, Rules: prometheus.SLORules{ AlertRules: []rulefmt.Rule{ { @@ -125,7 +149,7 @@ groups: "Having a single a blank or empty rule_group interval render correctly.": { slos: []prometheus.StorageSLO{ { - SLO: prometheus.SLO{ID: "test1", RuleGroupInterval: ""}, + SLO: prometheus.SLO{ID: "test1", RuleGroupInterval: ruleGroupIntervalBlank}, Rules: prometheus.SLORules{ SLIErrorRecRules: []rulefmt.Rule{ { @@ -155,7 +179,7 @@ groups: "Having a multiple SLO alert and recording rules should render correctly.": { slos: []prometheus.StorageSLO{ { - SLO: prometheus.SLO{ID: "testa", RuleGroupInterval: "3m"}, + SLO: prometheus.SLO{ID: "testa", RuleGroupInterval: ruleGroupIntervalA}, Rules: prometheus.SLORules{ SLIErrorRecRules: []rulefmt.Rule{ { @@ -198,7 +222,7 @@ groups: }, }, { - SLO: prometheus.SLO{ID: "testb", RuleGroupInterval: "1h"}, + SLO: prometheus.SLO{ID: "testb", RuleGroupInterval: ruleGroupIntervalB}, Rules: prometheus.SLORules{ SLIErrorRecRules: []rulefmt.Rule{ { @@ -293,6 +317,130 @@ groups: test-annot: b-1 `, }, + "Having a mix of rule group intervals should render correctly.": { + + slos: []prometheus.StorageSLO{ + { + SLO: prometheus.SLO{ID: "testa", SLIErrorRulesInterval: sliErrorRulesInterval, MetadataRulesInterval: metadataRulesInterval, AlertRulesInterval: alertRulesInterval}, + Rules: prometheus.SLORules{ + SLIErrorRecRules: []rulefmt.Rule{ + { + Record: "test:record-a1", + Expr: "test-expr-a1", + Labels: map[string]string{"test-label": "a-1"}, + }, + }, + MetadataRecRules: []rulefmt.Rule{ + { + Record: "test:record-a3", + Expr: "test-expr-a3", + Labels: map[string]string{"test-label": "a-3"}, + }, + }, + AlertRules: []rulefmt.Rule{ + { + Alert: "testAlertA1", + Expr: "test-expr-a1", + Labels: map[string]string{"test-label": "a-1"}, + Annotations: map[string]string{"test-annot": "a-1"}, + }, + }, + }, + }, + }, + expYAML: ` +--- +# Code generated by Sloth (dev): https://github.com/slok/sloth. +# DO NOT EDIT. + +groups: +- name: sloth-slo-sli-recordings-testa + interval: 4m + rules: + - record: test:record-a1 + expr: test-expr-a1 + labels: + test-label: a-1 +- name: sloth-slo-meta-recordings-testa + interval: 5m + rules: + - record: test:record-a3 + expr: test-expr-a3 + labels: + test-label: a-3 +- name: sloth-slo-alerts-testa + interval: 6m + rules: + - alert: testAlertA1 + expr: test-expr-a1 + labels: + test-label: a-1 + annotations: + test-annot: a-1 +`}, + "Having a mix of rule group intervals and the overarching rule_group interval should render correctly.": { + + slos: []prometheus.StorageSLO{ + { + SLO: prometheus.SLO{ID: "testa", SLIErrorRulesInterval: sliErrorRulesInterval, MetadataRulesInterval: metadataRulesInterval, RuleGroupInterval: ruleGroupInterval}, + // in this case we use the broad RuleGroupInterval to set a 2m interval for the alert rules + // that dont have an explicit one set + Rules: prometheus.SLORules{ + SLIErrorRecRules: []rulefmt.Rule{ + { + Record: "test:record-a1", + Expr: "test-expr-a1", + Labels: map[string]string{"test-label": "a-1"}, + }, + }, + MetadataRecRules: []rulefmt.Rule{ + { + Record: "test:record-a3", + Expr: "test-expr-a3", + Labels: map[string]string{"test-label": "a-3"}, + }, + }, + AlertRules: []rulefmt.Rule{ + { + Alert: "testAlertA1", + Expr: "test-expr-a1", + Labels: map[string]string{"test-label": "a-1"}, + Annotations: map[string]string{"test-annot": "a-1"}, + }, + }, + }, + }, + }, + expYAML: ` +--- +# Code generated by Sloth (dev): https://github.com/slok/sloth. +# DO NOT EDIT. + +groups: +- name: sloth-slo-sli-recordings-testa + interval: 4m + rules: + - record: test:record-a1 + expr: test-expr-a1 + labels: + test-label: a-1 +- name: sloth-slo-meta-recordings-testa + interval: 5m + rules: + - record: test:record-a3 + expr: test-expr-a3 + labels: + test-label: a-3 +- name: sloth-slo-alerts-testa + interval: 2m + rules: + - alert: testAlertA1 + expr: test-expr-a1 + labels: + test-label: a-1 + annotations: + test-annot: a-1 +`}, } for name, test := range tests { From c771d7f415ddd77a72ee8676dbfb19debae4de41 Mon Sep 17 00:00:00 2001 From: Will Bollock Date: Mon, 26 Jun 2023 16:56:12 -0400 Subject: [PATCH 14/17] chore: update example for custom rule groups --- examples/custom_rule_group_interval.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/examples/custom_rule_group_interval.yml b/examples/custom_rule_group_interval.yml index a8d4aa0d..94cfc461 100644 --- a/examples/custom_rule_group_interval.yml +++ b/examples/custom_rule_group_interval.yml @@ -12,7 +12,13 @@ slos: - name: "cpu-availability" objective: 99.99 description: "Example, expensive SLO. Recording rules will run every 2 minutes." - interval: "2m" + # alternative way of specifying interval for all three sets of rules + # interval: + # all: "5m" + interval: # all of these are different sets of rule groups sloth can make + slierror: "4m" + metadata: "2m" + alert: "2m" sli: events: error_query: | @@ -24,7 +30,14 @@ slos: rate(node_cpu_seconds_total[{{.window}}]) ) alerting: + name: MyServiceHighErrorRate + labels: + category: "availability" + annotations: + summary: "High error rate on 'myservice' requests responses" page_alert: - disable: true + labels: + severity: pageteam + routing_key: myteam ticket_alert: disable: true From 637745ff63b1ca3a98c4a045a0d0da0023010702 Mon Sep 17 00:00:00 2001 From: Will Bollock Date: Mon, 3 Jul 2023 08:57:30 -0400 Subject: [PATCH 15/17] docs: finish comments Co-authored-by: Will Hegedus --- internal/prometheus/storage.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/prometheus/storage.go b/internal/prometheus/storage.go index 72422739..588daf6c 100644 --- a/internal/prometheus/storage.go +++ b/internal/prometheus/storage.go @@ -86,7 +86,7 @@ func (i IOWriterGroupedRulesYAMLRepo) StoreSLOs(ctx context.Context, slos []Stor var ruleGroupIntervalDuration prommodel.Duration var err error - // if we have a valid meta rule rule_group interval, use that firs + // if we have a valid meta rule rule_group interval, use that first and overwrite any generic ones if slo.SLO.MetadataRulesInterval.String() != "0s" { ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.MetadataRulesInterval.String()) } else { @@ -115,7 +115,7 @@ func (i IOWriterGroupedRulesYAMLRepo) StoreSLOs(ctx context.Context, slos []Stor var ruleGroupIntervalDuration prommodel.Duration var err error - // if we have a valid meta rule rule_group interval, use that firs + // if we have a valid meta rule rule_group interval, use that first and overwrite any generic ones if slo.SLO.AlertRulesInterval.String() != "0s" { ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.AlertRulesInterval.String()) } else { From 96e977be2891284dfe503e028502ea8a78bdbb5d Mon Sep 17 00:00:00 2001 From: Will Bollock Date: Mon, 3 Jul 2023 09:19:31 -0400 Subject: [PATCH 16/17] ref: rule interval groups less repetitive --- internal/prometheus/storage.go | 130 ++++++++++++++++----------------- 1 file changed, 64 insertions(+), 66 deletions(-) diff --git a/internal/prometheus/storage.go b/internal/prometheus/storage.go index 588daf6c..4edf4881 100644 --- a/internal/prometheus/storage.go +++ b/internal/prometheus/storage.go @@ -50,94 +50,92 @@ func (i IOWriterGroupedRulesYAMLRepo) StoreSLOs(ctx context.Context, slos []Stor for _, slo := range slos { if len(slo.Rules.SLIErrorRecRules) > 0 { - // 0s is default empty string value for time.Duration - if slo.SLO.RuleGroupInterval.String() != "0s" || slo.SLO.SLIErrorRulesInterval.String() != "0s" { - var ruleGroupIntervalDuration prommodel.Duration - var err error - - // if we have a valid meta rule rule_group interval, use that first and overwrite any generic ones - if slo.SLO.SLIErrorRulesInterval.String() != "0s" { - ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.SLIErrorRulesInterval.String()) + group := ruleGroupYAMLv2{ + Name: fmt.Sprintf("sloth-slo-sli-recordings-%s", slo.SLO.ID), + Rules: slo.Rules.SLIErrorRecRules, + } + + var ruleGroupIntervalDuration prommodel.Duration + var err error + + switch { + case slo.SLO.SLIErrorRulesInterval.String() != "0s": + ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.SLIErrorRulesInterval.String()) + if err != nil { + return fmt.Errorf("could not parse rule_group interval duration for alerts %w", err) } else { - ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.RuleGroupInterval.String()) + group.RuleGroupInterval = ruleGroupIntervalDuration } - + case slo.SLO.RuleGroupInterval.String() != "0s": + ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.RuleGroupInterval.String()) if err != nil { - return fmt.Errorf("could not parse rule_group interval duration %w", err) + return fmt.Errorf("could not parse default ('all') rule_group interval duration %w", err) + } else { + group.RuleGroupInterval = ruleGroupIntervalDuration } - - ruleGroups.Groups = append(ruleGroups.Groups, ruleGroupYAMLv2{ - Name: fmt.Sprintf("sloth-slo-sli-recordings-%s", slo.SLO.ID), - RuleGroupInterval: ruleGroupIntervalDuration, - Rules: slo.Rules.SLIErrorRecRules, - }) - } else { - ruleGroups.Groups = append(ruleGroups.Groups, ruleGroupYAMLv2{ - Name: fmt.Sprintf("sloth-slo-sli-recordings-%s", slo.SLO.ID), - Rules: slo.Rules.SLIErrorRecRules, - }) - } + + ruleGroups.Groups = append(ruleGroups.Groups, group) } if len(slo.Rules.MetadataRecRules) > 0 { - // if either of these aren't empty we'll be adding a custom rule interval - if slo.SLO.RuleGroupInterval.String() != "0s" || slo.SLO.MetadataRulesInterval.String() != "0s" { - var ruleGroupIntervalDuration prommodel.Duration - var err error - - // if we have a valid meta rule rule_group interval, use that first and overwrite any generic ones - if slo.SLO.MetadataRulesInterval.String() != "0s" { - ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.MetadataRulesInterval.String()) + + group := ruleGroupYAMLv2{ + Name: fmt.Sprintf("sloth-slo-meta-recordings-%s", slo.SLO.ID), + Rules: slo.Rules.MetadataRecRules, + } + + var ruleGroupIntervalDuration prommodel.Duration + var err error + + switch { + case slo.SLO.MetadataRulesInterval.String() != "0s": + ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.MetadataRulesInterval.String()) + if err != nil { + return fmt.Errorf("could not parse rule_group interval duration for alerts %w", err) } else { - ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.RuleGroupInterval.String()) + group.RuleGroupInterval = ruleGroupIntervalDuration } - + case slo.SLO.RuleGroupInterval.String() != "0s": + ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.RuleGroupInterval.String()) if err != nil { - return fmt.Errorf("could not parse rule_group interval duration %w", err) + return fmt.Errorf("could not parse default ('all') rule_group interval duration %w", err) + } else { + group.RuleGroupInterval = ruleGroupIntervalDuration } - - ruleGroups.Groups = append(ruleGroups.Groups, ruleGroupYAMLv2{ - Name: fmt.Sprintf("sloth-slo-meta-recordings-%s", slo.SLO.ID), - RuleGroupInterval: ruleGroupIntervalDuration, - Rules: slo.Rules.MetadataRecRules, - }) - } else { - ruleGroups.Groups = append(ruleGroups.Groups, ruleGroupYAMLv2{ - Name: fmt.Sprintf("sloth-slo-meta-recordings-%s", slo.SLO.ID), - Rules: slo.Rules.MetadataRecRules, - }) } + + ruleGroups.Groups = append(ruleGroups.Groups, group) } if len(slo.Rules.AlertRules) > 0 { - if slo.SLO.RuleGroupInterval.String() != "0s" || slo.SLO.AlertRulesInterval.String() != "0s" { - var ruleGroupIntervalDuration prommodel.Duration - var err error - // if we have a valid meta rule rule_group interval, use that first and overwrite any generic ones - if slo.SLO.AlertRulesInterval.String() != "0s" { - ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.AlertRulesInterval.String()) + group := ruleGroupYAMLv2{ + Name: fmt.Sprintf("sloth-slo-alerts-%s", slo.SLO.ID), + Rules: slo.Rules.AlertRules, + } + + var ruleGroupIntervalDuration prommodel.Duration + var err error + + switch { + case slo.SLO.AlertRulesInterval.String() != "0s": + ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.AlertRulesInterval.String()) + if err != nil { + return fmt.Errorf("could not parse rule_group interval duration for alerts %w", err) } else { - ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.RuleGroupInterval.String()) + group.RuleGroupInterval = ruleGroupIntervalDuration } - + case slo.SLO.RuleGroupInterval.String() != "0s": + ruleGroupIntervalDuration, err = prommodel.ParseDuration(slo.SLO.RuleGroupInterval.String()) if err != nil { - return fmt.Errorf("could not parse rule_group interval duration %w", err) + return fmt.Errorf("could not parse default ('all') rule_group interval duration %w", err) + } else { + group.RuleGroupInterval = ruleGroupIntervalDuration } - - ruleGroups.Groups = append(ruleGroups.Groups, ruleGroupYAMLv2{ - Name: fmt.Sprintf("sloth-slo-alerts-%s", slo.SLO.ID), - RuleGroupInterval: ruleGroupIntervalDuration, - Rules: slo.Rules.AlertRules, - }) - - } else { - ruleGroups.Groups = append(ruleGroups.Groups, ruleGroupYAMLv2{ - Name: fmt.Sprintf("sloth-slo-alerts-%s", slo.SLO.ID), - Rules: slo.Rules.AlertRules, - }) } + + ruleGroups.Groups = append(ruleGroups.Groups, group) } } From 13c3ecfbec6fe7338318e442d78ba09470a68fc1 Mon Sep 17 00:00:00 2001 From: Will Bollock Date: Mon, 3 Jul 2023 10:05:19 -0400 Subject: [PATCH 17/17] feat: v0.12.0 --- CHANGELOG.md | 7 ++++++- deploy/kubernetes/helm/sloth/values.yaml | 2 +- deploy/kubernetes/raw/sloth-with-common-plugins.yaml | 2 +- deploy/kubernetes/raw/sloth.yaml | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e24d724..3aa1a879 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +## [v0.12.0] - 2023-07-03 + +- Custom rule_group intervals, for all recording rule types or a global default. + ## [v0.11.0] - 2022-10-22 ### Changed @@ -162,7 +166,8 @@ - Support raw query based SLI. - Kubernetes (prometheus-operator) CRD generation support. -[unreleased]: https://github.com/slok/sloth/compare/v0.11.0...HEAD +[unreleased]: https://github.com/slok/sloth/compare/v0.12.0...HEAD +[v0.12.0]: https://github.com/slok/sloth/compare/v0.11.0...v0.12.0 [v0.11.0]: https://github.com/slok/sloth/compare/v0.10.0...v0.11.0 [v0.10.0]: https://github.com/slok/sloth/compare/v0.9.0...v0.10.0 [v0.9.0]: https://github.com/slok/sloth/compare/v0.8.0...v0.9.0 diff --git a/deploy/kubernetes/helm/sloth/values.yaml b/deploy/kubernetes/helm/sloth/values.yaml index 8c8b309d..a7b5fe44 100644 --- a/deploy/kubernetes/helm/sloth/values.yaml +++ b/deploy/kubernetes/helm/sloth/values.yaml @@ -2,7 +2,7 @@ labels: {} image: repository: ghcr.io/slok/sloth - tag: v0.11.0 + tag: v0.12.0 # -- Container resources: requests and limits for CPU, Memory resources: diff --git a/deploy/kubernetes/raw/sloth-with-common-plugins.yaml b/deploy/kubernetes/raw/sloth-with-common-plugins.yaml index 21de1723..522652b2 100644 --- a/deploy/kubernetes/raw/sloth-with-common-plugins.yaml +++ b/deploy/kubernetes/raw/sloth-with-common-plugins.yaml @@ -85,7 +85,7 @@ spec: serviceAccountName: sloth containers: - name: sloth - image: ghcr.io/slok/sloth:v0.11.0 + image: ghcr.io/slok/sloth:v0.12.0 args: - kubernetes-controller - --sli-plugins-path=/plugins diff --git a/deploy/kubernetes/raw/sloth.yaml b/deploy/kubernetes/raw/sloth.yaml index 458928f3..228d9bc2 100644 --- a/deploy/kubernetes/raw/sloth.yaml +++ b/deploy/kubernetes/raw/sloth.yaml @@ -85,7 +85,7 @@ spec: serviceAccountName: sloth containers: - name: sloth - image: ghcr.io/slok/sloth:v0.11.0 + image: ghcr.io/slok/sloth:v0.12.0 args: - kubernetes-controller ports: