From 5a035cf53b981d791fedde851925cefe8ca2c7aa Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Fri, 13 Oct 2023 20:10:52 +0545 Subject: [PATCH 1/7] feat: Support looking up values into headers and body --- checks/http.go | 101 ++++++--- go.mod | 32 +-- go.sum | 31 +++ hack/generate-schemas/go.mod | 30 +-- hack/generate-schemas/go.sum | 60 ++--- pkg/http/client.go | 420 ----------------------------------- pkg/http/json.go | 20 -- 7 files changed, 166 insertions(+), 528 deletions(-) delete mode 100644 pkg/http/client.go delete mode 100644 pkg/http/json.go diff --git a/checks/http.go b/checks/http.go index 947d9eebb..fa5afc90f 100644 --- a/checks/http.go +++ b/checks/http.go @@ -1,12 +1,16 @@ package checks import ( + "fmt" "net/url" "strconv" "strings" "time" + "github.com/PaesslerAG/jsonpath" "github.com/flanksource/canary-checker/api/context" + "github.com/flanksource/commons/http" + "github.com/flanksource/commons/http/middlewares" "github.com/flanksource/commons/text" "github.com/flanksource/duty/models" "github.com/pkg/errors" @@ -16,7 +20,6 @@ import ( v1 "github.com/flanksource/canary-checker/api/v1" "github.com/flanksource/canary-checker/pkg" - "github.com/flanksource/canary-checker/pkg/http" "github.com/flanksource/canary-checker/pkg/metrics" "github.com/flanksource/canary-checker/pkg/utils" ) @@ -61,28 +64,36 @@ func (c *HTTPChecker) Run(ctx *context.Context) pkg.Results { return results } -func (c *HTTPChecker) configure(req *http.HTTPRequest, ctx *context.Context, check v1.HTTPCheck, connection *models.Connection) error { +func (c *HTTPChecker) generateHTTPRequest(ctx *context.Context, check v1.HTTPCheck, connection *models.Connection) (*http.Request, error) { + client := http.NewClient() + for _, header := range check.Headers { value, err := ctx.GetEnvValueFromCache(header) if err != nil { - return errors.WithMessagef(err, "failed getting header: %v", header) + return nil, errors.WithMessagef(err, "failed getting header: %v", header) } - req.Header(header.Name, value) + + client.Header(header.Name, value) } if connection.Username != "" || connection.Password != "" { - req.Auth(connection.Username, connection.Password) + client.Auth(connection.Username, connection.Password) } - req.NTLM(check.NTLM) - req.NTLMv2(check.NTLMv2) + client.NTLM(check.NTLM) + client.NTLMV2(check.NTLMv2) if check.ThresholdMillis > 0 { - req.Timeout(time.Duration(check.ThresholdMillis) * time.Millisecond) + client.Timeout(time.Duration(check.ThresholdMillis) * time.Millisecond) } - req.Trace(ctx.IsTrace()).Debug(ctx.IsDebug()) - return nil + // TODO: Add finer controls over tracing to the canary + if ctx.IsTrace() { + tracedTransport := middlewares.NewTracedTransport().TraceAll(true).MaxBodyLength(512) + client.Use(tracedTransport.RoundTripper) + } + + return client.R(ctx), nil } func truncate(text string, max int) string { @@ -137,17 +148,27 @@ func (c *HTTPChecker) Check(ctx *context.Context, extConfig external.Check) pkg. } } - req := http.NewRequest(connection.URL).Method(check.GetMethod()) - - if err := c.configure(req, ctx, check, connection); err != nil { + request, err := c.generateHTTPRequest(ctx, check, connection) + if err != nil { return results.ErrorMessage(err) } + if body != "" { + if err := request.Body(body); err != nil { + return results.ErrorMessage(err) + } + } + start := time.Now() - resp := req.Do(body) + response, err := request.Do(check.GetMethod(), connection.URL) + if err != nil { + return results.ErrorMessage(err) + } + elapsed := time.Since(start) - status := resp.GetStatusCode() + status := response.StatusCode + result.AddMetric(pkg.Metric{ Name: "response_code", Type: metrics.CounterType, @@ -156,30 +177,31 @@ func (c *HTTPChecker) Check(ctx *context.Context, extConfig external.Check) pkg. "url": check.URL, }, }) + result.Duration = elapsed.Milliseconds() responseStatus.WithLabelValues(strconv.Itoa(status), statusCodeToClass(status), check.URL).Inc() - age := resp.GetSSLAge() + age := response.GetSSLAge() if age != nil { sslExpiration.WithLabelValues(check.URL).Set(age.Hours() * 24) } - body, _ = resp.AsString() + body, _ = response.AsString() data := map[string]interface{}{ "code": status, - "headers": resp.GetHeaders(), + "headers": response.Header, "elapsed": time.Since(start), "content": body, "sslAge": utils.Deref(age), "json": make(map[string]any), } - if resp.IsJSON() { - json, err := resp.AsJSON() + if response.IsJSON() { + json, err := response.AsJSON() if err == nil { - data["json"] = json.Value + data["json"] = json if check.ResponseJSONContent != nil && check.ResponseJSONContent.Path != "" { - err := resp.CheckJSONContent(json.Value, check.ResponseJSONContent) + err := checkJSONContent(json, check.ResponseJSONContent) if err != nil { return results.ErrorMessage(err) } @@ -193,11 +215,7 @@ func (c *HTTPChecker) Check(ctx *context.Context, extConfig external.Check) pkg. result.AddData(data) - if status == -1 { - return results.Failf("%v", truncate(resp.Error.Error(), 500)) - } - - if ok := resp.IsOK(check.ResponseCodes...); !ok { + if ok := response.IsOK(check.ResponseCodes...); !ok { return results.Failf("response code invalid %d != %v", status, check.ResponseCodes) } @@ -209,7 +227,7 @@ func (c *HTTPChecker) Check(ctx *context.Context, extConfig external.Check) pkg. return results.Failf("expected %v, found %v", check.ResponseContent, truncate(body, 100)) } - if req.URL.Scheme == "https" && check.MaxSSLExpiry > 0 { + if check.MaxSSLExpiry > 0 { if age == nil { return results.Failf("No certificate found to check age") } @@ -217,6 +235,7 @@ func (c *HTTPChecker) Check(ctx *context.Context, extConfig external.Check) pkg. return results.Failf("SSL certificate expires soon %s > %d", utils.Age(*age), check.MaxSSLExpiry) } } + return results } @@ -235,3 +254,29 @@ func statusCodeToClass(statusCode int) string { return "unknown" } } + +func checkJSONContent(jsonContent map[string]any, jsonCheck *v1.JSONCheck) error { + if jsonCheck == nil { + return nil + } + + jsonResult, err := jsonpath.Get(jsonCheck.Path, jsonContent) + if err != nil { + return fmt.Errorf("error getting jsonPath: %w", err) + } + + switch s := jsonResult.(type) { + case string: + if s != jsonCheck.Value { + return fmt.Errorf("%v not equal to %v", s, jsonCheck.Value) + } + case fmt.Stringer: + if s.String() != jsonCheck.Value { + return fmt.Errorf("%v not equal to %v", s.String(), jsonCheck.Value) + } + default: + return fmt.Errorf("json response could not be parsed back to string") + } + + return nil +} diff --git a/go.mod b/go.mod index ea3d2b025..5e71917b9 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/eko/gocache/store/bigcache/v4 v4.2.1 github.com/elastic/go-elasticsearch/v8 v8.10.0 github.com/fergusstrange/embedded-postgres v1.24.0 - github.com/flanksource/commons v1.12.0 + github.com/flanksource/commons v1.14.1 github.com/flanksource/duty v1.0.191 github.com/flanksource/gomplate/v3 v3.20.18 github.com/flanksource/is-healthy v0.0.0-20231003215854-76c51e3a3ff7 @@ -66,10 +66,10 @@ require ( github.com/vadimi/go-http-ntlm/v2 v2.4.1 go.mongodb.org/mongo-driver v1.12.1 golang.org/x/crypto v0.14.0 - golang.org/x/net v0.15.0 + golang.org/x/net v0.17.0 golang.org/x/sync v0.4.0 - google.golang.org/api v0.145.0 - google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 + google.golang.org/api v0.147.0 + google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a gopkg.in/flanksource/yaml.v3 v3.2.3 gorm.io/gorm v1.25.4 gorm.io/plugin/prometheus v0.0.0-20230504115745-1aec2356381b @@ -83,9 +83,9 @@ require ( require ( ariga.io/atlas v0.14.2 // indirect cloud.google.com/go v0.110.8 // indirect - cloud.google.com/go/compute v1.23.0 // indirect + cloud.google.com/go/compute v1.23.1 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.2 // indirect + cloud.google.com/go/iam v1.1.3 // indirect github.com/AlekSi/pointer v1.2.0 // indirect github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect github.com/Masterminds/goutils v1.1.1 // indirect @@ -97,7 +97,7 @@ require ( github.com/antonmedv/expr v1.15.3 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect - github.com/aws/aws-sdk-go v1.45.23 // indirect + github.com/aws/aws-sdk-go v1.45.25 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.13 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 // indirect @@ -154,7 +154,7 @@ require ( github.com/google/btree v1.1.2 // indirect github.com/google/cel-go v0.18.1 // indirect github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/pprof v0.0.0-20230323073829-e72429f035bd // indirect github.com/google/s2a-go v0.1.7 // indirect @@ -167,7 +167,7 @@ require ( github.com/hairyhenderson/toml v0.4.2-0.20210923231440-40456b8e66cf // indirect github.com/hairyhenderson/yaml v0.0.0-20220618171115-2d35fca545ce // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.2 // indirect + github.com/hashicorp/go-getter v1.7.3 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/hcl/v2 v2.18.0 // indirect @@ -239,19 +239,19 @@ require ( go.starlark.net v0.0.0-20230925163745-10651d5192ab // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/exp v0.0.0-20231005195138-3e424a577f31 // indirect - golang.org/x/oauth2 v0.12.0 // indirect + golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect + golang.org/x/oauth2 v0.13.0 // indirect golang.org/x/sys v0.13.0 // indirect golang.org/x/term v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.13.0 // indirect - golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect + golang.org/x/tools v0.14.0 // indirect + golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect - google.golang.org/grpc v1.58.2 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a // indirect + google.golang.org/grpc v1.58.3 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/sourcemap.v1 v1.0.5 // indirect diff --git a/go.sum b/go.sum index d4ff277d9..087973658 100644 --- a/go.sum +++ b/go.sum @@ -177,6 +177,8 @@ cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOV cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute v1.23.1 h1:V97tBoDaZHb6leicZ1G6DLK2BAaZLJ/7+9BB/En3hR0= +cloud.google.com/go/compute v1.23.1/go.mod h1:CqB3xpmPKKt3OJpW2ndFIXnA9A4xAy/F3Xp1ixncW78= cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= @@ -317,6 +319,8 @@ cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= cloud.google.com/go/iam v1.1.2 h1:gacbrBdWcoVmGLozRuStX45YKvJtzIjJdAolzUs1sm4= cloud.google.com/go/iam v1.1.2/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= +cloud.google.com/go/iam v1.1.3 h1:18tKG7DzydKWUnLjonWcJO6wjSCAtzh4GcRKlH/Hrzc= +cloud.google.com/go/iam v1.1.3/go.mod h1:3khUlaBXfPKKe7huYgEpDn6FtgRyMEqbkvBxrQyY5SE= cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= cloud.google.com/go/iap v1.6.0/go.mod h1:NSuvI9C/j7UdjGjIde7t7HBz+QTwBcapPE07+sSRcLk= @@ -676,6 +680,8 @@ github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX github.com/aws/aws-sdk-go v1.44.263/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go v1.45.23 h1:0xRQw5fsFMpisaliDZ8iUZtw9w+3YjY9/UwUGRbB/i4= github.com/aws/aws-sdk-go v1.45.23/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.45.25 h1:c4fLlh5sLdK2DCRTY1z0hyuJZU4ygxX8m1FswL6/nF4= +github.com/aws/aws-sdk-go v1.45.25/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.21.0 h1:gMT0IW+03wtYJhRqTVYn0wLzwdnK9sRMcxmtfGzRdJc= github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M= @@ -821,6 +827,8 @@ github.com/fergusstrange/embedded-postgres v1.24.0 h1:WqXbmYrBeT5JfNWQ8Qa+yHa5YJ github.com/fergusstrange/embedded-postgres v1.24.0/go.mod h1:wL562t1V+iuFwq0UcgMi2e9rp8CROY9wxWZEfP8Y874= github.com/flanksource/commons v1.12.0 h1:8B7+AbRbWH3KVFwbmXYkG3gS42pF+uVaF4lAgDY+ZJA= github.com/flanksource/commons v1.12.0/go.mod h1:zYEhi6E2+diQ+loVcROUHo/Bgv+Tn61W2NYmrb5MgVI= +github.com/flanksource/commons v1.14.1 h1:gvMDVec0V7h1UMQxKe2lanFYIAbs6yMG7TbKEhFmMuE= +github.com/flanksource/commons v1.14.1/go.mod h1:v0BQANvjQ6gSz/3XVYsNxJOeHtxFa5JpZSdY+GjOT0c= github.com/flanksource/duty v1.0.191 h1:acnvyTeQlfqmtyXxWprNFGK/vBTUlqkYwxEPLtXSPrk= github.com/flanksource/duty v1.0.191/go.mod h1:ikyl/TcRy6Cc0R5b0wEHT7CecV7gyJvrDGq/4oIZHoc= github.com/flanksource/gomplate/v3 v3.20.4/go.mod h1:27BNWhzzSjDed1z8YShO6W+z6G9oZXuxfNFGd/iGSdc= @@ -1044,6 +1052,8 @@ github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8 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-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= @@ -1124,6 +1134,8 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-getter v1.7.2 h1:uJDtyXwEfalmp1PqdxuhZqrNkUyClZAhVeZYTArbqkg= github.com/hashicorp/go-getter v1.7.2/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.3 h1:bN2+Fw9XPFvOCjB0UOevFIMICZ7G2XSQHzfvLUyOM5E= +github.com/hashicorp/go-getter v1.7.3/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= @@ -1588,6 +1600,8 @@ golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2F golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= golang.org/x/exp v0.0.0-20231005195138-3e424a577f31 h1:9k5exFQKQglLo+RoP+4zMjOFE14P6+vyR0baDAi0Rcs= golang.org/x/exp v0.0.0-20231005195138-3e424a577f31/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= 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= @@ -1702,6 +1716,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= 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= @@ -1733,6 +1749,8 @@ golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= +golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= +golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= 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= @@ -1974,6 +1992,7 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= 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= @@ -1983,6 +2002,8 @@ golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNq golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= @@ -2052,6 +2073,8 @@ google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0 google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= google.golang.org/api v0.145.0 h1:kBjvf1A3/m30kUvnUX9jZJxTu3lJrpGFt5V/1YZrjwg= google.golang.org/api v0.145.0/go.mod h1:OARJqIfoYjXJj4C1AiBSXYZt03qsoz8FQYU6fBEfrHM= +google.golang.org/api v0.147.0 h1:Can3FaQo9LlVqxJCodNmeZW/ib3/qKAY3rFeXiHo5gc= +google.golang.org/api v0.147.0/go.mod h1:pQ/9j83DcmPd/5C9e2nFOdjjNkDZ1G+zkbK2uvdkJMs= 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= @@ -2197,14 +2220,20 @@ google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOl google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 h1:SeZZZx0cP0fqUyA+oRzP9k7cSwJlvDFiROO72uwD6i0= google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97/go.mod h1:t1VqOqqvce95G3hIDCT5FeO3YUc6Q4Oe24L/+rNMxRk= +google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a h1:fwgW9j3vHirt4ObdHoYNwuO24BEZjSzbh+zPaNWoiY8= +google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:EMfReVxb80Dq1hhioy0sOsY9jCE46YDgHlJ7fWVUWRE= google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU= google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0= +google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a h1:myvhA4is3vrit1a6NZCWBIwN0kNEnX21DJOJX/NvIfI= +google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:SUBoKXbI1Efip18FClrQVGjWcyd0QZd8KkvdP34t7ww= google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234015-3fc162c6f38a/go.mod h1:xURIpW9ES5+/GZhnV6beoEtxQrnkRGIfP5VQG2tCBLc= google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a h1:a2MQQVoTo96JC9PMGtGBymLp7+/RzpFc2yX/9WfFg1c= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= 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= @@ -2246,6 +2275,8 @@ google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwS google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I= google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= +google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= 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= diff --git a/hack/generate-schemas/go.mod b/hack/generate-schemas/go.mod index 38bce9949..d68b81d8f 100644 --- a/hack/generate-schemas/go.mod +++ b/hack/generate-schemas/go.mod @@ -4,17 +4,17 @@ go 1.19 require ( github.com/flanksource/canary-checker v1.0.0 - github.com/flanksource/commons v1.12.0 + github.com/flanksource/commons v1.14.1 github.com/invopop/jsonschema v0.7.0 github.com/spf13/cobra v1.7.0 ) require ( - cloud.google.com/go/compute v1.23.0 // indirect - cloud.google.com/go/iam v1.1.2 // indirect + cloud.google.com/go/compute v1.23.1 // indirect + cloud.google.com/go/iam v1.1.3 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/flanksource/gomplate/v3 v3.20.16 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.1 // indirect github.com/gosimple/unidecode v1.0.1 // indirect github.com/hairyhenderson/yaml v0.0.0-20220618171115-2d35fca545ce // indirect @@ -36,7 +36,7 @@ require ( github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect github.com/antonmedv/expr v1.15.3 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect - github.com/aws/aws-sdk-go v1.45.23 // indirect + github.com/aws/aws-sdk-go v1.45.25 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -63,7 +63,7 @@ require ( github.com/gosimple/slug v1.13.1 // indirect github.com/hairyhenderson/toml v0.4.2-0.20210923231440-40456b8e66cf // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.2 // indirect + github.com/hashicorp/go-getter v1.7.3 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/hcl/v2 v2.18.0 // indirect @@ -107,21 +107,21 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/crypto v0.14.0 // indirect - golang.org/x/exp v0.0.0-20231005195138-3e424a577f31 // indirect - golang.org/x/net v0.15.0 // indirect - golang.org/x/oauth2 v0.12.0 // indirect + golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/oauth2 v0.13.0 // indirect golang.org/x/sync v0.4.0 // indirect golang.org/x/sys v0.13.0 // indirect golang.org/x/term v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.145.0 // indirect + golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect + google.golang.org/api v0.147.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect - google.golang.org/grpc v1.58.2 // indirect + google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a // indirect + google.golang.org/grpc v1.58.3 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/flanksource/yaml.v3 v3.2.3 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/hack/generate-schemas/go.sum b/hack/generate-schemas/go.sum index 789121f44..397a674a2 100644 --- a/hack/generate-schemas/go.sum +++ b/hack/generate-schemas/go.sum @@ -175,8 +175,8 @@ cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvj cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= -cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= -cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute v1.23.1 h1:V97tBoDaZHb6leicZ1G6DLK2BAaZLJ/7+9BB/En3hR0= +cloud.google.com/go/compute v1.23.1/go.mod h1:CqB3xpmPKKt3OJpW2ndFIXnA9A4xAy/F3Xp1ixncW78= cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= @@ -315,8 +315,8 @@ cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGE cloud.google.com/go/iam v0.11.0/go.mod h1:9PiLDanza5D+oWFZiH1uG+RnRCfEGKoyl6yo4cgWZGY= cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= -cloud.google.com/go/iam v1.1.2 h1:gacbrBdWcoVmGLozRuStX45YKvJtzIjJdAolzUs1sm4= -cloud.google.com/go/iam v1.1.2/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= +cloud.google.com/go/iam v1.1.3 h1:18tKG7DzydKWUnLjonWcJO6wjSCAtzh4GcRKlH/Hrzc= +cloud.google.com/go/iam v1.1.3/go.mod h1:3khUlaBXfPKKe7huYgEpDn6FtgRyMEqbkvBxrQyY5SE= cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= cloud.google.com/go/iap v1.6.0/go.mod h1:NSuvI9C/j7UdjGjIde7t7HBz+QTwBcapPE07+sSRcLk= @@ -637,8 +637,8 @@ github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmms github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go v1.45.23 h1:0xRQw5fsFMpisaliDZ8iUZtw9w+3YjY9/UwUGRbB/i4= -github.com/aws/aws-sdk-go v1.45.23/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.45.25 h1:c4fLlh5sLdK2DCRTY1z0hyuJZU4ygxX8m1FswL6/nF4= +github.com/aws/aws-sdk-go v1.45.25/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= @@ -701,8 +701,8 @@ github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQL github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fergusstrange/embedded-postgres v1.24.0 h1:WqXbmYrBeT5JfNWQ8Qa+yHa5YJO/0sBIgL9k5rn3dFk= -github.com/flanksource/commons v1.12.0 h1:8B7+AbRbWH3KVFwbmXYkG3gS42pF+uVaF4lAgDY+ZJA= -github.com/flanksource/commons v1.12.0/go.mod h1:zYEhi6E2+diQ+loVcROUHo/Bgv+Tn61W2NYmrb5MgVI= +github.com/flanksource/commons v1.14.1 h1:gvMDVec0V7h1UMQxKe2lanFYIAbs6yMG7TbKEhFmMuE= +github.com/flanksource/commons v1.14.1/go.mod h1:v0BQANvjQ6gSz/3XVYsNxJOeHtxFa5JpZSdY+GjOT0c= github.com/flanksource/duty v1.0.191 h1:acnvyTeQlfqmtyXxWprNFGK/vBTUlqkYwxEPLtXSPrk= github.com/flanksource/duty v1.0.191/go.mod h1:ikyl/TcRy6Cc0R5b0wEHT7CecV7gyJvrDGq/4oIZHoc= github.com/flanksource/gomplate/v3 v3.20.4/go.mod h1:27BNWhzzSjDed1z8YShO6W+z6G9oZXuxfNFGd/iGSdc= @@ -821,8 +821,9 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/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-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= @@ -895,8 +896,8 @@ github.com/hairyhenderson/yaml v0.0.0-20220618171115-2d35fca545ce h1:cVkYhlWAxwu github.com/hairyhenderson/yaml v0.0.0-20220618171115-2d35fca545ce/go.mod h1:7TyiGlHI+IO+iJbqRZ82QbFtvgj/AIcFm5qc9DLn7Kc= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.2 h1:uJDtyXwEfalmp1PqdxuhZqrNkUyClZAhVeZYTArbqkg= -github.com/hashicorp/go-getter v1.7.2/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.3 h1:bN2+Fw9XPFvOCjB0UOevFIMICZ7G2XSQHzfvLUyOM5E= +github.com/hashicorp/go-getter v1.7.3/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= @@ -1164,8 +1165,8 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA= golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= -golang.org/x/exp v0.0.0-20231005195138-3e424a577f31 h1:9k5exFQKQglLo+RoP+4zMjOFE14P6+vyR0baDAi0Rcs= -golang.org/x/exp v0.0.0-20231005195138-3e424a577f31/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= 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= @@ -1272,8 +1273,8 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= -golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= 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= @@ -1303,8 +1304,8 @@ golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= -golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= -golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= +golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= +golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= 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= @@ -1517,7 +1518,7 @@ golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= 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= @@ -1525,8 +1526,9 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= @@ -1592,8 +1594,8 @@ google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/ google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0fdw0= google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= -google.golang.org/api v0.145.0 h1:kBjvf1A3/m30kUvnUX9jZJxTu3lJrpGFt5V/1YZrjwg= -google.golang.org/api v0.145.0/go.mod h1:OARJqIfoYjXJj4C1AiBSXYZt03qsoz8FQYU6fBEfrHM= +google.golang.org/api v0.147.0 h1:Can3FaQo9LlVqxJCodNmeZW/ib3/qKAY3rFeXiHo5gc= +google.golang.org/api v0.147.0/go.mod h1:pQ/9j83DcmPd/5C9e2nFOdjjNkDZ1G+zkbK2uvdkJMs= 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= @@ -1737,16 +1739,16 @@ google.golang.org/genproto v0.0.0-20230323212658-478b75c54725/go.mod h1:UUQDJDOl google.golang.org/genproto v0.0.0-20230330154414-c0448cd141ea/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 h1:SeZZZx0cP0fqUyA+oRzP9k7cSwJlvDFiROO72uwD6i0= -google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97/go.mod h1:t1VqOqqvce95G3hIDCT5FeO3YUc6Q4Oe24L/+rNMxRk= +google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a h1:fwgW9j3vHirt4ObdHoYNwuO24BEZjSzbh+zPaNWoiY8= +google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:EMfReVxb80Dq1hhioy0sOsY9jCE46YDgHlJ7fWVUWRE= google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU= -google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0= +google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a h1:myvhA4is3vrit1a6NZCWBIwN0kNEnX21DJOJX/NvIfI= +google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:SUBoKXbI1Efip18FClrQVGjWcyd0QZd8KkvdP34t7ww= google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234015-3fc162c6f38a/go.mod h1:xURIpW9ES5+/GZhnV6beoEtxQrnkRGIfP5VQG2tCBLc= google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a h1:a2MQQVoTo96JC9PMGtGBymLp7+/RzpFc2yX/9WfFg1c= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= 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= @@ -1786,8 +1788,8 @@ google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCD google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= -google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I= -google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= +google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= 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= diff --git a/pkg/http/client.go b/pkg/http/client.go deleted file mode 100644 index d3fdd127d..000000000 --- a/pkg/http/client.go +++ /dev/null @@ -1,420 +0,0 @@ -package http - -import ( - "context" - "crypto/tls" - "encoding/json" - "fmt" - "io" - "net" - "net/http" - "net/url" - "strings" - "time" - - "github.com/PaesslerAG/jsonpath" - v1 "github.com/flanksource/canary-checker/api/v1" - "github.com/flanksource/canary-checker/pkg/dns" - "github.com/flanksource/canary-checker/pkg/utils" - "github.com/flanksource/commons/logger" - "github.com/henvic/httpretty" - httpntlm "github.com/vadimi/go-http-ntlm" - httpntlmv2 "github.com/vadimi/go-http-ntlm/v2" -) - -type HTTPRequest struct { - Username string - Password string - method string - connectTo string - Port int - URL *url.URL - timeout time.Duration - headers map[string]string - insecure bool - ntlm bool - ntlmv2 bool - dnsCache bool - tr *http.Transport //nolint:structcheck,unused - traceHeaders, traceBody bool -} - -func NewRequest(endpoint string) *HTTPRequest { - url, _ := url.Parse(endpoint) - return &HTTPRequest{ - URL: url, - dnsCache: true, - headers: make(map[string]string), - } -} - -func (h *HTTPRequest) Timeout(timeout time.Duration) *HTTPRequest { - h.timeout = timeout - return h -} - -func (h *HTTPRequest) Method(method string) *HTTPRequest { - h.method = method - return h -} - -func (h *HTTPRequest) UseHost(host string) *HTTPRequest { - h.connectTo = host - return h -} - -func (h *HTTPRequest) Debug(debug bool) *HTTPRequest { - h.traceHeaders = debug - return h -} - -func (h *HTTPRequest) DNSCache(cache bool) *HTTPRequest { - h.dnsCache = cache - return h -} - -func (h *HTTPRequest) Trace(trace bool) *HTTPRequest { - h.Debug(trace) - h.traceBody = trace - return h -} - -func (h *HTTPRequest) ConnectTo(host string) *HTTPRequest { - h.connectTo = host - return h -} - -func (h *HTTPRequest) Header(header, value string) *HTTPRequest { - h.headers[header] = value - return h -} - -func (h *HTTPRequest) Auth(username, password string) *HTTPRequest { - h.Username = username - h.Password = password - return h -} - -func (h *HTTPRequest) NTLM(ntlm bool) *HTTPRequest { - h.ntlm = ntlm - return h -} - -func (h *HTTPRequest) NTLMv2(ntlm bool) *HTTPRequest { - h.ntlmv2 = ntlm - return h -} - -func (h *HTTPRequest) Insecure(skip bool) *HTTPRequest { - h.insecure = skip - return h -} - -func (h *HTTPRequest) Headers(headers map[string]string) *HTTPRequest { - h.headers = headers - return h -} - -func (h *HTTPRequest) getHTTPClient() *http.Client { - var transport http.RoundTripper - transport = &http.Transport{ - DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) { - if h.connectTo == "" { - return (&net.Dialer{}).DialContext(ctx, network, addr) - } - // implment --connect-to logic to connect to a specific IP irrespective of URL host - port := h.URL.Port() - if port == "" && h.URL.Scheme == "http" { - port = "80" - } else if port == "" && h.URL.Scheme == "https" { - port = "443" - } - return (&net.Dialer{}).DialContext(ctx, "tcp", h.connectTo+":"+port) - }, - DisableKeepAlives: true, - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - ServerName: h.connectTo, - }, - } - if h.ntlm || h.ntlmv2 { - parts := strings.Split(h.Username, "@") - domain := "" - if len(parts) > 1 { - domain = parts[1] - } - - if h.ntlmv2 { - transport = &httpntlmv2.NtlmTransport{ - Domain: domain, - User: parts[0], - Password: h.Password, - RoundTripper: transport, - } - } else { - transport = &httpntlm.NtlmTransport{ - Domain: domain, - User: parts[0], - Password: h.Password, - } - } - } - - if h.traceBody || h.traceHeaders { - logger := &httpretty.Logger{ - Time: true, - TLS: true, - RequestHeader: true, - RequestBody: h.traceBody, - ResponseHeader: true, - ResponseBody: h.traceBody, - Colors: true, // erase line if you don't like colors - Formatters: []httpretty.Formatter{&httpretty.JSONFormatter{}}, - } - transport = logger.RoundTripper(transport) - } - - return &http.Client{ - Timeout: h.timeout, - Transport: transport, - CheckRedirect: func(req *http.Request, via []*http.Request) error { - return http.ErrUseLastResponse - }, - } -} - -func (h *HTTPRequest) GetRequestLine() string { - s := fmt.Sprintf("%s %s", h.method, h.URL) - if h.connectTo != h.URL.Hostname() { - s += fmt.Sprintf(" (%s)", h.connectTo) - } - return s -} - -func (h *HTTPRequest) GetString() string { - s := h.GetRequestLine() - if h.traceHeaders { - s += "\n" - for k, values := range h.headers { - s += k + ": " + values + "\n" - } - } - return s -} - -func (h *HTTPResponse) IsOK(responseCodes ...int) bool { - code := h.GetStatusCode() - if h.Error != nil { - return false - } - if len(responseCodes) == 0 { - return code >= 200 && code < 299 - } - for _, valid := range responseCodes { - if code == valid { - return true - } - } - return false -} - -func (h *HTTPRequest) Do(body string) *HTTPResponse { - if h.connectTo == "" { - h.connectTo = h.URL.Hostname() - } else if h.connectTo != h.URL.Hostname() { - // If specified, replace the hostname in the URL, with the actual host/IP connect to - // and move the Virtual Hostname to a Header - h.URL.Host = h.connectTo - } - if h.headers["Host"] != "" { - h.connectTo = h.URL.Hostname() - port := h.URL.Port() - h.URL.Host = h.headers["Host"] - if port != "" { - h.URL.Host += ":" + port - } - delete(h.headers, "Host") - } - - if h.connectTo == "" && h.dnsCache { - ips, err := dns.CacheLookup("A", h.URL.Hostname()) - if len(ips) == 0 { - return &HTTPResponse{Error: err} - } - h.connectTo = ips[0].String() - } - - req, err := http.NewRequest(h.method, h.URL.String(), strings.NewReader(body)) - if err != nil { - return nil - } - - if logger.IsTraceEnabled() { - logger.Tracef(h.GetString()) - } - - for header, field := range h.headers { - req.Header.Add(header, field) - } - if h.Username != "" && h.Password != "" { - req.SetBasicAuth(h.Username, h.Password) - } - client := h.getHTTPClient() - start := time.Now() - resp, err := client.Do(req) //nolint - r := NewHTTPResponse(h, resp, start).SetError(err) - - if logger.IsTraceEnabled() { - logger.Tracef(r.String()) - } - return r -} - -func NewHTTPResponse(req *HTTPRequest, resp *http.Response, start time.Time) *HTTPResponse { - headers := make(map[string]string) - if resp != nil { - for header, values := range resp.Header { - headers[header] = strings.Join(values, " ") - } - } - return &HTTPResponse{ - Request: req, - Headers: headers, - Response: resp, - Elapsed: time.Since(start), - } -} - -type HTTPResponse struct { - Request *HTTPRequest - Headers map[string]string - Response *http.Response - Elapsed time.Duration - Error error - body string -} - -// GetStatusCode returns the HTTP Status Code or -1 if there was a network error -func (h *HTTPResponse) GetStatusCode() int { - if h.Response == nil { - return -1 - } - return h.Response.StatusCode -} - -func getMapFromHeader(header http.Header) map[string]string { - m := make(map[string]string) - for k, v := range header { - m[k] = strings.Join(v, " ") - } - return m -} - -func (h *HTTPResponse) GetHeaders() map[string]string { - if h.Response == nil { - return make(map[string]string) - } - return getMapFromHeader(h.Response.Header) -} - -func (h *HTTPResponse) SetError(err error) *HTTPResponse { - h.Error = err - return h -} - -func (h *HTTPResponse) Start(start time.Time) *HTTPResponse { - h.Elapsed = time.Since(start) - return h -} - -func (h *HTTPResponse) String() string { - s := fmt.Sprintf("%s [%s] %d", h.Request.GetRequestLine(), utils.Age(h.Elapsed), h.GetStatusCode()) - if h.Request.traceHeaders { - s += "\n" - for k, values := range h.GetHeaders() { - s += k + ": " + values + "\n" - } - } - if h.Request.traceBody { - body, _ := h.AsString() - s += "\n" + body - } - return s -} - -func (h *HTTPResponse) GetSSLAge() *time.Duration { - if h.Response == nil { - return nil - } - if h.Response.TLS == nil { - return nil - } - certificates := h.Response.TLS.PeerCertificates - if len(certificates) == 0 { - return nil - } - - age := time.Until(certificates[0].NotAfter) - return &age -} - -func (h *HTTPResponse) IsJSON() bool { - return strings.HasPrefix(h.Headers["Content-Type"], "application/json") -} - -func (h *HTTPResponse) AsJSON() (*JSON, error) { - if h.Response == nil { - return nil, fmt.Errorf("request did not complete with a body") - } - - var jsonContent interface{} - s, err := h.AsString() - if err != nil { - return nil, err - } - if err := json.Unmarshal([]byte(s), &jsonContent); err != nil { - return nil, err - } - return &JSON{Value: jsonContent}, nil -} - -func (h *HTTPResponse) AsString() (string, error) { - if h.Response == nil { - return "", fmt.Errorf("request did not complete with a body") - } - if h.body != "" { - return h.body, nil - } - res, err := io.ReadAll(h.Response.Body) - defer h.Response.Body.Close() //nolint - if err != nil { - return "", err - } - h.body = string(res) - return h.body, nil -} - -func (h *HTTPResponse) CheckJSONContent(jsonContent interface{}, jsonCheck *v1.JSONCheck) error { - if jsonCheck == nil { - return nil - } - - jsonResult, err := jsonpath.Get(jsonCheck.Path, jsonContent) - if err != nil { - logger.Errorf("Error checking JSON content: %s", err) - return err - } - switch s := jsonResult.(type) { - case string: - if s != jsonCheck.Value { - return fmt.Errorf("%v not equal to %v", s, jsonCheck.Value) - } - case fmt.Stringer: - if s.String() != jsonCheck.Value { - return fmt.Errorf("%v not equal to %v", s.String(), jsonCheck.Value) - } - default: - return fmt.Errorf("json response could not be parsed back to string") - } - return nil -} diff --git a/pkg/http/json.go b/pkg/http/json.go deleted file mode 100644 index 9bf83469f..000000000 --- a/pkg/http/json.go +++ /dev/null @@ -1,20 +0,0 @@ -package http - -import ( - "fmt" - - "github.com/PaesslerAG/jsonpath" - "github.com/pkg/errors" -) - -type JSON struct { - Value interface{} -} - -func (j JSON) JSONPath(path string) (string, error) { - jsonResult, err := jsonpath.Get(path, j.Value) - if err != nil { - return "", errors.Wrapf(err, "could not extract %v", path) - } - return fmt.Sprintf("%s", jsonResult), nil -} From bde263dfebb8273b8e9a85064429f1dd7e4d2cb6 Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Mon, 16 Oct 2023 10:47:11 +0545 Subject: [PATCH 2/7] feat: add env var to body templates --- api/v1/checks.go | 2 ++ api/v1/zz_generated.deepcopy.go | 7 ++++++ checks/http.go | 18 +++++++++++---- config/deploy/crd.yaml | 31 ++++++++++++++++++++++++++ config/schemas/canary.schema.json | 6 +++++ config/schemas/component.schema.json | 6 +++++ config/schemas/health_http.schema.json | 6 +++++ config/schemas/topology.schema.json | 6 +++++ fixtures/minimal/http_template.yaml | 22 ++++++++++++++++++ 9 files changed, 100 insertions(+), 4 deletions(-) create mode 100644 fixtures/minimal/http_template.yaml diff --git a/api/v1/checks.go b/api/v1/checks.go index 25f760f7c..4a752e351 100644 --- a/api/v1/checks.go +++ b/api/v1/checks.go @@ -85,6 +85,8 @@ type HTTPCheck struct { Headers []types.EnvVar `yaml:"headers,omitempty" json:"headers,omitempty"` //Template the request body TemplateBody bool `yaml:"templateBody,omitempty" json:"templateBody,omitempty"` + // EnvVars are the environment variables that are accesible to templated body + EnvVars []types.EnvVar `yaml:"envVar,omitempty" json:"envVar,omitempty"` } func (c HTTPCheck) GetType() string { diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index c7bd714ff..7462b1671 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -1903,6 +1903,13 @@ func (in *HTTPCheck) DeepCopyInto(out *HTTPCheck) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.EnvVars != nil { + in, out := &in.EnvVars, &out.EnvVars + *out = make([]types.EnvVar, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPCheck. diff --git a/checks/http.go b/checks/http.go index fa5afc90f..ed9c1cc9b 100644 --- a/checks/http.go +++ b/checks/http.go @@ -11,9 +11,8 @@ import ( "github.com/flanksource/canary-checker/api/context" "github.com/flanksource/commons/http" "github.com/flanksource/commons/http/middlewares" - "github.com/flanksource/commons/text" "github.com/flanksource/duty/models" - "github.com/pkg/errors" + gomplate "github.com/flanksource/gomplate/v3" "github.com/flanksource/canary-checker/api/external" "github.com/prometheus/client_golang/prometheus" @@ -70,7 +69,7 @@ func (c *HTTPChecker) generateHTTPRequest(ctx *context.Context, check v1.HTTPChe for _, header := range check.Headers { value, err := ctx.GetEnvValueFromCache(header) if err != nil { - return nil, errors.WithMessagef(err, "failed getting header: %v", header) + return nil, fmt.Errorf("failed getting header (%v): %w", header, err) } client.Header(header.Name, value) @@ -140,9 +139,20 @@ func (c *HTTPChecker) Check(ctx *context.Context, extConfig external.Check) pkg. return results.Failf("failed to parse url: %v", err) } + templateEnv := map[string]any{ + "canary": ctx.Canary, + } + for _, env := range check.EnvVars { + if val, err := ctx.GetEnvValueFromCache(env); err != nil { + return results.Failf("failed to get env value: %v", err) + } else { + templateEnv[env.Name] = val + } + } + body := check.Body if check.TemplateBody { - body, err = text.Template(body, ctx.Canary) + body, err = gomplate.RunTemplate(templateEnv, gomplate.Template{Template: body}) if err != nil { return results.ErrorMessage(err) } diff --git a/config/deploy/crd.yaml b/config/deploy/crd.yaml index 332f432b6..6c7090049 100644 --- a/config/deploy/crd.yaml +++ b/config/deploy/crd.yaml @@ -3048,6 +3048,37 @@ spec: endpoint: description: 'Deprecated: Use url instead' type: string + envVar: + description: EnvVars are the environment variables that are accesible to templated body & headers + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + type: array headers: description: Header fields to be used in the query items: diff --git a/config/schemas/canary.schema.json b/config/schemas/canary.schema.json index 60d1fe306..c0d65ce0d 100644 --- a/config/schemas/canary.schema.json +++ b/config/schemas/canary.schema.json @@ -1697,6 +1697,12 @@ }, "templateBody": { "type": "boolean" + }, + "envVar": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" } }, "additionalProperties": false, diff --git a/config/schemas/component.schema.json b/config/schemas/component.schema.json index 6cbf37fe7..4b2e2c889 100644 --- a/config/schemas/component.schema.json +++ b/config/schemas/component.schema.json @@ -1909,6 +1909,12 @@ }, "templateBody": { "type": "boolean" + }, + "envVar": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" } }, "additionalProperties": false, diff --git a/config/schemas/health_http.schema.json b/config/schemas/health_http.schema.json index 10aec39b1..6273de20e 100644 --- a/config/schemas/health_http.schema.json +++ b/config/schemas/health_http.schema.json @@ -133,6 +133,12 @@ }, "templateBody": { "type": "boolean" + }, + "envVar": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" } }, "additionalProperties": false, diff --git a/config/schemas/topology.schema.json b/config/schemas/topology.schema.json index db9746e6b..615116b7f 100644 --- a/config/schemas/topology.schema.json +++ b/config/schemas/topology.schema.json @@ -1879,6 +1879,12 @@ }, "templateBody": { "type": "boolean" + }, + "envVar": { + "items": { + "$ref": "#/$defs/EnvVar" + }, + "type": "array" } }, "additionalProperties": false, diff --git a/fixtures/minimal/http_template.yaml b/fixtures/minimal/http_template.yaml new file mode 100644 index 000000000..08b92eef0 --- /dev/null +++ b/fixtures/minimal/http_template.yaml @@ -0,0 +1,22 @@ +apiVersion: canaries.flanksource.com/v1 +kind: Canary +metadata: + name: templated-http +spec: + interval: 30 + http: + - name: templated-http + endpoint: https://webhook.site/#!/9f1392a6-718a-4ef5-a8e2-bfb55b08afca/f93d307b-0aaf-4a38-b9b3-db5daaae5657/1 + responseCodes: [200] + templateBody: true + envVar: + - name: db + valueFrom: + secretKeyRef: + name: db-user-pass + key: username + body: | + { + "canary": "{{.canary.name}}", + "secret": "{{.db}}" + } From 2725242b5c3527dad0bc416e74eab07945c0e676 Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Mon, 16 Oct 2023 14:09:11 +0545 Subject: [PATCH 3/7] chore: address review comment --- api/v1/checks.go | 2 +- config/deploy/base.yaml | 262 +- config/deploy/crd.yaml | 4 +- config/deploy/manifests.yaml | 6341 +----------------------- config/schemas/canary.schema.json | 2 +- config/schemas/component.schema.json | 2 +- config/schemas/health_http.schema.json | 2 +- config/schemas/topology.schema.json | 2 +- 8 files changed, 9 insertions(+), 6608 deletions(-) diff --git a/api/v1/checks.go b/api/v1/checks.go index 4a752e351..f88185f4a 100644 --- a/api/v1/checks.go +++ b/api/v1/checks.go @@ -86,7 +86,7 @@ type HTTPCheck struct { //Template the request body TemplateBody bool `yaml:"templateBody,omitempty" json:"templateBody,omitempty"` // EnvVars are the environment variables that are accesible to templated body - EnvVars []types.EnvVar `yaml:"envVar,omitempty" json:"envVar,omitempty"` + EnvVars []types.EnvVar `yaml:"env,omitempty" json:"env,omitempty"` } func (c HTTPCheck) GetType() string { diff --git a/config/deploy/base.yaml b/config/deploy/base.yaml index a312a06c4..0967ef424 100644 --- a/config/deploy/base.yaml +++ b/config/deploy/base.yaml @@ -1,261 +1 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - control-plane: canary-checker - name: canary-checker - namespace: canary-checker -spec: - ports: - - port: 8080 - protocol: TCP - targetPort: 8080 - selector: - control-plane: canary-checker ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - control-plane: canary-checker - name: canary-checker - namespace: canary-checker -spec: - replicas: 1 - selector: - matchLabels: - control-plane: canary-checker - template: - metadata: - labels: - control-plane: canary-checker - spec: - containers: - - args: - - operator - - -v - - --httpPort - - "8080" - command: - - /app/canary-checker - env: - - name: DOCKER_API_VERSION - value: "1.39" - image: docker.io/flanksource/canary-checker:latest - livenessProbe: - httpGet: - path: /health - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 5 - name: canary-checker - readinessProbe: - httpGet: - path: /health - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 5 - resources: - limits: - memory: 512Mi - requests: - cpu: 200m - memory: 200Mi - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: - - CAP_NET_RAW - privileged: true - runAsUser: 0 - volumeMounts: - - mountPath: /var/run/docker.sock - name: dockersock - - mountPath: /etc/podinfo - name: podinfo - serviceAccountName: canary-checker-sa - terminationGracePeriodSeconds: 10 - volumes: - - hostPath: - path: /var/run/docker.sock - name: dockersock - - downwardAPI: - items: - - fieldRef: - fieldPath: metadata.labels - path: labels - name: podinfo ---- -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - annotations: - kubernetes.io/tls-acme: "true" - name: canary-checker - namespace: canary-checker -spec: - rules: - - host: canary-checker - http: - paths: - - backend: - service: - name: canary-checker - port: - number: 8080 - path: / - pathType: ImplementationSpecific - tls: - - hosts: - - canary-checker - secretName: canary-tls ---- -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - labels: - control-plane: canary-checker - name: canary-checker-monitor - namespace: canary-checker -spec: - endpoints: - - interval: 30s - port: metrics - jobLabel: canary-checker - selector: - matchLabels: - control-plane: canary-checker ---- -apiVersion: scheduling.k8s.io/v1 -description: This priority class should be used for canary pods only. -globalDefault: false -kind: PriorityClass -metadata: - name: canary-checker-priority -value: -1 ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - creationTimestamp: null - name: canary-checker-role -rules: - - apiGroups: - - canaries.flanksource.com - resources: - - canaries - - topologies - verbs: - - create - - delete - - get - - list - - patch - - update - - watch - - apiGroups: - - canaries.flanksource.com - resources: - - canaries/status - - topologies/status - verbs: - - get - - patch - - update - - apiGroups: - - "" - resources: - - pods - - namespaces - - services - verbs: - - '*' - - apiGroups: - - metrics.k8s.io - resources: - - pods - - nodes - verbs: - - '*' - - apiGroups: - - "" - resources: - - pods/exec - - pods/log - verbs: - - '*' - - apiGroups: - - "" - resources: - - nodes - verbs: - - get - - list - - apiGroups: - - extensions - resources: - - ingresses - verbs: - - '*' - - apiGroups: - - networking.k8s.io - resources: - - ingresses - verbs: - - '*' - - apiGroups: - - "" - resources: - - secrets - - configmaps - verbs: - - get - - list - - apiGroups: - - "" - resources: - - events - verbs: - - create - - patch - - apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch - - create - - update - - patch - - delete - - apiGroups: - - "" - resources: - - configmaps/status - verbs: - - get - - update - - patch ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: canary-checker-rolebinding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: canary-checker-role -subjects: - - kind: ServiceAccount - name: canary-checker-sa - namespace: canary-checker ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - control-plane: canary-checker - name: canary-checker-sa - namespace: canary-checker +{} diff --git a/config/deploy/crd.yaml b/config/deploy/crd.yaml index 6c7090049..72bb72893 100644 --- a/config/deploy/crd.yaml +++ b/config/deploy/crd.yaml @@ -3048,8 +3048,8 @@ spec: endpoint: description: 'Deprecated: Use url instead' type: string - envVar: - description: EnvVars are the environment variables that are accesible to templated body & headers + env: + description: EnvVars are the environment variables that are accesible to templated body items: properties: name: diff --git a/config/deploy/manifests.yaml b/config/deploy/manifests.yaml index 2495c7c27..0967ef424 100644 --- a/config/deploy/manifests.yaml +++ b/config/deploy/manifests.yaml @@ -1,6340 +1 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.11.1 - creationTimestamp: null - name: canaries.canaries.flanksource.com -spec: - group: canaries.flanksource.com - names: - kind: Canary - listKind: CanaryList - plural: canaries - singular: canary - scope: Namespaced - versions: - - additionalPrinterColumns: - - jsonPath: .spec.interval - name: Interval - type: string - - jsonPath: .status.status - name: Status - type: string - - jsonPath: .status.lastCheck - name: Last Check - type: date - - jsonPath: .status.uptime1h - name: Uptime 1H - type: string - - jsonPath: .status.latency1h - name: Latency 1H - type: string - - jsonPath: .status.lastTransitionedTime - name: Last Transitioned - type: date - - jsonPath: .status.message - name: Message - priority: 1 - type: string - - jsonPath: .status.errorMessage - name: Error - priority: 1 - type: string - name: v1 - schema: - openAPIV3Schema: - description: Canary is the Schema for the canaries API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: CanarySpec defines the desired state of Canary - properties: - alertmanager: - items: - properties: - alerts: - items: - type: string - type: array - connection: - description: Connection name e.g. connection://http/google - type: string - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - exclude_filters: - additionalProperties: - type: string - type: object - filters: - additionalProperties: - type: string - type: object - icon: - description: Icon for overwriting default icon on the dashboard - type: string - ignore: - items: - type: string - type: array - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - password: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - url: - description: Connection url, interpolated with username,password - type: string - username: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - required: - - name - type: object - type: array - awsConfig: - items: - properties: - accessKey: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - aggregatorName: - type: string - connection: - description: ConnectionName of the connection. It'll be used to populate the endpoint, accessKey and secretKey. - type: string - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - endpoint: - type: string - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - objectPath: - description: glob path to restrict matches to a subset - type: string - query: - type: string - region: - type: string - secretKey: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - sessionToken: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - skipTLSVerify: - description: Skip TLS verify when connecting to aws - type: boolean - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - usePathStyle: - description: 'Use path style path: http://s3.amazonaws.com/BUCKET/KEY instead of http://BUCKET.s3.amazonaws.com/KEY' - type: boolean - required: - - name - - query - type: object - type: array - awsConfigRule: - items: - properties: - accessKey: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - complianceTypes: - description: Filters the results by compliance. The allowed values are INSUFFICIENT_DATA, NON_COMPLIANT, NOT_APPLICABLE, COMPLIANT - items: - type: string - type: array - connection: - description: ConnectionName of the connection. It'll be used to populate the endpoint, accessKey and secretKey. - type: string - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - endpoint: - type: string - icon: - description: Icon for overwriting default icon on the dashboard - type: string - ignoreRules: - description: List of rules which would be omitted from the fetch result - items: - type: string - type: array - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - objectPath: - description: glob path to restrict matches to a subset - type: string - region: - type: string - rules: - description: Specify one or more Config rule names to filter the results by rule. - items: - type: string - type: array - secretKey: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - sessionToken: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - skipTLSVerify: - description: Skip TLS verify when connecting to aws - type: boolean - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - usePathStyle: - description: 'Use path style path: http://s3.amazonaws.com/BUCKET/KEY instead of http://BUCKET.s3.amazonaws.com/KEY' - type: boolean - required: - - name - type: object - type: array - azureDevops: - items: - properties: - branch: - items: - type: string - type: array - connection: - type: string - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - organization: - type: string - personalAccessToken: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - pipeline: - type: string - project: - type: string - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - thresholdMillis: - description: ThresholdMillis the maximum duration of a Run. (Optional) - type: integer - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - variables: - additionalProperties: - type: string - type: object - required: - - branch - - name - - organization - - personalAccessToken - - pipeline - - project - - thresholdMillis - - variables - type: object - type: array - cloudwatch: - items: - properties: - accessKey: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - actionPrefix: - type: string - alarmPrefix: - type: string - alarms: - items: - type: string - type: array - connection: - description: ConnectionName of the connection. It'll be used to populate the endpoint, accessKey and secretKey. - type: string - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - endpoint: - type: string - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - objectPath: - description: glob path to restrict matches to a subset - type: string - region: - type: string - secretKey: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - sessionToken: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - skipTLSVerify: - description: Skip TLS verify when connecting to aws - type: boolean - state: - type: string - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - usePathStyle: - description: 'Use path style path: http://s3.amazonaws.com/BUCKET/KEY instead of http://BUCKET.s3.amazonaws.com/KEY' - type: boolean - required: - - name - type: object - type: array - configDB: - items: - properties: - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - query: - type: string - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - required: - - name - - query - type: object - type: array - containerd: - items: - properties: - auth: - properties: - password: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - username: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - type: object - description: - description: Description for the check - type: string - expectedDigest: - type: string - expectedSize: - format: int64 - type: integer - icon: - description: Icon for overwriting default icon on the dashboard - type: string - image: - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - required: - - image - - name - type: object - type: array - containerdPush: - items: - properties: - description: - description: Description for the check - type: string - icon: - description: Icon for overwriting default icon on the dashboard - type: string - image: - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - password: - type: string - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - username: - type: string - required: - - image - - name - type: object - type: array - databaseBackup: - items: - properties: - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - gcp: - properties: - gcpConnection: - properties: - connection: - description: ConnectionName of the connection. It'll be used to populate the endpoint and credentials. - type: string - credentials: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - endpoint: - type: string - type: object - instance: - type: string - project: - type: string - required: - - instance - - project - type: object - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - maxAge: - type: string - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - required: - - name - type: object - type: array - dns: - items: - properties: - description: - description: Description for the check - type: string - exactreply: - items: - type: string - type: array - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - minrecords: - type: integer - name: - description: Name of the check - type: string - port: - type: integer - query: - type: string - querytype: - type: string - server: - type: string - thresholdMillis: - type: integer - timeout: - type: integer - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - required: - - name - type: object - type: array - docker: - items: - properties: - auth: - properties: - password: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - username: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - type: object - description: - description: Description for the check - type: string - expectedDigest: - type: string - expectedSize: - format: int64 - type: integer - icon: - description: Icon for overwriting default icon on the dashboard - type: string - image: - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - required: - - image - - name - type: object - type: array - dockerPush: - items: - properties: - auth: - properties: - password: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - username: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - type: object - description: - description: Description for the check - type: string - icon: - description: Icon for overwriting default icon on the dashboard - type: string - image: - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - required: - - image - - name - type: object - type: array - dynatrace: - items: - properties: - apiKey: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - connection: - type: string - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - host: - type: string - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - namespace: - type: string - scheme: - type: string - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - required: - - name - type: object - type: array - ec2: - items: - properties: - accessKey: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - ami: - type: string - canaryRef: - items: - description: LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. - properties: - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - type: object - x-kubernetes-map-type: atomic - type: array - connection: - description: ConnectionName of the connection. It'll be used to populate the endpoint, accessKey and secretKey. - type: string - description: - description: Description for the check - type: string - endpoint: - type: string - icon: - description: Icon for overwriting default icon on the dashboard - type: string - keepAlive: - type: boolean - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - objectPath: - description: glob path to restrict matches to a subset - type: string - region: - type: string - secretKey: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - securityGroup: - type: string - sessionToken: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - skipTLSVerify: - description: Skip TLS verify when connecting to aws - type: boolean - timeOut: - type: integer - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - usePathStyle: - description: 'Use path style path: http://s3.amazonaws.com/BUCKET/KEY instead of http://BUCKET.s3.amazonaws.com/KEY' - type: boolean - userData: - type: string - waitTime: - type: integer - required: - - name - type: object - type: array - elasticsearch: - items: - properties: - connection: - description: Connection name e.g. connection://http/google - type: string - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - icon: - description: Icon for overwriting default icon on the dashboard - type: string - index: - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - password: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - query: - type: string - results: - type: integer - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - url: - description: Connection url, interpolated with username,password - type: string - username: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - required: - - name - type: object - type: array - env: - additionalProperties: - description: VarSource represents a source for a value - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's namespace - properties: - key: - description: The key of the secret to select from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret or its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - value: - type: string - type: object - type: object - exec: - items: - properties: - connections: - properties: - aws: - properties: - accessKey: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - connection: - description: ConnectionName of the connection. It'll be used to populate the endpoint, accessKey and secretKey. - type: string - endpoint: - type: string - objectPath: - description: glob path to restrict matches to a subset - type: string - region: - type: string - secretKey: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - sessionToken: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - skipTLSVerify: - description: Skip TLS verify when connecting to aws - type: boolean - usePathStyle: - description: 'Use path style path: http://s3.amazonaws.com/BUCKET/KEY instead of http://BUCKET.s3.amazonaws.com/KEY' - type: boolean - type: object - azure: - properties: - clientID: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - clientSecret: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - connection: - type: string - tenantID: - type: string - type: object - gcp: - properties: - connection: - description: ConnectionName of the connection. It'll be used to populate the endpoint and credentials. - type: string - credentials: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - endpoint: - type: string - type: object - type: object - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - script: - description: Script can be a inline script or a path to a script that needs to be executed On windows executed via powershell and in darwin and linux executed using bash - type: string - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - required: - - name - - script - type: object - type: array - folder: - items: - properties: - availableSize: - description: AvailableSize present on the filesystem - type: string - awsConnection: - properties: - accessKey: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - connection: - description: ConnectionName of the connection. It'll be used to populate the endpoint, accessKey and secretKey. - type: string - endpoint: - type: string - objectPath: - description: glob path to restrict matches to a subset - type: string - region: - type: string - secretKey: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - sessionToken: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - skipTLSVerify: - description: Skip TLS verify when connecting to aws - type: boolean - usePathStyle: - description: 'Use path style path: http://s3.amazonaws.com/BUCKET/KEY instead of http://BUCKET.s3.amazonaws.com/KEY' - type: boolean - type: object - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - filter: - properties: - maxAge: - type: string - maxSize: - type: string - minAge: - type: string - minSize: - type: string - regex: - type: string - type: object - gcpConnection: - properties: - connection: - description: ConnectionName of the connection. It'll be used to populate the endpoint and credentials. - type: string - credentials: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - endpoint: - type: string - type: object - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - maxAge: - description: MaxAge the latest object should be younger than defined age - type: string - maxCount: - description: MinCount the minimum number of files inside the searchPath - type: integer - maxSize: - description: MaxSize of the files inside the searchPath - type: string - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - minAge: - description: MinAge the latest object should be older than defined age - type: string - minCount: - description: MinCount the minimum number of files inside the searchPath - type: integer - minSize: - description: MinSize of the files inside the searchPath - type: string - name: - description: Name of the check - type: string - path: - description: Path to folder or object storage, e.g. `s3://`, `gcs://`, `/path/tp/folder` - type: string - sftpConnection: - properties: - connection: - description: ConnectionName of the connection. It'll be used to populate the connection fields. - type: string - host: - type: string - password: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - port: - description: Port for the SSH server. Defaults to 22 - type: integer - username: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - required: - - host - type: object - smbConnection: - properties: - connection: - description: ConnectionName of the connection. It'll be used to populate the connection fields. - type: string - domain: - description: Domain... - type: string - password: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - port: - description: Port on which smb server is running. Defaults to 445 - type: integer - username: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - type: object - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - totalSize: - description: TotalSize present on the filesystem - type: string - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - required: - - name - - path - type: object - type: array - github: - items: - properties: - connection: - type: string - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - githubToken: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - query: - description: Query to be executed. Please see https://github.com/askgitdev/askgit for more details regarding syntax - type: string - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - required: - - name - - query - type: object - type: array - helm: - items: - properties: - auth: - properties: - password: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - username: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - type: object - cafile: - type: string - chartmuseum: - type: string - description: - description: Description for the check - type: string - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - project: - type: string - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - required: - - name - type: object - type: array - http: - items: - properties: - body: - description: Request Body Contents - type: string - connection: - description: Connection name e.g. connection://http/google - type: string - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - endpoint: - description: 'Deprecated: Use url instead' - type: string - headers: - description: Header fields to be used in the query - items: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - type: array - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - maxSSLExpiry: - description: Maximum number of days until the SSL Certificate expires. - type: integer - method: - description: Method to use - defaults to GET - type: string - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - namespace: - description: Namespace to crawl for TLS endpoints. Mutually exclusive with Endpoint - type: string - ntlm: - description: NTLM when set to true will do authentication using NTLM v1 protocol - type: boolean - ntlmv2: - description: NTLM when set to true will do authentication using NTLM v2 protocol - type: boolean - password: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - responseCodes: - description: Expected response codes for the HTTP Request. - items: - type: integer - type: array - responseContent: - description: Exact response content expected to be returned by the endpoint. - type: string - responseJSONContent: - description: Path and value to of expect JSON response by the endpoint - properties: - path: - type: string - value: - type: string - required: - - path - - value - type: object - templateBody: - description: Template the request body - type: boolean - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - thresholdMillis: - description: Maximum duration in milliseconds for the HTTP request. It will fail the check if it takes longer. - type: integer - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - url: - description: Connection url, interpolated with username,password - type: string - username: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - required: - - name - type: object - type: array - icmp: - items: - properties: - description: - description: Description for the check - type: string - endpoint: - type: string - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - packetCount: - type: integer - packetLossThreshold: - format: int64 - type: integer - thresholdMillis: - format: int64 - type: integer - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - required: - - name - type: object - type: array - icon: - type: string - interval: - description: interval (in seconds) to run checks on Deprecated in favor of Schedule - format: int64 - type: integer - jmeter: - items: - properties: - description: - description: Description for the check - type: string - host: - description: Host is the server against which test plan needs to be executed - type: string - icon: - description: Icon for overwriting default icon on the dashboard - type: string - jmx: - description: Jmx defines the ConfigMap or Secret reference to get the JMX test plan - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - port: - description: Port on which the server is running - format: int32 - type: integer - properties: - description: Properties defines the local Jmeter properties - items: - type: string - type: array - responseDuration: - description: ResponseDuration under which the all the test should pass - type: string - systemProperties: - description: SystemProperties defines the java system property - items: - type: string - type: array - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - required: - - jmx - - name - type: object - type: array - junit: - items: - properties: - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - spec: - type: object - x-kubernetes-preserve-unknown-fields: true - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - testResults: - type: string - timeout: - description: Timeout in minutes to wait for specified container to finish its job. Defaults to 5 minutes - type: integer - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - required: - - name - - spec - - testResults - type: object - type: array - kubernetes: - items: - properties: - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - icon: - description: Icon for overwriting default icon on the dashboard - type: string - ignore: - description: Ignore the specified resources from the fetched resources. Can be a glob pattern. - items: - type: string - type: array - kind: - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - namespace: - properties: - fieldSelector: - type: string - labelSelector: - type: string - name: - type: string - type: object - ready: - type: boolean - resource: - properties: - fieldSelector: - type: string - labelSelector: - type: string - name: - type: string - type: object - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - required: - - kind - - name - type: object - type: array - ldap: - items: - properties: - bindDN: - type: string - connection: - description: Connection name e.g. connection://http/google - type: string - description: - description: Description for the check - type: string - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - password: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - skipTLSVerify: - type: boolean - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - url: - description: Connection url, interpolated with username,password - type: string - userSearch: - type: string - username: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - required: - - bindDN - - name - type: object - type: array - mongodb: - items: - properties: - connection: - description: Connection name e.g. connection://http/google - type: string - description: - description: Description for the check - type: string - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - password: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - url: - description: Connection url, interpolated with username,password - type: string - username: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - required: - - name - type: object - type: array - mssql: - items: - properties: - connection: - description: Connection name e.g. connection://http/google - type: string - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - password: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - query: - type: string - results: - description: Number rows to check for - type: integer - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - url: - description: Connection url, interpolated with username,password - type: string - username: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - required: - - name - type: object - type: array - mysql: - items: - properties: - connection: - description: Connection name e.g. connection://http/google - type: string - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - password: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - query: - type: string - results: - description: Number rows to check for - type: integer - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - url: - description: Connection url, interpolated with username,password - type: string - username: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - required: - - name - type: object - type: array - namespace: - items: - properties: - deadline: - format: int64 - type: integer - deleteTimeout: - format: int64 - type: integer - description: - description: Description for the check - type: string - expectedContent: - type: string - expectedHttpStatuses: - items: - format: int64 - type: integer - type: array - httpRetryInterval: - format: int64 - type: integer - httpTimeout: - format: int64 - type: integer - icon: - description: Icon for overwriting default icon on the dashboard - type: string - ingressHost: - type: string - ingressName: - type: string - ingressTimeout: - format: int64 - type: integer - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - namespaceAnnotations: - additionalProperties: - type: string - type: object - namespaceLabels: - additionalProperties: - type: string - type: object - namespaceNamePrefix: - type: string - path: - type: string - podSpec: - type: string - port: - format: int64 - type: integer - priorityClass: - type: string - readyTimeout: - format: int64 - type: integer - schedule_timeout: - format: int64 - type: integer - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - required: - - name - - podSpec - type: object - type: array - opensearch: - items: - properties: - connection: - description: Connection name e.g. connection://http/google - type: string - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - icon: - description: Icon for overwriting default icon on the dashboard - type: string - index: - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - password: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - query: - type: string - results: - format: int64 - type: integer - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - url: - description: Connection url, interpolated with username,password - type: string - username: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - required: - - index - - name - - query - type: object - type: array - owner: - type: string - pod: - items: - properties: - deadline: - format: int64 - type: integer - deleteTimeout: - format: int64 - type: integer - description: - description: Description for the check - type: string - expectedContent: - type: string - expectedHttpStatuses: - items: - type: integer - type: array - httpRetryInterval: - format: int64 - type: integer - httpTimeout: - format: int64 - type: integer - icon: - description: Icon for overwriting default icon on the dashboard - type: string - ingressClass: - type: string - ingressHost: - type: string - ingressName: - type: string - ingressTimeout: - format: int64 - type: integer - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - namespace: - type: string - path: - type: string - port: - format: int64 - type: integer - priorityClass: - type: string - readyTimeout: - format: int64 - type: integer - roundRobinNodes: - type: boolean - scheduleTimeout: - format: int64 - type: integer - spec: - type: string - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - required: - - name - type: object - type: array - postgres: - items: - properties: - connection: - description: Connection name e.g. connection://http/google - type: string - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - password: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - query: - type: string - results: - description: Number rows to check for - type: integer - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - url: - description: Connection url, interpolated with username,password - type: string - username: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - required: - - name - type: object - type: array - prometheus: - items: - properties: - connection: - description: Connection name e.g. connection://http/google - type: string - description: - description: Description for the check - type: string - display: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - host: - description: 'Deprecated: use `url` instead' - type: string - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - password: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - query: - description: PromQL query - type: string - test: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transform: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - url: - description: Connection url, interpolated with username,password - type: string - username: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - required: - - name - - query - type: object - type: array - redis: - items: - properties: - addr: - description: 'Deprecated: Use url instead' - type: string - connection: - description: Connection name e.g. connection://http/google - type: string - db: - type: integer - description: - description: Description for the check - type: string - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - password: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - url: - description: Connection url, interpolated with username,password - type: string - username: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - required: - - name - type: object - type: array - restic: - items: - properties: - accessKey: - description: AccessKey access key id for connection with aws s3, minio, wasabi, alibaba oss - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - awsConnectionName: - description: Name of the AWS connection used to derive the access key and secret key. - type: string - caCert: - description: CaCert path to the root cert. In case of self-signed certificates - type: string - checkIntegrity: - description: CheckIntegrity when enabled will check the Integrity and consistency of the restic reposiotry - type: boolean - connection: - description: Name of the connection used to derive restic password. - type: string - description: - description: Description for the check - type: string - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - maxAge: - description: MaxAge for backup freshness - type: string - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - password: - description: Password for the restic repository - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - repository: - description: 'Repository The restic repository path eg: rest:https://user:pass@host:8000/ or rest:https://host:8000/ or s3:s3.amazonaws.com/bucket_name' - type: string - secretKey: - description: SecretKey secret access key for connection with aws s3, minio, wasabi, alibaba oss - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - required: - - maxAge - - name - - password - - repository - type: object - type: array - resultMode: - type: string - s3: - items: - properties: - accessKey: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - bucketName: - type: string - connection: - description: ConnectionName of the connection. It'll be used to populate the endpoint, accessKey and secretKey. - type: string - description: - description: Description for the check - type: string - endpoint: - type: string - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - objectPath: - description: glob path to restrict matches to a subset - type: string - region: - type: string - secretKey: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - sessionToken: - properties: - name: - type: string - value: - type: string - valueFrom: - properties: - configMapKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - secretKeyRef: - properties: - key: - type: string - name: - type: string - required: - - key - type: object - type: object - type: object - skipTLSVerify: - description: Skip TLS verify when connecting to aws - type: boolean - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - usePathStyle: - description: 'Use path style path: http://s3.amazonaws.com/BUCKET/KEY instead of http://BUCKET.s3.amazonaws.com/KEY' - type: boolean - required: - - name - type: object - type: array - schedule: - description: 'Schedule to run checks on. Supports all cron expression, example: ''30 3-6,20-23 * * *''. For more info about cron expression syntax see https://en.wikipedia.org/wiki/Cron Also supports golang duration, can be set as ''@every 1m30s'' which runs the check every 1 minute and 30 seconds.' - type: string - severity: - type: string - tcp: - items: - properties: - description: - description: Description for the check - type: string - endpoint: - type: string - icon: - description: Icon for overwriting default icon on the dashboard - type: string - labels: - additionalProperties: - type: string - description: Labels for the check - type: object - metrics: - description: Metrics to expose from check results - items: - properties: - labels: - items: - properties: - name: - type: string - value: - type: string - valueExpr: - type: string - required: - - name - type: object - type: array - name: - type: string - type: - type: string - value: - type: string - type: object - type: array - name: - description: Name of the check - type: string - thresholdMillis: - format: int64 - type: integer - transformDeleteStrategy: - description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is - type: string - required: - - name - type: object - type: array - type: object - status: - description: CanaryStatus defines the observed state of Canary - properties: - checkStatus: - additionalProperties: - properties: - errorMessage: - type: string - lastCheck: - format: date-time - type: string - lastTransitionedTime: - format: date-time - type: string - latency1h: - description: Average latency to complete all checks - type: string - message: - type: string - uptime1h: - description: Availibility over a rolling 1h period - type: string - type: object - type: object - checks: - additionalProperties: - type: string - description: contains the name and id of the checks associated with the canary - type: object - errorMessage: - type: string - lastCheck: - format: date-time - type: string - lastTransitionedTime: - format: date-time - type: string - latency1h: - description: Average latency to complete all checks - type: string - message: - type: string - observedGeneration: - format: int64 - type: integer - persistedID: - type: string - status: - type: string - uptime1h: - description: Availibility over a rolling 1h period - type: string - type: object - type: object - served: true - storage: true - subresources: - status: {} ---- -apiVersion: v1 -kind: Namespace -metadata: - labels: - control-plane: canary-checker - name: canary-checker ---- -apiVersion: v1 -kind: Service -metadata: - labels: - control-plane: canary-checker - name: canary-checker - namespace: canary-checker -spec: - ports: - - port: 8080 - protocol: TCP - targetPort: 8080 - selector: - control-plane: canary-checker ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - control-plane: canary-checker - name: canary-checker - namespace: canary-checker -spec: - replicas: 1 - selector: - matchLabels: - control-plane: canary-checker - template: - metadata: - labels: - control-plane: canary-checker - spec: - containers: - - args: - - operator - - -v - - --httpPort - - "8080" - command: - - /app/canary-checker - env: - - name: DOCKER_API_VERSION - value: "1.39" - image: docker.io/flanksource/canary-checker:latest - livenessProbe: - httpGet: - path: /health - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 5 - name: canary-checker - readinessProbe: - httpGet: - path: /health - port: 8080 - initialDelaySeconds: 10 - periodSeconds: 5 - resources: - limits: - memory: 512Mi - requests: - cpu: 200m - memory: 200Mi - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: - - CAP_NET_RAW - privileged: true - runAsUser: 0 - volumeMounts: - - mountPath: /var/run/docker.sock - name: dockersock - - mountPath: /etc/podinfo - name: podinfo - serviceAccountName: canary-checker-sa - terminationGracePeriodSeconds: 10 - volumes: - - hostPath: - path: /var/run/docker.sock - name: dockersock - - downwardAPI: - items: - - fieldRef: - fieldPath: metadata.labels - path: labels - name: podinfo ---- -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - annotations: - kubernetes.io/tls-acme: "true" - name: canary-checker - namespace: canary-checker -spec: - rules: - - host: canary-checker - http: - paths: - - backend: - service: - name: canary-checker - port: - number: 8080 - path: / - pathType: ImplementationSpecific - tls: - - hosts: - - canary-checker - secretName: canary-tls ---- -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - labels: - control-plane: canary-checker - name: canary-checker-monitor - namespace: canary-checker -spec: - endpoints: - - interval: 30s - port: metrics - jobLabel: canary-checker - selector: - matchLabels: - control-plane: canary-checker ---- -apiVersion: scheduling.k8s.io/v1 -description: This priority class should be used for canary pods only. -globalDefault: false -kind: PriorityClass -metadata: - name: canary-checker-priority -value: -1 ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - creationTimestamp: null - name: canary-checker-role -rules: - - apiGroups: - - canaries.flanksource.com - resources: - - canaries - - topologies - verbs: - - create - - delete - - get - - list - - patch - - update - - watch - - apiGroups: - - canaries.flanksource.com - resources: - - canaries/status - - topologies/status - verbs: - - get - - patch - - update - - apiGroups: - - "" - resources: - - pods - - namespaces - - services - verbs: - - '*' - - apiGroups: - - metrics.k8s.io - resources: - - pods - - nodes - verbs: - - '*' - - apiGroups: - - "" - resources: - - pods/exec - - pods/log - verbs: - - '*' - - apiGroups: - - "" - resources: - - nodes - verbs: - - get - - list - - apiGroups: - - extensions - resources: - - ingresses - verbs: - - '*' - - apiGroups: - - networking.k8s.io - resources: - - ingresses - verbs: - - '*' - - apiGroups: - - "" - resources: - - secrets - - configmaps - verbs: - - get - - list - - apiGroups: - - "" - resources: - - events - verbs: - - create - - patch - - apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch - - create - - update - - patch - - delete - - apiGroups: - - "" - resources: - - configmaps/status - verbs: - - get - - update - - patch ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: canary-checker-rolebinding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: canary-checker-role -subjects: - - kind: ServiceAccount - name: canary-checker-sa - namespace: canary-checker ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - control-plane: canary-checker - name: canary-checker-sa - namespace: canary-checker ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.11.1 - creationTimestamp: null - name: components.canaries.flanksource.com -spec: - group: canaries.flanksource.com - names: - kind: Component - listKind: ComponentList - plural: components - singular: component - scope: Namespaced - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - checks: - items: - type: object - type: array - components: - description: Create new child components - items: - type: object - type: array - x-kubernetes-preserve-unknown-fields: true - configs: - description: Lookup and associate config items with this component - items: - properties: - id: - items: - type: string - type: array - name: - type: string - namespace: - type: string - tags: - additionalProperties: - type: string - type: object - type: - type: string - type: object - type: array - forEach: - description: Only applies when using lookup, when specified the components and properties specified under ForEach will be templated using the components returned by the lookup ${.properties} can be used to reference the properties of the component ${.component} can be used to reference the component itself - type: object - icon: - type: string - id: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - lifecycle: - description: The lifecycle state of the component e.g. production, staging, dev, etc. - type: string - logs: - description: Logs is a list of logs selector for apm-hub. - items: - properties: - labels: - additionalProperties: - type: string - type: object - name: - type: string - type: - type: string - type: object - type: array - lookup: - description: Lookup component definitions from an external source, use the forEach property to iterate over the results to further enrich each component. - type: object - x-kubernetes-preserve-unknown-fields: true - name: - type: string - order: - type: integer - owner: - type: string - properties: - items: - properties: - color: - type: string - configLookup: - properties: - config: - description: Lookup a config by it - properties: - id: - items: - type: string - type: array - name: - type: string - namespace: - type: string - tags: - additionalProperties: - type: string - type: object - type: - type: string - type: object - display: - description: Apply transformations to the value - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - field: - description: A JSONPath expression to lookup the value in the config - type: string - id: - type: string - type: object - headline: - type: boolean - icon: - type: string - label: - type: string - lastTransition: - type: string - links: - items: - properties: - icon: - type: string - label: - type: string - text: - type: string - tooltip: - type: string - type: - description: e.g. documentation, support, playbook - type: string - url: - type: string - type: object - type: array - lookup: - description: CanarySpec defines the desired state of Canary - type: object - x-kubernetes-preserve-unknown-fields: true - max: - format: int64 - type: integer - min: - format: int64 - type: integer - name: - type: string - order: - type: integer - status: - type: string - summary: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - text: - type: string - tooltip: - type: string - type: - type: string - unit: - description: e.g. milliseconds, bytes, millicores, epoch etc. - type: string - value: - format: int64 - type: integer - type: object - type: array - x-kubernetes-preserve-unknown-fields: true - relationships: - items: - properties: - ref: - type: string - type: - description: The type of relationship, e.g. dependsOn, subcomponentOf, providesApis, consumesApis - type: string - type: object - type: array - selectors: - description: Lookup and associcate other components with this component - items: - properties: - fieldSelector: - type: string - labelSelector: - type: string - name: - type: string - type: object - type: array - summary: - properties: - healthy: - type: integer - incidents: - additionalProperties: - additionalProperties: - type: integer - type: object - type: object - info: - type: integer - insights: - additionalProperties: - additionalProperties: - type: integer - type: object - type: object - unhealthy: - type: integer - warning: - type: integer - type: object - tooltip: - type: string - type: - description: The type of component, e.g. service, API, website, library, database, etc. - type: string - type: object - status: - properties: - status: - type: string - type: object - type: object - served: true - storage: true ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.11.1 - creationTimestamp: null - name: topologies.canaries.flanksource.com -spec: - group: canaries.flanksource.com - names: - kind: Topology - listKind: TopologyList - plural: topologies - singular: topology - scope: Namespaced - versions: - - name: v1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - components: - items: - properties: - checks: - items: - properties: - inline: - description: CanarySpec defines the desired state of Canary - type: object - x-kubernetes-preserve-unknown-fields: true - selector: - properties: - fieldSelector: - type: string - labelSelector: - type: string - name: - type: string - type: object - type: object - type: array - components: - description: Create new child components - items: - type: object - type: array - x-kubernetes-preserve-unknown-fields: true - configs: - description: Lookup and associate config items with this component - items: - properties: - id: - items: - type: string - type: array - name: - type: string - namespace: - type: string - tags: - additionalProperties: - type: string - type: object - type: - type: string - type: object - type: array - forEach: - description: Only applies when using lookup, when specified the components and properties specified under ForEach will be templated using the components returned by the lookup ${.properties} can be used to reference the properties of the component ${.component} can be used to reference the component itself - type: object - icon: - type: string - id: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - lifecycle: - description: The lifecycle state of the component e.g. production, staging, dev, etc. - type: string - logs: - description: Logs is a list of logs selector for apm-hub. - items: - properties: - labels: - additionalProperties: - type: string - type: object - name: - type: string - type: - type: string - type: object - type: array - lookup: - description: Lookup component definitions from an external source, use the forEach property to iterate over the results to further enrich each component. - type: object - x-kubernetes-preserve-unknown-fields: true - name: - type: string - order: - type: integer - owner: - type: string - properties: - items: - properties: - color: - type: string - configLookup: - properties: - config: - description: Lookup a config by it - properties: - id: - items: - type: string - type: array - name: - type: string - namespace: - type: string - tags: - additionalProperties: - type: string - type: object - type: - type: string - type: object - display: - description: Apply transformations to the value - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - field: - description: A JSONPath expression to lookup the value in the config - type: string - id: - type: string - type: object - headline: - type: boolean - icon: - type: string - label: - type: string - lastTransition: - type: string - links: - items: - properties: - icon: - type: string - label: - type: string - text: - type: string - tooltip: - type: string - type: - description: e.g. documentation, support, playbook - type: string - url: - type: string - type: object - type: array - lookup: - description: CanarySpec defines the desired state of Canary - type: object - x-kubernetes-preserve-unknown-fields: true - max: - format: int64 - type: integer - min: - format: int64 - type: integer - name: - type: string - order: - type: integer - status: - type: string - summary: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - text: - type: string - tooltip: - type: string - type: - type: string - unit: - description: e.g. milliseconds, bytes, millicores, epoch etc. - type: string - value: - format: int64 - type: integer - type: object - type: array - x-kubernetes-preserve-unknown-fields: true - relationships: - items: - properties: - ref: - type: string - type: - description: The type of relationship, e.g. dependsOn, subcomponentOf, providesApis, consumesApis - type: string - type: object - type: array - selectors: - description: Lookup and associcate other components with this component - items: - properties: - fieldSelector: - type: string - labelSelector: - type: string - name: - type: string - type: object - type: array - summary: - properties: - healthy: - type: integer - incidents: - additionalProperties: - additionalProperties: - type: integer - type: object - type: object - info: - type: integer - insights: - additionalProperties: - additionalProperties: - type: integer - type: object - type: object - unhealthy: - type: integer - warning: - type: integer - type: object - tooltip: - type: string - type: - description: The type of component, e.g. service, API, website, library, database, etc. - type: string - type: object - type: array - configs: - description: Lookup and associate config items with this component - items: - properties: - id: - items: - type: string - type: array - name: - type: string - namespace: - type: string - tags: - additionalProperties: - type: string - type: object - type: - type: string - type: object - type: array - icon: - type: string - id: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - label: - type: string - owner: - type: string - properties: - description: Properties are created once the full component tree is created, property lookup functions can return a map of coomponent name => properties to allow for bulk property lookups being applied to multiple components in the tree - items: - properties: - color: - type: string - configLookup: - properties: - config: - description: Lookup a config by it - properties: - id: - items: - type: string - type: array - name: - type: string - namespace: - type: string - tags: - additionalProperties: - type: string - type: object - type: - type: string - type: object - display: - description: Apply transformations to the value - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - field: - description: A JSONPath expression to lookup the value in the config - type: string - id: - type: string - type: object - headline: - type: boolean - icon: - type: string - label: - type: string - lastTransition: - type: string - links: - items: - properties: - icon: - type: string - label: - type: string - text: - type: string - tooltip: - type: string - type: - description: e.g. documentation, support, playbook - type: string - url: - type: string - type: object - type: array - lookup: - description: CanarySpec defines the desired state of Canary - type: object - x-kubernetes-preserve-unknown-fields: true - max: - format: int64 - type: integer - min: - format: int64 - type: integer - name: - type: string - order: - type: integer - status: - type: string - summary: - properties: - expr: - type: string - javascript: - type: string - jsonPath: - type: string - template: - type: string - type: object - text: - type: string - tooltip: - type: string - type: - type: string - unit: - description: e.g. milliseconds, bytes, millicores, epoch etc. - type: string - value: - format: int64 - type: integer - type: object - type: array - schedule: - type: string - text: - type: string - tooltip: - type: string - type: - type: string - type: object - status: - properties: - observedGeneration: - format: int64 - type: integer - persistentID: - type: string - status: - type: string - type: object - type: object - served: true - storage: true - subresources: - status: {} +{} diff --git a/config/schemas/canary.schema.json b/config/schemas/canary.schema.json index c0d65ce0d..a97c3a5f6 100644 --- a/config/schemas/canary.schema.json +++ b/config/schemas/canary.schema.json @@ -1698,7 +1698,7 @@ "templateBody": { "type": "boolean" }, - "envVar": { + "env": { "items": { "$ref": "#/$defs/EnvVar" }, diff --git a/config/schemas/component.schema.json b/config/schemas/component.schema.json index 4b2e2c889..7ce05b377 100644 --- a/config/schemas/component.schema.json +++ b/config/schemas/component.schema.json @@ -1910,7 +1910,7 @@ "templateBody": { "type": "boolean" }, - "envVar": { + "env": { "items": { "$ref": "#/$defs/EnvVar" }, diff --git a/config/schemas/health_http.schema.json b/config/schemas/health_http.schema.json index 6273de20e..fcc39e87e 100644 --- a/config/schemas/health_http.schema.json +++ b/config/schemas/health_http.schema.json @@ -134,7 +134,7 @@ "templateBody": { "type": "boolean" }, - "envVar": { + "env": { "items": { "$ref": "#/$defs/EnvVar" }, diff --git a/config/schemas/topology.schema.json b/config/schemas/topology.schema.json index 615116b7f..6d945f0b9 100644 --- a/config/schemas/topology.schema.json +++ b/config/schemas/topology.schema.json @@ -1880,7 +1880,7 @@ "templateBody": { "type": "boolean" }, - "envVar": { + "env": { "items": { "$ref": "#/$defs/EnvVar" }, From 949a1016ef502b1300fd89ce981fe8bee2cd01f3 Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Mon, 16 Oct 2023 21:53:01 +0545 Subject: [PATCH 4/7] fix: don't fetch response after the reader is closed --- checks/http.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/checks/http.go b/checks/http.go index ed9c1cc9b..406498882 100644 --- a/checks/http.go +++ b/checks/http.go @@ -195,19 +195,17 @@ func (c *HTTPChecker) Check(ctx *context.Context, extConfig external.Check) pkg. sslExpiration.WithLabelValues(check.URL).Set(age.Hours() * 24) } - body, _ = response.AsString() - data := map[string]interface{}{ "code": status, "headers": response.Header, "elapsed": time.Since(start), - "content": body, "sslAge": utils.Deref(age), "json": make(map[string]any), } if response.IsJSON() { json, err := response.AsJSON() + data["json"] = json if err == nil { data["json"] = json if check.ResponseJSONContent != nil && check.ResponseJSONContent.Path != "" { @@ -221,6 +219,9 @@ func (c *HTTPChecker) Check(ctx *context.Context, extConfig external.Check) pkg. } else { ctx.Tracef("ignoring invalid json response %v", err) } + } else { + responseBody, _ := response.AsString() + data["content"] = responseBody } result.AddData(data) From b53c5bdb46fb89247af3bd67d845d918a4d49098 Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Mon, 16 Oct 2023 21:57:24 +0545 Subject: [PATCH 5/7] chore: run make resources --- config/deploy/base.yaml | 262 +- config/deploy/manifests.yaml | 6372 ++++++++++++++++++++++- fixtures/minimal/http-check-labels.yaml | 1 - 3 files changed, 6632 insertions(+), 3 deletions(-) diff --git a/config/deploy/base.yaml b/config/deploy/base.yaml index 0967ef424..a312a06c4 100644 --- a/config/deploy/base.yaml +++ b/config/deploy/base.yaml @@ -1 +1,261 @@ -{} +apiVersion: v1 +kind: Service +metadata: + labels: + control-plane: canary-checker + name: canary-checker + namespace: canary-checker +spec: + ports: + - port: 8080 + protocol: TCP + targetPort: 8080 + selector: + control-plane: canary-checker +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + control-plane: canary-checker + name: canary-checker + namespace: canary-checker +spec: + replicas: 1 + selector: + matchLabels: + control-plane: canary-checker + template: + metadata: + labels: + control-plane: canary-checker + spec: + containers: + - args: + - operator + - -v + - --httpPort + - "8080" + command: + - /app/canary-checker + env: + - name: DOCKER_API_VERSION + value: "1.39" + image: docker.io/flanksource/canary-checker:latest + livenessProbe: + httpGet: + path: /health + port: 8080 + initialDelaySeconds: 10 + periodSeconds: 5 + name: canary-checker + readinessProbe: + httpGet: + path: /health + port: 8080 + initialDelaySeconds: 10 + periodSeconds: 5 + resources: + limits: + memory: 512Mi + requests: + cpu: 200m + memory: 200Mi + securityContext: + allowPrivilegeEscalation: true + capabilities: + add: + - CAP_NET_RAW + privileged: true + runAsUser: 0 + volumeMounts: + - mountPath: /var/run/docker.sock + name: dockersock + - mountPath: /etc/podinfo + name: podinfo + serviceAccountName: canary-checker-sa + terminationGracePeriodSeconds: 10 + volumes: + - hostPath: + path: /var/run/docker.sock + name: dockersock + - downwardAPI: + items: + - fieldRef: + fieldPath: metadata.labels + path: labels + name: podinfo +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/tls-acme: "true" + name: canary-checker + namespace: canary-checker +spec: + rules: + - host: canary-checker + http: + paths: + - backend: + service: + name: canary-checker + port: + number: 8080 + path: / + pathType: ImplementationSpecific + tls: + - hosts: + - canary-checker + secretName: canary-tls +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + labels: + control-plane: canary-checker + name: canary-checker-monitor + namespace: canary-checker +spec: + endpoints: + - interval: 30s + port: metrics + jobLabel: canary-checker + selector: + matchLabels: + control-plane: canary-checker +--- +apiVersion: scheduling.k8s.io/v1 +description: This priority class should be used for canary pods only. +globalDefault: false +kind: PriorityClass +metadata: + name: canary-checker-priority +value: -1 +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + creationTimestamp: null + name: canary-checker-role +rules: + - apiGroups: + - canaries.flanksource.com + resources: + - canaries + - topologies + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - canaries.flanksource.com + resources: + - canaries/status + - topologies/status + verbs: + - get + - patch + - update + - apiGroups: + - "" + resources: + - pods + - namespaces + - services + verbs: + - '*' + - apiGroups: + - metrics.k8s.io + resources: + - pods + - nodes + verbs: + - '*' + - apiGroups: + - "" + resources: + - pods/exec + - pods/log + verbs: + - '*' + - apiGroups: + - "" + resources: + - nodes + verbs: + - get + - list + - apiGroups: + - extensions + resources: + - ingresses + verbs: + - '*' + - apiGroups: + - networking.k8s.io + resources: + - ingresses + verbs: + - '*' + - apiGroups: + - "" + resources: + - secrets + - configmaps + verbs: + - get + - list + - apiGroups: + - "" + resources: + - events + verbs: + - create + - patch + - apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - create + - update + - patch + - delete + - apiGroups: + - "" + resources: + - configmaps/status + verbs: + - get + - update + - patch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: canary-checker-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: canary-checker-role +subjects: + - kind: ServiceAccount + name: canary-checker-sa + namespace: canary-checker +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + control-plane: canary-checker + name: canary-checker-sa + namespace: canary-checker diff --git a/config/deploy/manifests.yaml b/config/deploy/manifests.yaml index 0967ef424..62ef79ce9 100644 --- a/config/deploy/manifests.yaml +++ b/config/deploy/manifests.yaml @@ -1 +1,6371 @@ -{} +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + creationTimestamp: null + name: canaries.canaries.flanksource.com +spec: + group: canaries.flanksource.com + names: + kind: Canary + listKind: CanaryList + plural: canaries + singular: canary + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .spec.interval + name: Interval + type: string + - jsonPath: .status.status + name: Status + type: string + - jsonPath: .status.lastCheck + name: Last Check + type: date + - jsonPath: .status.uptime1h + name: Uptime 1H + type: string + - jsonPath: .status.latency1h + name: Latency 1H + type: string + - jsonPath: .status.lastTransitionedTime + name: Last Transitioned + type: date + - jsonPath: .status.message + name: Message + priority: 1 + type: string + - jsonPath: .status.errorMessage + name: Error + priority: 1 + type: string + name: v1 + schema: + openAPIV3Schema: + description: Canary is the Schema for the canaries API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: CanarySpec defines the desired state of Canary + properties: + alertmanager: + items: + properties: + alerts: + items: + type: string + type: array + connection: + description: Connection name e.g. connection://http/google + type: string + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + exclude_filters: + additionalProperties: + type: string + type: object + filters: + additionalProperties: + type: string + type: object + icon: + description: Icon for overwriting default icon on the dashboard + type: string + ignore: + items: + type: string + type: array + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + password: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + url: + description: Connection url, interpolated with username,password + type: string + username: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + required: + - name + type: object + type: array + awsConfig: + items: + properties: + accessKey: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + aggregatorName: + type: string + connection: + description: ConnectionName of the connection. It'll be used to populate the endpoint, accessKey and secretKey. + type: string + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + endpoint: + type: string + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + objectPath: + description: glob path to restrict matches to a subset + type: string + query: + type: string + region: + type: string + secretKey: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + sessionToken: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + skipTLSVerify: + description: Skip TLS verify when connecting to aws + type: boolean + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + usePathStyle: + description: 'Use path style path: http://s3.amazonaws.com/BUCKET/KEY instead of http://BUCKET.s3.amazonaws.com/KEY' + type: boolean + required: + - name + - query + type: object + type: array + awsConfigRule: + items: + properties: + accessKey: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + complianceTypes: + description: Filters the results by compliance. The allowed values are INSUFFICIENT_DATA, NON_COMPLIANT, NOT_APPLICABLE, COMPLIANT + items: + type: string + type: array + connection: + description: ConnectionName of the connection. It'll be used to populate the endpoint, accessKey and secretKey. + type: string + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + endpoint: + type: string + icon: + description: Icon for overwriting default icon on the dashboard + type: string + ignoreRules: + description: List of rules which would be omitted from the fetch result + items: + type: string + type: array + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + objectPath: + description: glob path to restrict matches to a subset + type: string + region: + type: string + rules: + description: Specify one or more Config rule names to filter the results by rule. + items: + type: string + type: array + secretKey: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + sessionToken: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + skipTLSVerify: + description: Skip TLS verify when connecting to aws + type: boolean + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + usePathStyle: + description: 'Use path style path: http://s3.amazonaws.com/BUCKET/KEY instead of http://BUCKET.s3.amazonaws.com/KEY' + type: boolean + required: + - name + type: object + type: array + azureDevops: + items: + properties: + branch: + items: + type: string + type: array + connection: + type: string + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + organization: + type: string + personalAccessToken: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + pipeline: + type: string + project: + type: string + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + thresholdMillis: + description: ThresholdMillis the maximum duration of a Run. (Optional) + type: integer + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + variables: + additionalProperties: + type: string + type: object + required: + - branch + - name + - organization + - personalAccessToken + - pipeline + - project + - thresholdMillis + - variables + type: object + type: array + cloudwatch: + items: + properties: + accessKey: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + actionPrefix: + type: string + alarmPrefix: + type: string + alarms: + items: + type: string + type: array + connection: + description: ConnectionName of the connection. It'll be used to populate the endpoint, accessKey and secretKey. + type: string + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + endpoint: + type: string + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + objectPath: + description: glob path to restrict matches to a subset + type: string + region: + type: string + secretKey: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + sessionToken: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + skipTLSVerify: + description: Skip TLS verify when connecting to aws + type: boolean + state: + type: string + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + usePathStyle: + description: 'Use path style path: http://s3.amazonaws.com/BUCKET/KEY instead of http://BUCKET.s3.amazonaws.com/KEY' + type: boolean + required: + - name + type: object + type: array + configDB: + items: + properties: + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + query: + type: string + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + required: + - name + - query + type: object + type: array + containerd: + items: + properties: + auth: + properties: + password: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + username: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + type: object + description: + description: Description for the check + type: string + expectedDigest: + type: string + expectedSize: + format: int64 + type: integer + icon: + description: Icon for overwriting default icon on the dashboard + type: string + image: + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + required: + - image + - name + type: object + type: array + containerdPush: + items: + properties: + description: + description: Description for the check + type: string + icon: + description: Icon for overwriting default icon on the dashboard + type: string + image: + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + password: + type: string + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + username: + type: string + required: + - image + - name + type: object + type: array + databaseBackup: + items: + properties: + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + gcp: + properties: + gcpConnection: + properties: + connection: + description: ConnectionName of the connection. It'll be used to populate the endpoint and credentials. + type: string + credentials: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + endpoint: + type: string + type: object + instance: + type: string + project: + type: string + required: + - instance + - project + type: object + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + maxAge: + type: string + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + required: + - name + type: object + type: array + dns: + items: + properties: + description: + description: Description for the check + type: string + exactreply: + items: + type: string + type: array + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + minrecords: + type: integer + name: + description: Name of the check + type: string + port: + type: integer + query: + type: string + querytype: + type: string + server: + type: string + thresholdMillis: + type: integer + timeout: + type: integer + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + required: + - name + type: object + type: array + docker: + items: + properties: + auth: + properties: + password: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + username: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + type: object + description: + description: Description for the check + type: string + expectedDigest: + type: string + expectedSize: + format: int64 + type: integer + icon: + description: Icon for overwriting default icon on the dashboard + type: string + image: + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + required: + - image + - name + type: object + type: array + dockerPush: + items: + properties: + auth: + properties: + password: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + username: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + type: object + description: + description: Description for the check + type: string + icon: + description: Icon for overwriting default icon on the dashboard + type: string + image: + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + required: + - image + - name + type: object + type: array + dynatrace: + items: + properties: + apiKey: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + connection: + type: string + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + host: + type: string + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + namespace: + type: string + scheme: + type: string + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + required: + - name + type: object + type: array + ec2: + items: + properties: + accessKey: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + ami: + type: string + canaryRef: + items: + description: LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + x-kubernetes-map-type: atomic + type: array + connection: + description: ConnectionName of the connection. It'll be used to populate the endpoint, accessKey and secretKey. + type: string + description: + description: Description for the check + type: string + endpoint: + type: string + icon: + description: Icon for overwriting default icon on the dashboard + type: string + keepAlive: + type: boolean + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + objectPath: + description: glob path to restrict matches to a subset + type: string + region: + type: string + secretKey: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + securityGroup: + type: string + sessionToken: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + skipTLSVerify: + description: Skip TLS verify when connecting to aws + type: boolean + timeOut: + type: integer + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + usePathStyle: + description: 'Use path style path: http://s3.amazonaws.com/BUCKET/KEY instead of http://BUCKET.s3.amazonaws.com/KEY' + type: boolean + userData: + type: string + waitTime: + type: integer + required: + - name + type: object + type: array + elasticsearch: + items: + properties: + connection: + description: Connection name e.g. connection://http/google + type: string + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + icon: + description: Icon for overwriting default icon on the dashboard + type: string + index: + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + password: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + query: + type: string + results: + type: integer + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + url: + description: Connection url, interpolated with username,password + type: string + username: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + required: + - name + type: object + type: array + env: + additionalProperties: + description: VarSource represents a source for a value + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the pod's namespace + properties: + key: + description: The key of the secret to select from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + value: + type: string + type: object + type: object + exec: + items: + properties: + connections: + properties: + aws: + properties: + accessKey: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + connection: + description: ConnectionName of the connection. It'll be used to populate the endpoint, accessKey and secretKey. + type: string + endpoint: + type: string + objectPath: + description: glob path to restrict matches to a subset + type: string + region: + type: string + secretKey: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + sessionToken: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + skipTLSVerify: + description: Skip TLS verify when connecting to aws + type: boolean + usePathStyle: + description: 'Use path style path: http://s3.amazonaws.com/BUCKET/KEY instead of http://BUCKET.s3.amazonaws.com/KEY' + type: boolean + type: object + azure: + properties: + clientID: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + clientSecret: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + connection: + type: string + tenantID: + type: string + type: object + gcp: + properties: + connection: + description: ConnectionName of the connection. It'll be used to populate the endpoint and credentials. + type: string + credentials: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + endpoint: + type: string + type: object + type: object + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + script: + description: Script can be a inline script or a path to a script that needs to be executed On windows executed via powershell and in darwin and linux executed using bash + type: string + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + required: + - name + - script + type: object + type: array + folder: + items: + properties: + availableSize: + description: AvailableSize present on the filesystem + type: string + awsConnection: + properties: + accessKey: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + connection: + description: ConnectionName of the connection. It'll be used to populate the endpoint, accessKey and secretKey. + type: string + endpoint: + type: string + objectPath: + description: glob path to restrict matches to a subset + type: string + region: + type: string + secretKey: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + sessionToken: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + skipTLSVerify: + description: Skip TLS verify when connecting to aws + type: boolean + usePathStyle: + description: 'Use path style path: http://s3.amazonaws.com/BUCKET/KEY instead of http://BUCKET.s3.amazonaws.com/KEY' + type: boolean + type: object + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + filter: + properties: + maxAge: + type: string + maxSize: + type: string + minAge: + type: string + minSize: + type: string + regex: + type: string + type: object + gcpConnection: + properties: + connection: + description: ConnectionName of the connection. It'll be used to populate the endpoint and credentials. + type: string + credentials: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + endpoint: + type: string + type: object + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + maxAge: + description: MaxAge the latest object should be younger than defined age + type: string + maxCount: + description: MinCount the minimum number of files inside the searchPath + type: integer + maxSize: + description: MaxSize of the files inside the searchPath + type: string + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + minAge: + description: MinAge the latest object should be older than defined age + type: string + minCount: + description: MinCount the minimum number of files inside the searchPath + type: integer + minSize: + description: MinSize of the files inside the searchPath + type: string + name: + description: Name of the check + type: string + path: + description: Path to folder or object storage, e.g. `s3://`, `gcs://`, `/path/tp/folder` + type: string + sftpConnection: + properties: + connection: + description: ConnectionName of the connection. It'll be used to populate the connection fields. + type: string + host: + type: string + password: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + port: + description: Port for the SSH server. Defaults to 22 + type: integer + username: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + required: + - host + type: object + smbConnection: + properties: + connection: + description: ConnectionName of the connection. It'll be used to populate the connection fields. + type: string + domain: + description: Domain... + type: string + password: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + port: + description: Port on which smb server is running. Defaults to 445 + type: integer + username: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + type: object + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + totalSize: + description: TotalSize present on the filesystem + type: string + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + required: + - name + - path + type: object + type: array + github: + items: + properties: + connection: + type: string + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + githubToken: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + query: + description: Query to be executed. Please see https://github.com/askgitdev/askgit for more details regarding syntax + type: string + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + required: + - name + - query + type: object + type: array + helm: + items: + properties: + auth: + properties: + password: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + username: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + type: object + cafile: + type: string + chartmuseum: + type: string + description: + description: Description for the check + type: string + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + project: + type: string + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + required: + - name + type: object + type: array + http: + items: + properties: + body: + description: Request Body Contents + type: string + connection: + description: Connection name e.g. connection://http/google + type: string + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + endpoint: + description: 'Deprecated: Use url instead' + type: string + env: + description: EnvVars are the environment variables that are accesible to templated body + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + type: array + headers: + description: Header fields to be used in the query + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + type: array + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + maxSSLExpiry: + description: Maximum number of days until the SSL Certificate expires. + type: integer + method: + description: Method to use - defaults to GET + type: string + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + namespace: + description: Namespace to crawl for TLS endpoints. Mutually exclusive with Endpoint + type: string + ntlm: + description: NTLM when set to true will do authentication using NTLM v1 protocol + type: boolean + ntlmv2: + description: NTLM when set to true will do authentication using NTLM v2 protocol + type: boolean + password: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + responseCodes: + description: Expected response codes for the HTTP Request. + items: + type: integer + type: array + responseContent: + description: Exact response content expected to be returned by the endpoint. + type: string + responseJSONContent: + description: Path and value to of expect JSON response by the endpoint + properties: + path: + type: string + value: + type: string + required: + - path + - value + type: object + templateBody: + description: Template the request body + type: boolean + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + thresholdMillis: + description: Maximum duration in milliseconds for the HTTP request. It will fail the check if it takes longer. + type: integer + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + url: + description: Connection url, interpolated with username,password + type: string + username: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + required: + - name + type: object + type: array + icmp: + items: + properties: + description: + description: Description for the check + type: string + endpoint: + type: string + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + packetCount: + type: integer + packetLossThreshold: + format: int64 + type: integer + thresholdMillis: + format: int64 + type: integer + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + required: + - name + type: object + type: array + icon: + type: string + interval: + description: interval (in seconds) to run checks on Deprecated in favor of Schedule + format: int64 + type: integer + jmeter: + items: + properties: + description: + description: Description for the check + type: string + host: + description: Host is the server against which test plan needs to be executed + type: string + icon: + description: Icon for overwriting default icon on the dashboard + type: string + jmx: + description: Jmx defines the ConfigMap or Secret reference to get the JMX test plan + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + port: + description: Port on which the server is running + format: int32 + type: integer + properties: + description: Properties defines the local Jmeter properties + items: + type: string + type: array + responseDuration: + description: ResponseDuration under which the all the test should pass + type: string + systemProperties: + description: SystemProperties defines the java system property + items: + type: string + type: array + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + required: + - jmx + - name + type: object + type: array + junit: + items: + properties: + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + spec: + type: object + x-kubernetes-preserve-unknown-fields: true + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + testResults: + type: string + timeout: + description: Timeout in minutes to wait for specified container to finish its job. Defaults to 5 minutes + type: integer + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + required: + - name + - spec + - testResults + type: object + type: array + kubernetes: + items: + properties: + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + icon: + description: Icon for overwriting default icon on the dashboard + type: string + ignore: + description: Ignore the specified resources from the fetched resources. Can be a glob pattern. + items: + type: string + type: array + kind: + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + namespace: + properties: + fieldSelector: + type: string + labelSelector: + type: string + name: + type: string + type: object + ready: + type: boolean + resource: + properties: + fieldSelector: + type: string + labelSelector: + type: string + name: + type: string + type: object + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + required: + - kind + - name + type: object + type: array + ldap: + items: + properties: + bindDN: + type: string + connection: + description: Connection name e.g. connection://http/google + type: string + description: + description: Description for the check + type: string + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + password: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + skipTLSVerify: + type: boolean + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + url: + description: Connection url, interpolated with username,password + type: string + userSearch: + type: string + username: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + required: + - bindDN + - name + type: object + type: array + mongodb: + items: + properties: + connection: + description: Connection name e.g. connection://http/google + type: string + description: + description: Description for the check + type: string + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + password: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + url: + description: Connection url, interpolated with username,password + type: string + username: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + required: + - name + type: object + type: array + mssql: + items: + properties: + connection: + description: Connection name e.g. connection://http/google + type: string + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + password: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + query: + type: string + results: + description: Number rows to check for + type: integer + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + url: + description: Connection url, interpolated with username,password + type: string + username: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + required: + - name + type: object + type: array + mysql: + items: + properties: + connection: + description: Connection name e.g. connection://http/google + type: string + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + password: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + query: + type: string + results: + description: Number rows to check for + type: integer + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + url: + description: Connection url, interpolated with username,password + type: string + username: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + required: + - name + type: object + type: array + namespace: + items: + properties: + deadline: + format: int64 + type: integer + deleteTimeout: + format: int64 + type: integer + description: + description: Description for the check + type: string + expectedContent: + type: string + expectedHttpStatuses: + items: + format: int64 + type: integer + type: array + httpRetryInterval: + format: int64 + type: integer + httpTimeout: + format: int64 + type: integer + icon: + description: Icon for overwriting default icon on the dashboard + type: string + ingressHost: + type: string + ingressName: + type: string + ingressTimeout: + format: int64 + type: integer + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + namespaceAnnotations: + additionalProperties: + type: string + type: object + namespaceLabels: + additionalProperties: + type: string + type: object + namespaceNamePrefix: + type: string + path: + type: string + podSpec: + type: string + port: + format: int64 + type: integer + priorityClass: + type: string + readyTimeout: + format: int64 + type: integer + schedule_timeout: + format: int64 + type: integer + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + required: + - name + - podSpec + type: object + type: array + opensearch: + items: + properties: + connection: + description: Connection name e.g. connection://http/google + type: string + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + icon: + description: Icon for overwriting default icon on the dashboard + type: string + index: + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + password: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + query: + type: string + results: + format: int64 + type: integer + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + url: + description: Connection url, interpolated with username,password + type: string + username: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + required: + - index + - name + - query + type: object + type: array + owner: + type: string + pod: + items: + properties: + deadline: + format: int64 + type: integer + deleteTimeout: + format: int64 + type: integer + description: + description: Description for the check + type: string + expectedContent: + type: string + expectedHttpStatuses: + items: + type: integer + type: array + httpRetryInterval: + format: int64 + type: integer + httpTimeout: + format: int64 + type: integer + icon: + description: Icon for overwriting default icon on the dashboard + type: string + ingressClass: + type: string + ingressHost: + type: string + ingressName: + type: string + ingressTimeout: + format: int64 + type: integer + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + namespace: + type: string + path: + type: string + port: + format: int64 + type: integer + priorityClass: + type: string + readyTimeout: + format: int64 + type: integer + roundRobinNodes: + type: boolean + scheduleTimeout: + format: int64 + type: integer + spec: + type: string + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + required: + - name + type: object + type: array + postgres: + items: + properties: + connection: + description: Connection name e.g. connection://http/google + type: string + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + password: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + query: + type: string + results: + description: Number rows to check for + type: integer + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + url: + description: Connection url, interpolated with username,password + type: string + username: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + required: + - name + type: object + type: array + prometheus: + items: + properties: + connection: + description: Connection name e.g. connection://http/google + type: string + description: + description: Description for the check + type: string + display: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + host: + description: 'Deprecated: use `url` instead' + type: string + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + password: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + query: + description: PromQL query + type: string + test: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transform: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + url: + description: Connection url, interpolated with username,password + type: string + username: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + required: + - name + - query + type: object + type: array + redis: + items: + properties: + addr: + description: 'Deprecated: Use url instead' + type: string + connection: + description: Connection name e.g. connection://http/google + type: string + db: + type: integer + description: + description: Description for the check + type: string + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + password: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + url: + description: Connection url, interpolated with username,password + type: string + username: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + required: + - name + type: object + type: array + restic: + items: + properties: + accessKey: + description: AccessKey access key id for connection with aws s3, minio, wasabi, alibaba oss + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + awsConnectionName: + description: Name of the AWS connection used to derive the access key and secret key. + type: string + caCert: + description: CaCert path to the root cert. In case of self-signed certificates + type: string + checkIntegrity: + description: CheckIntegrity when enabled will check the Integrity and consistency of the restic reposiotry + type: boolean + connection: + description: Name of the connection used to derive restic password. + type: string + description: + description: Description for the check + type: string + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + maxAge: + description: MaxAge for backup freshness + type: string + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + password: + description: Password for the restic repository + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + repository: + description: 'Repository The restic repository path eg: rest:https://user:pass@host:8000/ or rest:https://host:8000/ or s3:s3.amazonaws.com/bucket_name' + type: string + secretKey: + description: SecretKey secret access key for connection with aws s3, minio, wasabi, alibaba oss + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + required: + - maxAge + - name + - password + - repository + type: object + type: array + resultMode: + type: string + s3: + items: + properties: + accessKey: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + bucketName: + type: string + connection: + description: ConnectionName of the connection. It'll be used to populate the endpoint, accessKey and secretKey. + type: string + description: + description: Description for the check + type: string + endpoint: + type: string + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + objectPath: + description: glob path to restrict matches to a subset + type: string + region: + type: string + secretKey: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + sessionToken: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + secretKeyRef: + properties: + key: + type: string + name: + type: string + required: + - key + type: object + type: object + type: object + skipTLSVerify: + description: Skip TLS verify when connecting to aws + type: boolean + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + usePathStyle: + description: 'Use path style path: http://s3.amazonaws.com/BUCKET/KEY instead of http://BUCKET.s3.amazonaws.com/KEY' + type: boolean + required: + - name + type: object + type: array + schedule: + description: 'Schedule to run checks on. Supports all cron expression, example: ''30 3-6,20-23 * * *''. For more info about cron expression syntax see https://en.wikipedia.org/wiki/Cron Also supports golang duration, can be set as ''@every 1m30s'' which runs the check every 1 minute and 30 seconds.' + type: string + severity: + type: string + tcp: + items: + properties: + description: + description: Description for the check + type: string + endpoint: + type: string + icon: + description: Icon for overwriting default icon on the dashboard + type: string + labels: + additionalProperties: + type: string + description: Labels for the check + type: object + metrics: + description: Metrics to expose from check results + items: + properties: + labels: + items: + properties: + name: + type: string + value: + type: string + valueExpr: + type: string + required: + - name + type: object + type: array + name: + type: string + type: + type: string + value: + type: string + type: object + type: array + name: + description: Name of the check + type: string + thresholdMillis: + format: int64 + type: integer + transformDeleteStrategy: + description: Transformed checks have a delete strategy on deletion they can either be marked healthy, unhealthy or left as is + type: string + required: + - name + type: object + type: array + type: object + status: + description: CanaryStatus defines the observed state of Canary + properties: + checkStatus: + additionalProperties: + properties: + errorMessage: + type: string + lastCheck: + format: date-time + type: string + lastTransitionedTime: + format: date-time + type: string + latency1h: + description: Average latency to complete all checks + type: string + message: + type: string + uptime1h: + description: Availibility over a rolling 1h period + type: string + type: object + type: object + checks: + additionalProperties: + type: string + description: contains the name and id of the checks associated with the canary + type: object + errorMessage: + type: string + lastCheck: + format: date-time + type: string + lastTransitionedTime: + format: date-time + type: string + latency1h: + description: Average latency to complete all checks + type: string + message: + type: string + observedGeneration: + format: int64 + type: integer + persistedID: + type: string + status: + type: string + uptime1h: + description: Availibility over a rolling 1h period + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} +--- +apiVersion: v1 +kind: Namespace +metadata: + labels: + control-plane: canary-checker + name: canary-checker +--- +apiVersion: v1 +kind: Service +metadata: + labels: + control-plane: canary-checker + name: canary-checker + namespace: canary-checker +spec: + ports: + - port: 8080 + protocol: TCP + targetPort: 8080 + selector: + control-plane: canary-checker +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + control-plane: canary-checker + name: canary-checker + namespace: canary-checker +spec: + replicas: 1 + selector: + matchLabels: + control-plane: canary-checker + template: + metadata: + labels: + control-plane: canary-checker + spec: + containers: + - args: + - operator + - -v + - --httpPort + - "8080" + command: + - /app/canary-checker + env: + - name: DOCKER_API_VERSION + value: "1.39" + image: docker.io/flanksource/canary-checker:latest + livenessProbe: + httpGet: + path: /health + port: 8080 + initialDelaySeconds: 10 + periodSeconds: 5 + name: canary-checker + readinessProbe: + httpGet: + path: /health + port: 8080 + initialDelaySeconds: 10 + periodSeconds: 5 + resources: + limits: + memory: 512Mi + requests: + cpu: 200m + memory: 200Mi + securityContext: + allowPrivilegeEscalation: true + capabilities: + add: + - CAP_NET_RAW + privileged: true + runAsUser: 0 + volumeMounts: + - mountPath: /var/run/docker.sock + name: dockersock + - mountPath: /etc/podinfo + name: podinfo + serviceAccountName: canary-checker-sa + terminationGracePeriodSeconds: 10 + volumes: + - hostPath: + path: /var/run/docker.sock + name: dockersock + - downwardAPI: + items: + - fieldRef: + fieldPath: metadata.labels + path: labels + name: podinfo +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/tls-acme: "true" + name: canary-checker + namespace: canary-checker +spec: + rules: + - host: canary-checker + http: + paths: + - backend: + service: + name: canary-checker + port: + number: 8080 + path: / + pathType: ImplementationSpecific + tls: + - hosts: + - canary-checker + secretName: canary-tls +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + labels: + control-plane: canary-checker + name: canary-checker-monitor + namespace: canary-checker +spec: + endpoints: + - interval: 30s + port: metrics + jobLabel: canary-checker + selector: + matchLabels: + control-plane: canary-checker +--- +apiVersion: scheduling.k8s.io/v1 +description: This priority class should be used for canary pods only. +globalDefault: false +kind: PriorityClass +metadata: + name: canary-checker-priority +value: -1 +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + creationTimestamp: null + name: canary-checker-role +rules: + - apiGroups: + - canaries.flanksource.com + resources: + - canaries + - topologies + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - canaries.flanksource.com + resources: + - canaries/status + - topologies/status + verbs: + - get + - patch + - update + - apiGroups: + - "" + resources: + - pods + - namespaces + - services + verbs: + - '*' + - apiGroups: + - metrics.k8s.io + resources: + - pods + - nodes + verbs: + - '*' + - apiGroups: + - "" + resources: + - pods/exec + - pods/log + verbs: + - '*' + - apiGroups: + - "" + resources: + - nodes + verbs: + - get + - list + - apiGroups: + - extensions + resources: + - ingresses + verbs: + - '*' + - apiGroups: + - networking.k8s.io + resources: + - ingresses + verbs: + - '*' + - apiGroups: + - "" + resources: + - secrets + - configmaps + verbs: + - get + - list + - apiGroups: + - "" + resources: + - events + verbs: + - create + - patch + - apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - create + - update + - patch + - delete + - apiGroups: + - "" + resources: + - configmaps/status + verbs: + - get + - update + - patch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: canary-checker-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: canary-checker-role +subjects: + - kind: ServiceAccount + name: canary-checker-sa + namespace: canary-checker +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + control-plane: canary-checker + name: canary-checker-sa + namespace: canary-checker +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + creationTimestamp: null + name: components.canaries.flanksource.com +spec: + group: canaries.flanksource.com + names: + kind: Component + listKind: ComponentList + plural: components + singular: component + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + checks: + items: + type: object + type: array + components: + description: Create new child components + items: + type: object + type: array + x-kubernetes-preserve-unknown-fields: true + configs: + description: Lookup and associate config items with this component + items: + properties: + id: + items: + type: string + type: array + name: + type: string + namespace: + type: string + tags: + additionalProperties: + type: string + type: object + type: + type: string + type: object + type: array + forEach: + description: Only applies when using lookup, when specified the components and properties specified under ForEach will be templated using the components returned by the lookup ${.properties} can be used to reference the properties of the component ${.component} can be used to reference the component itself + type: object + icon: + type: string + id: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + lifecycle: + description: The lifecycle state of the component e.g. production, staging, dev, etc. + type: string + logs: + description: Logs is a list of logs selector for apm-hub. + items: + properties: + labels: + additionalProperties: + type: string + type: object + name: + type: string + type: + type: string + type: object + type: array + lookup: + description: Lookup component definitions from an external source, use the forEach property to iterate over the results to further enrich each component. + type: object + x-kubernetes-preserve-unknown-fields: true + name: + type: string + order: + type: integer + owner: + type: string + properties: + items: + properties: + color: + type: string + configLookup: + properties: + config: + description: Lookup a config by it + properties: + id: + items: + type: string + type: array + name: + type: string + namespace: + type: string + tags: + additionalProperties: + type: string + type: object + type: + type: string + type: object + display: + description: Apply transformations to the value + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + field: + description: A JSONPath expression to lookup the value in the config + type: string + id: + type: string + type: object + headline: + type: boolean + icon: + type: string + label: + type: string + lastTransition: + type: string + links: + items: + properties: + icon: + type: string + label: + type: string + text: + type: string + tooltip: + type: string + type: + description: e.g. documentation, support, playbook + type: string + url: + type: string + type: object + type: array + lookup: + description: CanarySpec defines the desired state of Canary + type: object + x-kubernetes-preserve-unknown-fields: true + max: + format: int64 + type: integer + min: + format: int64 + type: integer + name: + type: string + order: + type: integer + status: + type: string + summary: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + text: + type: string + tooltip: + type: string + type: + type: string + unit: + description: e.g. milliseconds, bytes, millicores, epoch etc. + type: string + value: + format: int64 + type: integer + type: object + type: array + x-kubernetes-preserve-unknown-fields: true + relationships: + items: + properties: + ref: + type: string + type: + description: The type of relationship, e.g. dependsOn, subcomponentOf, providesApis, consumesApis + type: string + type: object + type: array + selectors: + description: Lookup and associcate other components with this component + items: + properties: + fieldSelector: + type: string + labelSelector: + type: string + name: + type: string + type: object + type: array + summary: + properties: + healthy: + type: integer + incidents: + additionalProperties: + additionalProperties: + type: integer + type: object + type: object + info: + type: integer + insights: + additionalProperties: + additionalProperties: + type: integer + type: object + type: object + unhealthy: + type: integer + warning: + type: integer + type: object + tooltip: + type: string + type: + description: The type of component, e.g. service, API, website, library, database, etc. + type: string + type: object + status: + properties: + status: + type: string + type: object + type: object + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + creationTimestamp: null + name: topologies.canaries.flanksource.com +spec: + group: canaries.flanksource.com + names: + kind: Topology + listKind: TopologyList + plural: topologies + singular: topology + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + components: + items: + properties: + checks: + items: + properties: + inline: + description: CanarySpec defines the desired state of Canary + type: object + x-kubernetes-preserve-unknown-fields: true + selector: + properties: + fieldSelector: + type: string + labelSelector: + type: string + name: + type: string + type: object + type: object + type: array + components: + description: Create new child components + items: + type: object + type: array + x-kubernetes-preserve-unknown-fields: true + configs: + description: Lookup and associate config items with this component + items: + properties: + id: + items: + type: string + type: array + name: + type: string + namespace: + type: string + tags: + additionalProperties: + type: string + type: object + type: + type: string + type: object + type: array + forEach: + description: Only applies when using lookup, when specified the components and properties specified under ForEach will be templated using the components returned by the lookup ${.properties} can be used to reference the properties of the component ${.component} can be used to reference the component itself + type: object + icon: + type: string + id: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + lifecycle: + description: The lifecycle state of the component e.g. production, staging, dev, etc. + type: string + logs: + description: Logs is a list of logs selector for apm-hub. + items: + properties: + labels: + additionalProperties: + type: string + type: object + name: + type: string + type: + type: string + type: object + type: array + lookup: + description: Lookup component definitions from an external source, use the forEach property to iterate over the results to further enrich each component. + type: object + x-kubernetes-preserve-unknown-fields: true + name: + type: string + order: + type: integer + owner: + type: string + properties: + items: + properties: + color: + type: string + configLookup: + properties: + config: + description: Lookup a config by it + properties: + id: + items: + type: string + type: array + name: + type: string + namespace: + type: string + tags: + additionalProperties: + type: string + type: object + type: + type: string + type: object + display: + description: Apply transformations to the value + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + field: + description: A JSONPath expression to lookup the value in the config + type: string + id: + type: string + type: object + headline: + type: boolean + icon: + type: string + label: + type: string + lastTransition: + type: string + links: + items: + properties: + icon: + type: string + label: + type: string + text: + type: string + tooltip: + type: string + type: + description: e.g. documentation, support, playbook + type: string + url: + type: string + type: object + type: array + lookup: + description: CanarySpec defines the desired state of Canary + type: object + x-kubernetes-preserve-unknown-fields: true + max: + format: int64 + type: integer + min: + format: int64 + type: integer + name: + type: string + order: + type: integer + status: + type: string + summary: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + text: + type: string + tooltip: + type: string + type: + type: string + unit: + description: e.g. milliseconds, bytes, millicores, epoch etc. + type: string + value: + format: int64 + type: integer + type: object + type: array + x-kubernetes-preserve-unknown-fields: true + relationships: + items: + properties: + ref: + type: string + type: + description: The type of relationship, e.g. dependsOn, subcomponentOf, providesApis, consumesApis + type: string + type: object + type: array + selectors: + description: Lookup and associcate other components with this component + items: + properties: + fieldSelector: + type: string + labelSelector: + type: string + name: + type: string + type: object + type: array + summary: + properties: + healthy: + type: integer + incidents: + additionalProperties: + additionalProperties: + type: integer + type: object + type: object + info: + type: integer + insights: + additionalProperties: + additionalProperties: + type: integer + type: object + type: object + unhealthy: + type: integer + warning: + type: integer + type: object + tooltip: + type: string + type: + description: The type of component, e.g. service, API, website, library, database, etc. + type: string + type: object + type: array + configs: + description: Lookup and associate config items with this component + items: + properties: + id: + items: + type: string + type: array + name: + type: string + namespace: + type: string + tags: + additionalProperties: + type: string + type: object + type: + type: string + type: object + type: array + icon: + type: string + id: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + label: + type: string + owner: + type: string + properties: + description: Properties are created once the full component tree is created, property lookup functions can return a map of coomponent name => properties to allow for bulk property lookups being applied to multiple components in the tree + items: + properties: + color: + type: string + configLookup: + properties: + config: + description: Lookup a config by it + properties: + id: + items: + type: string + type: array + name: + type: string + namespace: + type: string + tags: + additionalProperties: + type: string + type: object + type: + type: string + type: object + display: + description: Apply transformations to the value + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + field: + description: A JSONPath expression to lookup the value in the config + type: string + id: + type: string + type: object + headline: + type: boolean + icon: + type: string + label: + type: string + lastTransition: + type: string + links: + items: + properties: + icon: + type: string + label: + type: string + text: + type: string + tooltip: + type: string + type: + description: e.g. documentation, support, playbook + type: string + url: + type: string + type: object + type: array + lookup: + description: CanarySpec defines the desired state of Canary + type: object + x-kubernetes-preserve-unknown-fields: true + max: + format: int64 + type: integer + min: + format: int64 + type: integer + name: + type: string + order: + type: integer + status: + type: string + summary: + properties: + expr: + type: string + javascript: + type: string + jsonPath: + type: string + template: + type: string + type: object + text: + type: string + tooltip: + type: string + type: + type: string + unit: + description: e.g. milliseconds, bytes, millicores, epoch etc. + type: string + value: + format: int64 + type: integer + type: object + type: array + schedule: + type: string + text: + type: string + tooltip: + type: string + type: + type: string + type: object + status: + properties: + observedGeneration: + format: int64 + type: integer + persistentID: + type: string + status: + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/fixtures/minimal/http-check-labels.yaml b/fixtures/minimal/http-check-labels.yaml index 01c1975f5..c92fe7124 100644 --- a/fixtures/minimal/http-check-labels.yaml +++ b/fixtures/minimal/http-check-labels.yaml @@ -13,7 +13,6 @@ spec: check: http-200 responseCodes: [201, 200, 301] responseContent: "" - maxSSLExpiry: 7 - endpoint: http://status.savanttools.com/?code=202 name: http-pass-multiple labels: From 6fe6095294375de0b3856a0801e884ef581e4ba5 Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Tue, 17 Oct 2023 10:33:11 +0545 Subject: [PATCH 6/7] feat: oauth2 support --- api/v1/checks.go | 7 +++ api/v1/zz_generated.deepcopy.go | 25 +++++++++++ checks/http.go | 8 ++-- config/deploy/crd.yaml | 3 ++ config/deploy/manifests.yaml | 3 ++ config/schemas/canary.schema.json | 22 ++++++++++ config/schemas/component.schema.json | 22 ++++++++++ config/schemas/health_http.schema.json | 22 ++++++++++ config/schemas/topology.schema.json | 22 ++++++++++ go.mod | 16 +++---- go.sum | 59 +++++++------------------- hack/generate-schemas/go.mod | 14 +++--- hack/generate-schemas/go.sum | 28 ++++++------ 13 files changed, 175 insertions(+), 76 deletions(-) diff --git a/api/v1/checks.go b/api/v1/checks.go index f88185f4a..51b8cda5d 100644 --- a/api/v1/checks.go +++ b/api/v1/checks.go @@ -55,6 +55,11 @@ func (c Check) GetLabels() map[string]string { return c.Labels } +type Oauth2Config struct { + Scopes []string + TokenURL string +} + type HTTPCheck struct { Description `yaml:",inline" json:",inline"` Templatable `yaml:",inline" json:",inline"` @@ -87,6 +92,8 @@ type HTTPCheck struct { TemplateBody bool `yaml:"templateBody,omitempty" json:"templateBody,omitempty"` // EnvVars are the environment variables that are accesible to templated body EnvVars []types.EnvVar `yaml:"env,omitempty" json:"env,omitempty"` + // Oauth2 Configuration. The client ID & Client secret should go to username & password respectively. + Oauth2 *Oauth2Config `yaml:"oauth2,omitempty" json:"oauth2,omitempty"` } func (c HTTPCheck) GetType() string { diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index 7462b1671..aa828e78e 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -1910,6 +1910,11 @@ func (in *HTTPCheck) DeepCopyInto(out *HTTPCheck) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.Oauth2 != nil { + in, out := &in.Oauth2, &out.Oauth2 + *out = new(Oauth2Config) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPCheck. @@ -2350,6 +2355,26 @@ func (in *NamespaceSelector) DeepCopy() *NamespaceSelector { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Oauth2Config) DeepCopyInto(out *Oauth2Config) { + *out = *in + if in.Scopes != nil { + in, out := &in.Scopes, &out.Scopes + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Oauth2Config. +func (in *Oauth2Config) DeepCopy() *Oauth2Config { + if in == nil { + return nil + } + out := new(Oauth2Config) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OpenSearchCheck) DeepCopyInto(out *OpenSearchCheck) { *out = *in diff --git a/checks/http.go b/checks/http.go index 406498882..45606ea63 100644 --- a/checks/http.go +++ b/checks/http.go @@ -10,7 +10,6 @@ import ( "github.com/PaesslerAG/jsonpath" "github.com/flanksource/canary-checker/api/context" "github.com/flanksource/commons/http" - "github.com/flanksource/commons/http/middlewares" "github.com/flanksource/duty/models" gomplate "github.com/flanksource/gomplate/v3" @@ -79,6 +78,10 @@ func (c *HTTPChecker) generateHTTPRequest(ctx *context.Context, check v1.HTTPChe client.Auth(connection.Username, connection.Password) } + if check.Oauth2 != nil { + client.OAuth(connection.Username, connection.Password, check.Oauth2.TokenURL, check.Oauth2.Scopes...) + } + client.NTLM(check.NTLM) client.NTLMV2(check.NTLMv2) @@ -88,8 +91,7 @@ func (c *HTTPChecker) generateHTTPRequest(ctx *context.Context, check v1.HTTPChe // TODO: Add finer controls over tracing to the canary if ctx.IsTrace() { - tracedTransport := middlewares.NewTracedTransport().TraceAll(true).MaxBodyLength(512) - client.Use(tracedTransport.RoundTripper) + client.Trace(http.TraceConfig{MaxBodyLength: 512, Body: true, Headers: true, ResponseHeaders: true}) } return client.R(ctx), nil diff --git a/config/deploy/crd.yaml b/config/deploy/crd.yaml index 72bb72893..82e4c779c 100644 --- a/config/deploy/crd.yaml +++ b/config/deploy/crd.yaml @@ -3161,6 +3161,9 @@ spec: ntlmv2: description: NTLM when set to true will do authentication using NTLM v2 protocol type: boolean + oauth2: + description: Oauth2 Configuration. The client ID & Client secret should go to username & password respectively. + type: object password: properties: name: diff --git a/config/deploy/manifests.yaml b/config/deploy/manifests.yaml index 62ef79ce9..75de024a6 100644 --- a/config/deploy/manifests.yaml +++ b/config/deploy/manifests.yaml @@ -3161,6 +3161,9 @@ spec: ntlmv2: description: NTLM when set to true will do authentication using NTLM v2 protocol type: boolean + oauth2: + description: Oauth2 Configuration. The client ID & Client secret should go to username & password respectively. + type: object password: properties: name: diff --git a/config/schemas/canary.schema.json b/config/schemas/canary.schema.json index a97c3a5f6..6b6f9e23b 100644 --- a/config/schemas/canary.schema.json +++ b/config/schemas/canary.schema.json @@ -1703,6 +1703,9 @@ "$ref": "#/$defs/EnvVar" }, "type": "array" + }, + "oauth2": { + "$ref": "#/$defs/Oauth2Config" } }, "additionalProperties": false, @@ -2364,6 +2367,25 @@ "podSpec" ] }, + "Oauth2Config": { + "properties": { + "Scopes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "TokenURL": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "Scopes", + "TokenURL" + ] + }, "ObjectFieldSelector": { "properties": { "apiVersion": { diff --git a/config/schemas/component.schema.json b/config/schemas/component.schema.json index 7ce05b377..56d4ede43 100644 --- a/config/schemas/component.schema.json +++ b/config/schemas/component.schema.json @@ -1915,6 +1915,9 @@ "$ref": "#/$defs/EnvVar" }, "type": "array" + }, + "oauth2": { + "$ref": "#/$defs/Oauth2Config" } }, "additionalProperties": false, @@ -2626,6 +2629,25 @@ "podSpec" ] }, + "Oauth2Config": { + "properties": { + "Scopes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "TokenURL": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "Scopes", + "TokenURL" + ] + }, "ObjectFieldSelector": { "properties": { "apiVersion": { diff --git a/config/schemas/health_http.schema.json b/config/schemas/health_http.schema.json index fcc39e87e..92baba1b0 100644 --- a/config/schemas/health_http.schema.json +++ b/config/schemas/health_http.schema.json @@ -139,6 +139,9 @@ "$ref": "#/$defs/EnvVar" }, "type": "array" + }, + "oauth2": { + "$ref": "#/$defs/Oauth2Config" } }, "additionalProperties": false, @@ -213,6 +216,25 @@ "additionalProperties": false, "type": "object" }, + "Oauth2Config": { + "properties": { + "Scopes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "TokenURL": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "Scopes", + "TokenURL" + ] + }, "SecretKeySelector": { "properties": { "name": { diff --git a/config/schemas/topology.schema.json b/config/schemas/topology.schema.json index 6d945f0b9..a96a352a5 100644 --- a/config/schemas/topology.schema.json +++ b/config/schemas/topology.schema.json @@ -1885,6 +1885,9 @@ "$ref": "#/$defs/EnvVar" }, "type": "array" + }, + "oauth2": { + "$ref": "#/$defs/Oauth2Config" } }, "additionalProperties": false, @@ -2596,6 +2599,25 @@ "podSpec" ] }, + "Oauth2Config": { + "properties": { + "Scopes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "TokenURL": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "Scopes", + "TokenURL" + ] + }, "ObjectFieldSelector": { "properties": { "apiVersion": { diff --git a/go.mod b/go.mod index 5e71917b9..4598e39e3 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/eko/gocache/store/bigcache/v4 v4.2.1 github.com/elastic/go-elasticsearch/v8 v8.10.0 github.com/fergusstrange/embedded-postgres v1.24.0 - github.com/flanksource/commons v1.14.1 + github.com/flanksource/commons v1.15.0 github.com/flanksource/duty v1.0.191 github.com/flanksource/gomplate/v3 v3.20.18 github.com/flanksource/is-healthy v0.0.0-20231003215854-76c51e3a3ff7 @@ -62,14 +62,12 @@ require ( github.com/sevennt/echo-pprof v0.1.1-0.20220616082843-66a461746b5f github.com/spf13/cobra v1.7.0 github.com/spf13/pflag v1.0.5 - github.com/vadimi/go-http-ntlm v1.0.3 - github.com/vadimi/go-http-ntlm/v2 v2.4.1 go.mongodb.org/mongo-driver v1.12.1 golang.org/x/crypto v0.14.0 golang.org/x/net v0.17.0 golang.org/x/sync v0.4.0 google.golang.org/api v0.147.0 - google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a + google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b gopkg.in/flanksource/yaml.v3 v3.2.3 gorm.io/gorm v1.25.4 gorm.io/plugin/prometheus v0.0.0-20230504115745-1aec2356381b @@ -97,7 +95,7 @@ require ( github.com/antonmedv/expr v1.15.3 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect - github.com/aws/aws-sdk-go v1.45.25 // indirect + github.com/aws/aws-sdk-go v1.45.26 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.13 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 // indirect @@ -183,7 +181,7 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.0 // indirect + github.com/klauspost/compress v1.17.1 // indirect github.com/kr/fs v0.1.0 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect @@ -218,6 +216,8 @@ require ( github.com/tidwall/pretty v1.2.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect github.com/ulikunitz/xz v0.5.11 // indirect + github.com/vadimi/go-http-ntlm v1.0.3 // indirect + github.com/vadimi/go-http-ntlm/v2 v2.4.1 // indirect github.com/vadimi/go-ntlm v1.2.1 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect @@ -249,8 +249,8 @@ require ( golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect google.golang.org/grpc v1.58.3 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index 087973658..a41ee9728 100644 --- a/go.sum +++ b/go.sum @@ -175,8 +175,6 @@ cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvj cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= -cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= -cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute v1.23.1 h1:V97tBoDaZHb6leicZ1G6DLK2BAaZLJ/7+9BB/En3hR0= cloud.google.com/go/compute v1.23.1/go.mod h1:CqB3xpmPKKt3OJpW2ndFIXnA9A4xAy/F3Xp1ixncW78= cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= @@ -317,8 +315,6 @@ cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGE cloud.google.com/go/iam v0.11.0/go.mod h1:9PiLDanza5D+oWFZiH1uG+RnRCfEGKoyl6yo4cgWZGY= cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= -cloud.google.com/go/iam v1.1.2 h1:gacbrBdWcoVmGLozRuStX45YKvJtzIjJdAolzUs1sm4= -cloud.google.com/go/iam v1.1.2/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= cloud.google.com/go/iam v1.1.3 h1:18tKG7DzydKWUnLjonWcJO6wjSCAtzh4GcRKlH/Hrzc= cloud.google.com/go/iam v1.1.3/go.mod h1:3khUlaBXfPKKe7huYgEpDn6FtgRyMEqbkvBxrQyY5SE= cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= @@ -678,10 +674,8 @@ github.com/asecurityteam/rolling v2.0.4+incompatible h1:WOSeokINZT0IDzYGc5BVcjLl github.com/asecurityteam/rolling v2.0.4+incompatible/go.mod h1:2D4ba5ZfYCWrIMleUgTvc8pmLExEuvu3PDwl+vnG58Q= github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go v1.44.263/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go v1.45.23 h1:0xRQw5fsFMpisaliDZ8iUZtw9w+3YjY9/UwUGRbB/i4= -github.com/aws/aws-sdk-go v1.45.23/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go v1.45.25 h1:c4fLlh5sLdK2DCRTY1z0hyuJZU4ygxX8m1FswL6/nF4= -github.com/aws/aws-sdk-go v1.45.25/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.45.26 h1:PJ2NJNY5N/yeobLYe1Y+xLdavBi67ZI8gvph6ftwVCg= +github.com/aws/aws-sdk-go v1.45.26/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.21.0 h1:gMT0IW+03wtYJhRqTVYn0wLzwdnK9sRMcxmtfGzRdJc= github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M= @@ -825,10 +819,8 @@ github.com/evanphx/json-patch/v5 v5.7.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fergusstrange/embedded-postgres v1.24.0 h1:WqXbmYrBeT5JfNWQ8Qa+yHa5YJO/0sBIgL9k5rn3dFk= github.com/fergusstrange/embedded-postgres v1.24.0/go.mod h1:wL562t1V+iuFwq0UcgMi2e9rp8CROY9wxWZEfP8Y874= -github.com/flanksource/commons v1.12.0 h1:8B7+AbRbWH3KVFwbmXYkG3gS42pF+uVaF4lAgDY+ZJA= -github.com/flanksource/commons v1.12.0/go.mod h1:zYEhi6E2+diQ+loVcROUHo/Bgv+Tn61W2NYmrb5MgVI= -github.com/flanksource/commons v1.14.1 h1:gvMDVec0V7h1UMQxKe2lanFYIAbs6yMG7TbKEhFmMuE= -github.com/flanksource/commons v1.14.1/go.mod h1:v0BQANvjQ6gSz/3XVYsNxJOeHtxFa5JpZSdY+GjOT0c= +github.com/flanksource/commons v1.15.0 h1:p74hrKzIz0r3H8YN3CuB8ePJOjzPFO0BRLVmpXmeqvY= +github.com/flanksource/commons v1.15.0/go.mod h1:FMZFLcQr98JwBKuKLs44DvCQ2JNoHz5maRIzVufQ9Cs= github.com/flanksource/duty v1.0.191 h1:acnvyTeQlfqmtyXxWprNFGK/vBTUlqkYwxEPLtXSPrk= github.com/flanksource/duty v1.0.191/go.mod h1:ikyl/TcRy6Cc0R5b0wEHT7CecV7gyJvrDGq/4oIZHoc= github.com/flanksource/gomplate/v3 v3.20.4/go.mod h1:27BNWhzzSjDed1z8YShO6W+z6G9oZXuxfNFGd/iGSdc= @@ -1050,7 +1042,6 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/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-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -1132,8 +1123,6 @@ github.com/hairyhenderson/yaml v0.0.0-20220618171115-2d35fca545ce h1:cVkYhlWAxwu github.com/hairyhenderson/yaml v0.0.0-20220618171115-2d35fca545ce/go.mod h1:7TyiGlHI+IO+iJbqRZ82QbFtvgj/AIcFm5qc9DLn7Kc= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.2 h1:uJDtyXwEfalmp1PqdxuhZqrNkUyClZAhVeZYTArbqkg= -github.com/hashicorp/go-getter v1.7.2/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-getter v1.7.3 h1:bN2+Fw9XPFvOCjB0UOevFIMICZ7G2XSQHzfvLUyOM5E= github.com/hashicorp/go-getter v1.7.3/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -1207,8 +1196,8 @@ github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= -github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.1 h1:NE3C767s2ak2bweCZo3+rdP4U/HoyVXLv/X9f2gPS5g= +github.com/klauspost/compress v1.17.1/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= 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.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -1546,7 +1535,7 @@ go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= -go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= +go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= @@ -1598,8 +1587,6 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA= golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= -golang.org/x/exp v0.0.0-20231005195138-3e424a577f31 h1:9k5exFQKQglLo+RoP+4zMjOFE14P6+vyR0baDAi0Rcs= -golang.org/x/exp v0.0.0-20231005195138-3e424a577f31/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= @@ -1646,7 +1633,7 @@ golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= 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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1714,8 +1701,6 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= -golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1747,8 +1732,6 @@ golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= -golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= -golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1990,8 +1973,7 @@ golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= 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= @@ -2000,7 +1982,6 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= @@ -2071,8 +2052,6 @@ google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/ google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0fdw0= google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= -google.golang.org/api v0.145.0 h1:kBjvf1A3/m30kUvnUX9jZJxTu3lJrpGFt5V/1YZrjwg= -google.golang.org/api v0.145.0/go.mod h1:OARJqIfoYjXJj4C1AiBSXYZt03qsoz8FQYU6fBEfrHM= google.golang.org/api v0.147.0 h1:Can3FaQo9LlVqxJCodNmeZW/ib3/qKAY3rFeXiHo5gc= google.golang.org/api v0.147.0/go.mod h1:pQ/9j83DcmPd/5C9e2nFOdjjNkDZ1G+zkbK2uvdkJMs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -2218,22 +2197,16 @@ google.golang.org/genproto v0.0.0-20230323212658-478b75c54725/go.mod h1:UUQDJDOl google.golang.org/genproto v0.0.0-20230330154414-c0448cd141ea/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 h1:SeZZZx0cP0fqUyA+oRzP9k7cSwJlvDFiROO72uwD6i0= -google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97/go.mod h1:t1VqOqqvce95G3hIDCT5FeO3YUc6Q4Oe24L/+rNMxRk= -google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a h1:fwgW9j3vHirt4ObdHoYNwuO24BEZjSzbh+zPaNWoiY8= -google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:EMfReVxb80Dq1hhioy0sOsY9jCE46YDgHlJ7fWVUWRE= +google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b h1:+YaDE2r2OG8t/z5qmsh7Y+XXwCbvadxxZ0YY6mTdrVA= +google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI= google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU= -google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0= -google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a h1:myvhA4is3vrit1a6NZCWBIwN0kNEnX21DJOJX/NvIfI= -google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:SUBoKXbI1Efip18FClrQVGjWcyd0QZd8KkvdP34t7ww= +google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b h1:CIC2YMXmIhYw6evmhPxBKJ4fmLbOFtXQN/GV3XOZR8k= +google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234015-3fc162c6f38a/go.mod h1:xURIpW9ES5+/GZhnV6beoEtxQrnkRGIfP5VQG2tCBLc= google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a h1:a2MQQVoTo96JC9PMGtGBymLp7+/RzpFc2yX/9WfFg1c= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc= 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= @@ -2273,8 +2246,6 @@ google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCD google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= -google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I= -google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= diff --git a/hack/generate-schemas/go.mod b/hack/generate-schemas/go.mod index d68b81d8f..5daa8f78b 100644 --- a/hack/generate-schemas/go.mod +++ b/hack/generate-schemas/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/flanksource/canary-checker v1.0.0 - github.com/flanksource/commons v1.14.1 + github.com/flanksource/commons v1.15.0 github.com/invopop/jsonschema v0.7.0 github.com/spf13/cobra v1.7.0 ) @@ -13,13 +13,13 @@ require ( cloud.google.com/go/compute v1.23.1 // indirect cloud.google.com/go/iam v1.1.3 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect - github.com/flanksource/gomplate/v3 v3.20.16 // indirect + github.com/flanksource/gomplate/v3 v3.20.18 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.1 // indirect github.com/gosimple/unidecode v1.0.1 // indirect github.com/hairyhenderson/yaml v0.0.0-20220618171115-2d35fca545ce // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/klauspost/compress v1.17.0 // indirect + github.com/klauspost/compress v1.17.1 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect @@ -36,7 +36,7 @@ require ( github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect github.com/antonmedv/expr v1.15.3 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect - github.com/aws/aws-sdk-go v1.45.25 // indirect + github.com/aws/aws-sdk-go v1.45.26 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -118,9 +118,9 @@ require ( golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect google.golang.org/api v0.147.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a // indirect + google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect google.golang.org/grpc v1.58.3 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/flanksource/yaml.v3 v3.2.3 // indirect diff --git a/hack/generate-schemas/go.sum b/hack/generate-schemas/go.sum index 397a674a2..041eb2c5d 100644 --- a/hack/generate-schemas/go.sum +++ b/hack/generate-schemas/go.sum @@ -637,8 +637,8 @@ github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmms github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go v1.45.25 h1:c4fLlh5sLdK2DCRTY1z0hyuJZU4ygxX8m1FswL6/nF4= -github.com/aws/aws-sdk-go v1.45.25/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.45.26 h1:PJ2NJNY5N/yeobLYe1Y+xLdavBi67ZI8gvph6ftwVCg= +github.com/aws/aws-sdk-go v1.45.26/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= @@ -701,13 +701,13 @@ github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQL github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fergusstrange/embedded-postgres v1.24.0 h1:WqXbmYrBeT5JfNWQ8Qa+yHa5YJO/0sBIgL9k5rn3dFk= -github.com/flanksource/commons v1.14.1 h1:gvMDVec0V7h1UMQxKe2lanFYIAbs6yMG7TbKEhFmMuE= -github.com/flanksource/commons v1.14.1/go.mod h1:v0BQANvjQ6gSz/3XVYsNxJOeHtxFa5JpZSdY+GjOT0c= +github.com/flanksource/commons v1.15.0 h1:p74hrKzIz0r3H8YN3CuB8ePJOjzPFO0BRLVmpXmeqvY= +github.com/flanksource/commons v1.15.0/go.mod h1:FMZFLcQr98JwBKuKLs44DvCQ2JNoHz5maRIzVufQ9Cs= github.com/flanksource/duty v1.0.191 h1:acnvyTeQlfqmtyXxWprNFGK/vBTUlqkYwxEPLtXSPrk= github.com/flanksource/duty v1.0.191/go.mod h1:ikyl/TcRy6Cc0R5b0wEHT7CecV7gyJvrDGq/4oIZHoc= github.com/flanksource/gomplate/v3 v3.20.4/go.mod h1:27BNWhzzSjDed1z8YShO6W+z6G9oZXuxfNFGd/iGSdc= -github.com/flanksource/gomplate/v3 v3.20.16 h1:Bfn+nbD0iK0iGQcu6alV8Nr7O5+KpeDo8OD9WOu831Q= -github.com/flanksource/gomplate/v3 v3.20.16/go.mod h1:2GgHZ2vWmtDspJMBfUIryOuzJSwc8jU7Kw9fDLr0TMA= +github.com/flanksource/gomplate/v3 v3.20.18 h1:qYiznMxhq+Zau5iWnVzW1yDzA1deHOsmo6yldCN7JhQ= +github.com/flanksource/gomplate/v3 v3.20.18/go.mod h1:2GgHZ2vWmtDspJMBfUIryOuzJSwc8jU7Kw9fDLr0TMA= github.com/flanksource/is-healthy v0.0.0-20230705092916-3b4cf510c5fc/go.mod h1:4pQhmF+TnVqJroQKY8wSnSp+T18oLson6YQ2M0qPHfQ= github.com/flanksource/is-healthy v0.0.0-20231003215854-76c51e3a3ff7 h1:s6jf6P1pRfdvksVFjIXFRfnimvEYUR0/Mmla1EIjiRM= github.com/flanksource/is-healthy v0.0.0-20231003215854-76c51e3a3ff7/go.mod h1:BH5gh9JyEAuuWVP6Q5y9h43VozS0RfKyjNpM9L4v4hw= @@ -952,8 +952,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= -github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.1 h1:NE3C767s2ak2bweCZo3+rdP4U/HoyVXLv/X9f2gPS5g= +github.com/klauspost/compress v1.17.1/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -1739,16 +1739,16 @@ google.golang.org/genproto v0.0.0-20230323212658-478b75c54725/go.mod h1:UUQDJDOl google.golang.org/genproto v0.0.0-20230330154414-c0448cd141ea/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a h1:fwgW9j3vHirt4ObdHoYNwuO24BEZjSzbh+zPaNWoiY8= -google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:EMfReVxb80Dq1hhioy0sOsY9jCE46YDgHlJ7fWVUWRE= +google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b h1:+YaDE2r2OG8t/z5qmsh7Y+XXwCbvadxxZ0YY6mTdrVA= +google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI= google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a h1:myvhA4is3vrit1a6NZCWBIwN0kNEnX21DJOJX/NvIfI= -google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:SUBoKXbI1Efip18FClrQVGjWcyd0QZd8KkvdP34t7ww= +google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b h1:CIC2YMXmIhYw6evmhPxBKJ4fmLbOFtXQN/GV3XOZR8k= +google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234015-3fc162c6f38a/go.mod h1:xURIpW9ES5+/GZhnV6beoEtxQrnkRGIfP5VQG2tCBLc= google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a h1:a2MQQVoTo96JC9PMGtGBymLp7+/RzpFc2yX/9WfFg1c= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc= 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= From 8278f04f40a28394b1234e2fd381bc448a3ce6a7 Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Tue, 17 Oct 2023 14:55:11 +0545 Subject: [PATCH 7/7] chore: make resources --- api/v1/checks.go | 4 ++-- config/deploy/crd.yaml | 7 +++++++ config/deploy/manifests.yaml | 7 +++++++ config/schemas/canary.schema.json | 10 +++------- config/schemas/component.schema.json | 10 +++------- config/schemas/health_http.schema.json | 10 +++------- config/schemas/topology.schema.json | 10 +++------- 7 files changed, 28 insertions(+), 30 deletions(-) diff --git a/api/v1/checks.go b/api/v1/checks.go index 51b8cda5d..5e4db0a0c 100644 --- a/api/v1/checks.go +++ b/api/v1/checks.go @@ -56,8 +56,8 @@ func (c Check) GetLabels() map[string]string { } type Oauth2Config struct { - Scopes []string - TokenURL string + Scopes []string `json:"scope,omitempty" yaml:"scope,omitempty"` + TokenURL string `json:"tokenURL,omitempty" yaml:"tokenURL,omitempty"` } type HTTPCheck struct { diff --git a/config/deploy/crd.yaml b/config/deploy/crd.yaml index 82e4c779c..8211b31c5 100644 --- a/config/deploy/crd.yaml +++ b/config/deploy/crd.yaml @@ -3163,6 +3163,13 @@ spec: type: boolean oauth2: description: Oauth2 Configuration. The client ID & Client secret should go to username & password respectively. + properties: + scope: + items: + type: string + type: array + tokenURL: + type: string type: object password: properties: diff --git a/config/deploy/manifests.yaml b/config/deploy/manifests.yaml index 75de024a6..228a51f38 100644 --- a/config/deploy/manifests.yaml +++ b/config/deploy/manifests.yaml @@ -3163,6 +3163,13 @@ spec: type: boolean oauth2: description: Oauth2 Configuration. The client ID & Client secret should go to username & password respectively. + properties: + scope: + items: + type: string + type: array + tokenURL: + type: string type: object password: properties: diff --git a/config/schemas/canary.schema.json b/config/schemas/canary.schema.json index 6b6f9e23b..f380d963e 100644 --- a/config/schemas/canary.schema.json +++ b/config/schemas/canary.schema.json @@ -2369,22 +2369,18 @@ }, "Oauth2Config": { "properties": { - "Scopes": { + "scope": { "items": { "type": "string" }, "type": "array" }, - "TokenURL": { + "tokenURL": { "type": "string" } }, "additionalProperties": false, - "type": "object", - "required": [ - "Scopes", - "TokenURL" - ] + "type": "object" }, "ObjectFieldSelector": { "properties": { diff --git a/config/schemas/component.schema.json b/config/schemas/component.schema.json index 56d4ede43..c5f40cf4f 100644 --- a/config/schemas/component.schema.json +++ b/config/schemas/component.schema.json @@ -2631,22 +2631,18 @@ }, "Oauth2Config": { "properties": { - "Scopes": { + "scope": { "items": { "type": "string" }, "type": "array" }, - "TokenURL": { + "tokenURL": { "type": "string" } }, "additionalProperties": false, - "type": "object", - "required": [ - "Scopes", - "TokenURL" - ] + "type": "object" }, "ObjectFieldSelector": { "properties": { diff --git a/config/schemas/health_http.schema.json b/config/schemas/health_http.schema.json index 92baba1b0..6d4ad7988 100644 --- a/config/schemas/health_http.schema.json +++ b/config/schemas/health_http.schema.json @@ -218,22 +218,18 @@ }, "Oauth2Config": { "properties": { - "Scopes": { + "scope": { "items": { "type": "string" }, "type": "array" }, - "TokenURL": { + "tokenURL": { "type": "string" } }, "additionalProperties": false, - "type": "object", - "required": [ - "Scopes", - "TokenURL" - ] + "type": "object" }, "SecretKeySelector": { "properties": { diff --git a/config/schemas/topology.schema.json b/config/schemas/topology.schema.json index a96a352a5..dca59a7db 100644 --- a/config/schemas/topology.schema.json +++ b/config/schemas/topology.schema.json @@ -2601,22 +2601,18 @@ }, "Oauth2Config": { "properties": { - "Scopes": { + "scope": { "items": { "type": "string" }, "type": "array" }, - "TokenURL": { + "tokenURL": { "type": "string" } }, "additionalProperties": false, - "type": "object", - "required": [ - "Scopes", - "TokenURL" - ] + "type": "object" }, "ObjectFieldSelector": { "properties": {