mirror of https://github.com/knative/caching.git
upgrade to latest dependencies (#860)
bumping google.golang.org/genproto/googleapis/rpc 94a12d6...8c6c420: > 8c6c420 chore(all): update all to 7cd4c1c (# 1111) > 79826c8 chore(all): auto-regenerate .pb.go files (# 1112) > 7cd4c1c chore(all): auto-regenerate .pb.go files (# 1110) > 26222e5 chore(all): update all (# 1109) > 6f501c4 chore(all): auto-regenerate .pb.go files (# 1107) > c3f9821 chore(all): update all (# 1108) > 454cdb8 chore(all): auto-regenerate .pb.go files (# 1106) > beb30f4 chore(all): auto-regenerate .pb.go files (# 1101) > 64ea030 chore(all): update all (# 1105) bumping knative.dev/hack 1133b37...abdcdea: > abdcdea Update community files (# 380) > 9f6c92e Update community files (# 379) bumping knative.dev/pkg 0f34a88...b69fa27: > b69fa27 Bump google.golang.org/api from 0.176.0 to 0.176.1 (# 3025) > 75c6937 Bump github.com/openzipkin/zipkin-go from 0.4.2 to 0.4.3 (# 3026) > ca5f1ce Update community files (# 3024) > 3c6badc Bump google.golang.org/api from 0.172.0 to 0.176.0 (# 3023) > e8d193d Bump cloud.google.com/go/compute/metadata from 0.2.3 to 0.3.0 (# 3022) > 9ab7e10 Bump github.com/prometheus/common from 0.52.3 to 0.53.0 (# 3020) > e835586 Update community files (# 3019) bumping google.golang.org/api 707b9b2...64f40ff: > 64f40ff chore(main): release 0.176.1 (# 2542) > 8d0b2b5 fix(transport/http): pass through base transport (# 2541) > 81ccc7e chore(main): release 0.176.0 (# 2536) > 6825bb8 feat(all): auto-regenerate discovery clients (# 2540) > 30d8c87 feat(all): auto-regenerate discovery clients (# 2538) > 773fe01 feat(all): auto-regenerate discovery clients (# 2537) > 5a78abe fix: default defaultEndpointTemplate (# 2535) > 67a5d6d chore(main): release 0.175.0 (# 2527) > d64b1d0 fix: various auth transition bugs (# 2533) > 9622a0d feat(all): auto-regenerate discovery clients (# 2529) > f662ab7 fix: bump auth deps (# 2528) > ec3a580 feat(all): auto-regenerate discovery clients (# 2526) > f8960e3 chore(main): release 0.174.0 (# 2521) > 0f0a2f0 fix(internal): set scopes for new auth flow (# 2525) > f49960d feat(all): auto-regenerate discovery clients (# 2524) > 4054271 feat: add hooks in for new auth library (# 2228) > 46fc56a chore(main): release 0.173.0 (# 2495) > 053d45a chore(all): update module github.com/google/go-github/v59 to v61 (# 2512) > bf1c054 feat(all): auto-regenerate discovery clients (# 2520) > 85b4e90 feat(all): auto-regenerate discovery clients (# 2516) > b71b80f feat(all): auto-regenerate discovery clients (# 2515) > 4826df4 feat(all): auto-regenerate discovery clients (# 2514) > 3e03de3 feat(all): auto-regenerate discovery clients (# 2513) > 4e450ec feat(option): add support for env var GOOGLE_CLOUD_UNIVERSE_DOMAIN (# 2509) > 0ff027b feat(all): auto-regenerate discovery clients (# 2510) > caf5b3f feat(all): auto-regenerate discovery clients (# 2508) > 3daccec feat(all): auto-regenerate discovery clients (# 2506) > baa809b feat(all): auto-regenerate discovery clients (# 2505) > 7ec3ef8 feat(all): auto-regenerate discovery clients (# 2504) > c786111 chore(all): update all to 454cdb8 (# 2502) > 6ee6a57 feat(all): auto-regenerate discovery clients (# 2503) > cdac273 feat(all): auto-regenerate discovery clients (# 2501) > 5b9019f feat(all): auto-regenerate discovery clients (# 2500) > 4ebe65e feat(all): auto-regenerate discovery clients (# 2499) > a48e9de feat(all): auto-regenerate discovery clients (# 2494) bumping github.com/prometheus/common 0234594...e54e4df: > e54e4df Merge pull request # 620 from bboreham/test-string > e25b951 Merge pull request # 619 from bboreham/restore-sort > a1ca958 LabelSet: add unit test for String method > c1b9b72 Fix up config test (# 621) > be294f1 LabelSet.String: restore faster sort call > de5ed88 Merge pull request # 487 from GiedriusS/allow_exposing_real_value > ea817bb Merge pull request # 618 from grobinson-grafana/grobinson/add-status-at > 5ad26bf config: allow exposing real secret value through marshal > 506a12c Fix comment > fb6970a Add StatusAt method for Alert struct Signed-off-by: Knative Automation <automation@knative.team>
This commit is contained in:
parent
7a4814e051
commit
0e575a3775
10
go.mod
10
go.mod
|
@ -10,8 +10,8 @@ require (
|
|||
k8s.io/client-go v0.29.2
|
||||
k8s.io/code-generator v0.29.2
|
||||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00
|
||||
knative.dev/hack v0.0.0-20240404013450-1133b37da8d7
|
||||
knative.dev/pkg v0.0.0-20240416145024-0f34a8815650
|
||||
knative.dev/hack v0.0.0-20240426013324-abdcdea830f0
|
||||
knative.dev/pkg v0.0.0-20240429080158-b69fa2713537
|
||||
)
|
||||
|
||||
require (
|
||||
|
@ -50,7 +50,7 @@ require (
|
|||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/prometheus/client_golang v1.19.0 // indirect
|
||||
github.com/prometheus/client_model v0.6.0 // indirect
|
||||
github.com/prometheus/common v0.52.3 // indirect
|
||||
github.com/prometheus/common v0.53.0 // indirect
|
||||
github.com/prometheus/procfs v0.12.0 // indirect
|
||||
github.com/prometheus/statsd_exporter v0.22.7 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
|
@ -66,9 +66,9 @@ require (
|
|||
golang.org/x/time v0.5.0 // indirect
|
||||
golang.org/x/tools v0.20.0 // indirect
|
||||
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
|
||||
google.golang.org/api v0.172.0 // indirect
|
||||
google.golang.org/api v0.176.1 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240314234333-6e1732d8331c // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240415180920-8c6c420018be // indirect
|
||||
google.golang.org/grpc v1.63.2 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
|
|
20
go.sum
20
go.sum
|
@ -261,8 +261,8 @@ github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9
|
|||
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
|
||||
github.com/prometheus/common v0.35.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
|
||||
github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
|
||||
github.com/prometheus/common v0.52.3 h1:5f8uj6ZwHSscOGNdIQg6OiZv/ybiK2CO2q2drVZAQSA=
|
||||
github.com/prometheus/common v0.52.3/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U=
|
||||
github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE=
|
||||
github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U=
|
||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
|
||||
|
@ -542,8 +542,8 @@ google.golang.org/api v0.25.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M
|
|||
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
|
||||
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
|
||||
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
|
||||
google.golang.org/api v0.172.0 h1:/1OcMZGPmW1rX2LCu2CmGUD1KXK1+pfzxotxyRUCCdk=
|
||||
google.golang.org/api v0.172.0/go.mod h1:+fJZq6QXWfa9pXhnIzsjx4yI22d4aI9ZpLb58gvXjis=
|
||||
google.golang.org/api v0.176.1 h1:DJSXnV6An+NhJ1J+GWtoF2nHEuqB1VNoTfnIbjNvwD4=
|
||||
google.golang.org/api v0.176.1/go.mod h1:j2MaSDYcvYV1lkZ1+SMW4IeF90SrEyFA+tluDYWRrFg=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
|
@ -583,8 +583,8 @@ google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6D
|
|||
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240314234333-6e1732d8331c h1:kaI7oewGK5YnVwj+Y+EJBO/YN1ht8iTL9XkFHtVZLsc=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240314234333-6e1732d8331c/go.mod h1:VQW3tUculP/D4B+xVCo+VgSq8As6wA9ZjHl//pmk+6s=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240415180920-8c6c420018be h1:LG9vZxsWGOmUKieR8wPAUR3u3MpnYFQZROPIMaXh7/A=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240415180920-8c6c420018be/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
|
||||
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=
|
||||
|
@ -661,10 +661,10 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
|
|||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||
k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ=
|
||||
k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
knative.dev/hack v0.0.0-20240404013450-1133b37da8d7 h1:fkWYWvdHm1mVHevKW2vVJnZtxH0NzOlux8imesweKwE=
|
||||
knative.dev/hack v0.0.0-20240404013450-1133b37da8d7/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
|
||||
knative.dev/pkg v0.0.0-20240416145024-0f34a8815650 h1:m2ahFUO0L2VrgGDYdyOUFdE6xBd3pLXAJozLJwqLRQM=
|
||||
knative.dev/pkg v0.0.0-20240416145024-0f34a8815650/go.mod h1:soFw5ss08G4PU3JiFDKqiZRd2U7xoqcfNpJP1coIXkY=
|
||||
knative.dev/hack v0.0.0-20240426013324-abdcdea830f0 h1:GRCZDU7GyuKnpm6L984hnsOBDR2qNBUgQS2bqBnqeq0=
|
||||
knative.dev/hack v0.0.0-20240426013324-abdcdea830f0/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
|
||||
knative.dev/pkg v0.0.0-20240429080158-b69fa2713537 h1:ZCAOdzhvd0XiXFc8FiEMeLhRtm2W3WRIoX4UnYaoRGo=
|
||||
knative.dev/pkg v0.0.0-20240429080158-b69fa2713537/go.mod h1:w+HoJjceYoRP+xvxtOPlXRO/NIVe8Ca/CO3EAKFAbvo=
|
||||
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=
|
||||
|
|
|
@ -75,7 +75,12 @@ func (a *Alert) ResolvedAt(ts time.Time) bool {
|
|||
|
||||
// Status returns the status of the alert.
|
||||
func (a *Alert) Status() AlertStatus {
|
||||
if a.Resolved() {
|
||||
return a.StatusAt(time.Now())
|
||||
}
|
||||
|
||||
// StatusAt returns the status of the alert at the given timestamp.
|
||||
func (a *Alert) StatusAt(ts time.Time) AlertStatus {
|
||||
if a.ResolvedAt(ts) {
|
||||
return AlertResolved
|
||||
}
|
||||
return AlertFiring
|
||||
|
@ -127,6 +132,17 @@ func (as Alerts) HasFiring() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
// HasFiringAt returns true iff one of the alerts is not resolved
|
||||
// at the time ts.
|
||||
func (as Alerts) HasFiringAt(ts time.Time) bool {
|
||||
for _, a := range as {
|
||||
if !a.ResolvedAt(ts) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Status returns StatusFiring iff at least one of the alerts is firing.
|
||||
func (as Alerts) Status() AlertStatus {
|
||||
if as.HasFiring() {
|
||||
|
@ -134,3 +150,12 @@ func (as Alerts) Status() AlertStatus {
|
|||
}
|
||||
return AlertResolved
|
||||
}
|
||||
|
||||
// StatusAt returns StatusFiring iff at least one of the alerts is firing
|
||||
// at the time ts.
|
||||
func (as Alerts) StatusAt(ts time.Time) AlertStatus {
|
||||
if as.HasFiringAt(ts) {
|
||||
return AlertFiring
|
||||
}
|
||||
return AlertResolved
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ package model
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"sort"
|
||||
"slices"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
|
@ -28,7 +28,7 @@ func (l LabelSet) String() string {
|
|||
for name := range l {
|
||||
labelNames = append(labelNames, string(name))
|
||||
}
|
||||
sort.Strings(labelNames)
|
||||
slices.Sort(labelNames)
|
||||
var bytea [1024]byte // On stack to avoid memory allocation while building the output.
|
||||
b := bytes.NewBuffer(bytea[:0])
|
||||
b.WriteByte('{')
|
||||
|
|
|
@ -136,7 +136,7 @@ github.com/prometheus/client_golang/prometheus/promhttp
|
|||
# github.com/prometheus/client_model v0.6.0
|
||||
## explicit; go 1.19
|
||||
github.com/prometheus/client_model/go
|
||||
# github.com/prometheus/common v0.52.3
|
||||
# github.com/prometheus/common v0.53.0
|
||||
## explicit; go 1.20
|
||||
github.com/prometheus/common/expfmt
|
||||
github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg
|
||||
|
@ -241,13 +241,13 @@ golang.org/x/tools/internal/stdlib
|
|||
# gomodules.xyz/jsonpatch/v2 v2.4.0
|
||||
## explicit; go 1.20
|
||||
gomodules.xyz/jsonpatch/v2
|
||||
# google.golang.org/api v0.172.0
|
||||
# google.golang.org/api v0.176.1
|
||||
## explicit; go 1.19
|
||||
google.golang.org/api/support/bundler
|
||||
# google.golang.org/genproto/googleapis/api v0.0.0-20240314234333-6e1732d8331c
|
||||
## explicit; go 1.19
|
||||
google.golang.org/genproto/googleapis/api/httpbody
|
||||
# google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237
|
||||
# google.golang.org/genproto/googleapis/rpc v0.0.0-20240415180920-8c6c420018be
|
||||
## explicit; go 1.19
|
||||
google.golang.org/genproto/googleapis/rpc/status
|
||||
# google.golang.org/grpc v1.63.2
|
||||
|
@ -684,10 +684,10 @@ k8s.io/utils/pointer
|
|||
k8s.io/utils/ptr
|
||||
k8s.io/utils/strings/slices
|
||||
k8s.io/utils/trace
|
||||
# knative.dev/hack v0.0.0-20240404013450-1133b37da8d7
|
||||
# knative.dev/hack v0.0.0-20240426013324-abdcdea830f0
|
||||
## explicit; go 1.18
|
||||
knative.dev/hack
|
||||
# knative.dev/pkg v0.0.0-20240416145024-0f34a8815650
|
||||
# knative.dev/pkg v0.0.0-20240429080158-b69fa2713537
|
||||
## explicit; go 1.21
|
||||
knative.dev/pkg/apis
|
||||
knative.dev/pkg/apis/duck
|
||||
|
|
Loading…
Reference in New Issue