From 47dd03823b44680cc273b5fabc6a50c07462d67e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 03:51:22 +0000 Subject: [PATCH 01/33] build(deps): bump github.com/steadybit/action-kit/go/action_kit_api/v2 Bumps [github.com/steadybit/action-kit/go/action_kit_api/v2](https://github.com/steadybit/action-kit) from 2.9.3 to 2.9.4. - [Commits](https://github.com/steadybit/action-kit/compare/go/action_kit_api/v2.9.3...go/action_kit_api/v2.9.4) --- updated-dependencies: - dependency-name: github.com/steadybit/action-kit/go/action_kit_api/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 7ac4474..c38226d 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/google/uuid v1.6.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/rs/zerolog v1.33.0 - github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.3 + github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.4 github.com/steadybit/action-kit/go/action_kit_sdk v1.1.12 github.com/steadybit/action-kit/go/action_kit_test v1.3.0 github.com/steadybit/extension-kit v1.8.18 diff --git a/go.sum b/go.sum index 96575f8..ebcdf35 100644 --- a/go.sum +++ b/go.sum @@ -151,8 +151,8 @@ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= -github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.3 h1:NUFdSLNJ0WiO8azy0KdiFZgSARzaNL0g4ek6cN2lATs= -github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.3/go.mod h1:ycF2RLgRsB8I/jD52aE+dKZKVru1GIEtmkcRcIR3vXk= +github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.4 h1:imlfn0m5FEwZ3/ad75TgI5DoGQD4ztnSoLfPR4afqUY= +github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.4/go.mod h1:ycF2RLgRsB8I/jD52aE+dKZKVru1GIEtmkcRcIR3vXk= github.com/steadybit/action-kit/go/action_kit_sdk v1.1.12 h1:qHgEHBbp83QxVoS9UuBc9EDbBkAyF8UWhDG0/VwoYYQ= github.com/steadybit/action-kit/go/action_kit_sdk v1.1.12/go.mod h1:D8eHLbT+C797myIwacybsz0bqDfS1ShpIzjr+eSweX0= github.com/steadybit/action-kit/go/action_kit_test v1.3.0 h1:PZ8BfKQyFlFmbOcrp0PKHjHFT3S8y3mOBTGo/mGQcAE= From 42b64f609b930b304a4b6ef0a708542a6d77ef16 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 03:51:25 +0000 Subject: [PATCH 02/33] build(deps): bump github.com/steadybit/extension-kit Bumps [github.com/steadybit/extension-kit](https://github.com/steadybit/extension-kit) from 1.8.18 to 1.8.19. - [Changelog](https://github.com/steadybit/extension-kit/blob/main/CHANGELOG.md) - [Commits](https://github.com/steadybit/extension-kit/compare/v1.8.18...v1.8.19) --- updated-dependencies: - dependency-name: github.com/steadybit/extension-kit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 7ac4474..f6815b7 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.3 github.com/steadybit/action-kit/go/action_kit_sdk v1.1.12 github.com/steadybit/action-kit/go/action_kit_test v1.3.0 - github.com/steadybit/extension-kit v1.8.18 + github.com/steadybit/extension-kit v1.8.19 github.com/stretchr/testify v1.9.0 go.uber.org/automaxprocs v1.6.0 golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c diff --git a/go.sum b/go.sum index 96575f8..0e0a3c1 100644 --- a/go.sum +++ b/go.sum @@ -161,8 +161,8 @@ github.com/steadybit/discovery-kit/go/discovery_kit_api v1.6.0 h1:q24S067wJ7uUZs github.com/steadybit/discovery-kit/go/discovery_kit_api v1.6.0/go.mod h1:kGpQOWXnHTOle5c73wganP/iBXeVqEfD3mQYMvJJskI= github.com/steadybit/discovery-kit/go/discovery_kit_test v1.1.2 h1:IrTUwb69FDwOt/8OvY1Lvhv+qGNmy+Eu53HEjmsj0TA= github.com/steadybit/discovery-kit/go/discovery_kit_test v1.1.2/go.mod h1:tr4oRjpqr2WOKwO4auJR+/m+YKA2EAUuvvpbz1faUxw= -github.com/steadybit/extension-kit v1.8.18 h1:zvmNzz/h9bVFOMFnCK0/KNpM+M89yuA5aOWEPDSEj28= -github.com/steadybit/extension-kit v1.8.18/go.mod h1:fPu9AA1yA92VTZCOT+JE5EEAiTFgnb8Sfut5sKloeo0= +github.com/steadybit/extension-kit v1.8.19 h1:D+H8sV8zsHYl1NtxCxBl+hiUT8ndWmIZ35Td9RnlmS8= +github.com/steadybit/extension-kit v1.8.19/go.mod h1:fPu9AA1yA92VTZCOT+JE5EEAiTFgnb8Sfut5sKloeo0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= From e3cbcfceeca8cc2aa52694baa8daa49453dcf314 Mon Sep 17 00:00:00 2001 From: Daniel Reuter Date: Wed, 30 Oct 2024 08:29:18 +0100 Subject: [PATCH 03/33] build: upload latest release to docker-hub and include wiz scan --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21bdfb8..15cea0f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,4 +31,8 @@ jobs: STEADYBIT_ARTIFACT_SERVER_PASSWORD: ${{ secrets.STEADYBIT_ARTIFACT_SERVER_PASSWORD }} SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} VERSION_BUMPER_SECRET: ${{ secrets.GH_APP_STEADYBIT_PRIVATE_KEY }} + WIZ_CLIENT_ID: ${{ secrets.WIZ_CLIENT_ID }} + WIZ_CLIENT_SECRET: ${{ secrets.WIZ_CLIENT_SECRET }} + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} GCP_ARTIFACT_REGISTRY_IDENTITY_PROVIDER: ${{ secrets.GCP_ARTIFACT_REGISTRY_IDENTITY_PROVIDER }} From b84ca2e4887955ac0000ea7c1027c8fab1e98da6 Mon Sep 17 00:00:00 2001 From: Daniel Reuter Date: Mon, 4 Nov 2024 08:13:16 +0100 Subject: [PATCH 04/33] build: remove wiz pov changes --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15cea0f..21bdfb8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,8 +31,4 @@ jobs: STEADYBIT_ARTIFACT_SERVER_PASSWORD: ${{ secrets.STEADYBIT_ARTIFACT_SERVER_PASSWORD }} SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} VERSION_BUMPER_SECRET: ${{ secrets.GH_APP_STEADYBIT_PRIVATE_KEY }} - WIZ_CLIENT_ID: ${{ secrets.WIZ_CLIENT_ID }} - WIZ_CLIENT_SECRET: ${{ secrets.WIZ_CLIENT_SECRET }} - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} GCP_ARTIFACT_REGISTRY_IDENTITY_PROVIDER: ${{ secrets.GCP_ARTIFACT_REGISTRY_IDENTITY_PROVIDER }} From 4240652c2b8166904150bed9ebaa49b5fa9c2018 Mon Sep 17 00:00:00 2001 From: Daniel Reuter Date: Tue, 5 Nov 2024 07:50:38 +0100 Subject: [PATCH 05/33] chore: update goreleaser --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0a4abcd..402d1d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ## ## Build ## -FROM --platform=$BUILDPLATFORM goreleaser/goreleaser:v2.3.2 AS build +FROM --platform=$BUILDPLATFORM goreleaser/goreleaser:v2.4.3 AS build ARG TARGETOS TARGETARCH ARG BUILD_WITH_COVERAGE From ac2b9e471f321e0d92e159884e6d3ba7251f508e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 06:51:47 +0000 Subject: [PATCH 06/33] build(deps): bump goreleaser/goreleaser from v2.4.3 to v2.4.4 Bumps goreleaser/goreleaser from v2.4.3 to v2.4.4. --- updated-dependencies: - dependency-name: goreleaser/goreleaser dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 402d1d5..719ee62 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ## ## Build ## -FROM --platform=$BUILDPLATFORM goreleaser/goreleaser:v2.4.3 AS build +FROM --platform=$BUILDPLATFORM goreleaser/goreleaser:v2.4.4 AS build ARG TARGETOS TARGETARCH ARG BUILD_WITH_COVERAGE From cffa8c51f0befffe0fab4d9fe78a7f3c412b3a61 Mon Sep 17 00:00:00 2001 From: Daniel Reuter Date: Tue, 12 Nov 2024 14:40:11 +0100 Subject: [PATCH 07/33] feat: use signal handler mechanism from extension-kit --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- main.go | 3 ++- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 42a8368..8d67f73 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/rs/zerolog v1.33.0 github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.4 - github.com/steadybit/action-kit/go/action_kit_sdk v1.1.12 + github.com/steadybit/action-kit/go/action_kit_sdk v1.1.14 github.com/steadybit/action-kit/go/action_kit_test v1.3.0 - github.com/steadybit/extension-kit v1.8.19 + github.com/steadybit/extension-kit v1.8.22 github.com/stretchr/testify v1.9.0 go.uber.org/automaxprocs v1.6.0 golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c @@ -23,7 +23,7 @@ require ( github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/docker/go-units v0.5.0 // indirect - github.com/elastic/go-sysinfo v1.14.2 // indirect + github.com/elastic/go-sysinfo v1.15.0 // indirect github.com/elastic/go-windows v1.0.2 // indirect github.com/emicklei/go-restful/v3 v3.12.1 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect @@ -71,7 +71,7 @@ require ( golang.org/x/net v0.30.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.26.0 // indirect + golang.org/x/sys v0.27.0 // indirect golang.org/x/term v0.25.0 // indirect golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.7.0 // indirect diff --git a/go.sum b/go.sum index 301d306..09252c8 100644 --- a/go.sum +++ b/go.sum @@ -18,8 +18,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/elastic/go-sysinfo v1.14.2 h1:DeIy+pVfdRsd08Nx2Xjh+dUS+jrEEI7LGc29U/BKVWo= -github.com/elastic/go-sysinfo v1.14.2/go.mod h1:jPSuTgXG+dhhh0GKIyI2Cso+w5lPJ5PvVqKlL8LV/Hk= +github.com/elastic/go-sysinfo v1.15.0 h1:54pRFlAYUlVNQ2HbXzLVZlV+fxS7Eax49stzg95M4Xw= +github.com/elastic/go-sysinfo v1.15.0/go.mod h1:jPSuTgXG+dhhh0GKIyI2Cso+w5lPJ5PvVqKlL8LV/Hk= github.com/elastic/go-windows v1.0.2 h1:yoLLsAsV5cfg9FLhZ9EXZ2n2sQFKeDYrHenkcivY4vI= github.com/elastic/go-windows v1.0.2/go.mod h1:bGcDpBzXgYSqM0Gx3DM4+UxFj300SZLixie9u9ixLM8= github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU= @@ -153,16 +153,16 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.4 h1:imlfn0m5FEwZ3/ad75TgI5DoGQD4ztnSoLfPR4afqUY= github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.4/go.mod h1:ycF2RLgRsB8I/jD52aE+dKZKVru1GIEtmkcRcIR3vXk= -github.com/steadybit/action-kit/go/action_kit_sdk v1.1.12 h1:qHgEHBbp83QxVoS9UuBc9EDbBkAyF8UWhDG0/VwoYYQ= -github.com/steadybit/action-kit/go/action_kit_sdk v1.1.12/go.mod h1:D8eHLbT+C797myIwacybsz0bqDfS1ShpIzjr+eSweX0= +github.com/steadybit/action-kit/go/action_kit_sdk v1.1.14 h1:x94RX+vh9Iyc0tS6BhiSpvknj+xE36AV0Nc3D5Yuub0= +github.com/steadybit/action-kit/go/action_kit_sdk v1.1.14/go.mod h1:Tp/klK5b7k+BCvb3JTSDZSNcnpFBaHauhndzOarnMW4= github.com/steadybit/action-kit/go/action_kit_test v1.3.0 h1:PZ8BfKQyFlFmbOcrp0PKHjHFT3S8y3mOBTGo/mGQcAE= github.com/steadybit/action-kit/go/action_kit_test v1.3.0/go.mod h1:R4L0LaZ60cE/pUOOrl3FoFgXNF1jT1tfQOWqJRdszbg= github.com/steadybit/discovery-kit/go/discovery_kit_api v1.6.0 h1:q24S067wJ7uUZsi9LcccDJIEdsk9Ikss15hbqAt/OuE= github.com/steadybit/discovery-kit/go/discovery_kit_api v1.6.0/go.mod h1:kGpQOWXnHTOle5c73wganP/iBXeVqEfD3mQYMvJJskI= github.com/steadybit/discovery-kit/go/discovery_kit_test v1.1.2 h1:IrTUwb69FDwOt/8OvY1Lvhv+qGNmy+Eu53HEjmsj0TA= github.com/steadybit/discovery-kit/go/discovery_kit_test v1.1.2/go.mod h1:tr4oRjpqr2WOKwO4auJR+/m+YKA2EAUuvvpbz1faUxw= -github.com/steadybit/extension-kit v1.8.19 h1:D+H8sV8zsHYl1NtxCxBl+hiUT8ndWmIZ35Td9RnlmS8= -github.com/steadybit/extension-kit v1.8.19/go.mod h1:fPu9AA1yA92VTZCOT+JE5EEAiTFgnb8Sfut5sKloeo0= +github.com/steadybit/extension-kit v1.8.22 h1:rowDG0kBeTQi+lB9vGxi08HH6E+dEJ8vLjyKYREh9Bs= +github.com/steadybit/extension-kit v1.8.22/go.mod h1:Ym+tCgtMCcTw7iv/aPwB64E4/2WT8gsfYUIyb3kx+9g= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -207,8 +207,8 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= -golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/main.go b/main.go index d148715..7134c66 100644 --- a/main.go +++ b/main.go @@ -16,6 +16,7 @@ import ( "github.com/steadybit/extension-kit/exthttp" "github.com/steadybit/extension-kit/extlogging" "github.com/steadybit/extension-kit/extruntime" + "github.com/steadybit/extension-kit/extsignals" _ "go.uber.org/automaxprocs" // Importing automaxprocs automatically adjusts GOMAXPROCS. _ "net/http/pprof" //allow pprof ) @@ -53,7 +54,7 @@ func main() { action_kit_sdk.RegisterAction(exthttpcheck.NewHTTPCheckActionPeriodically()) //This will install a signal handlder, that will stop active actions when receiving a SIGURS1, SIGTERM or SIGINT - action_kit_sdk.InstallSignalHandler() + extsignals.ActivateSignalHandlers() action_kit_sdk.RegisterCoverageEndpoints() exthealth.SetReady(true) From e4f7f35b3a18b562774cb478d926418b343c7ced Mon Sep 17 00:00:00 2001 From: Daniel Reuter Date: Thu, 14 Nov 2024 15:31:14 +0100 Subject: [PATCH 08/33] feat: Location selection for http checks --- CHANGELOG.md | 4 + charts/steadybit-extension-http/Chart.yaml | 2 +- .../templates/deployment.yaml | 16 + .../templates/service.yaml | 2 +- .../__snapshot__/deployment_test.yaml.snap | 280 ++++++++++++++++++ .../tests/__snapshot__/service_test.yaml.snap | 8 +- .../tests/deployment_test.yaml | 14 +- charts/steadybit-extension-http/values.yaml | 5 + config/config.go | 5 +- e2e/integration_test.go | 4 +- exthttpcheck/common.go | 11 +- exthttpcheck/discovery.go | 97 ++++++ exthttpcheck/fixAmount.go | 4 +- exthttpcheck/periodically.go | 4 +- go.mod | 5 +- go.sum | 16 + main.go | 9 +- 17 files changed, 466 insertions(+), 20 deletions(-) create mode 100644 exthttpcheck/discovery.go diff --git a/CHANGELOG.md b/CHANGELOG.md index e145bf6..8e56654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v1.0.23 (next release) + +- Location selection for http checks + ## v1.0.22 - Update dependencies (go 1.23) diff --git a/charts/steadybit-extension-http/Chart.yaml b/charts/steadybit-extension-http/Chart.yaml index 27ac167..30d41fa 100644 --- a/charts/steadybit-extension-http/Chart.yaml +++ b/charts/steadybit-extension-http/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: steadybit-extension-http description: Steadybit action implementation to check HTTP endpoints. -version: 1.1.10 +version: 1.1.11 appVersion: v1.0.22 home: https://www.steadybit.com/ icon: https://steadybit-website-assets.s3.amazonaws.com/logo-symbol-transparent.png diff --git a/charts/steadybit-extension-http/templates/deployment.yaml b/charts/steadybit-extension-http/templates/deployment.yaml index c8a517e..ecb42c1 100644 --- a/charts/steadybit-extension-http/templates/deployment.yaml +++ b/charts/steadybit-extension-http/templates/deployment.yaml @@ -55,6 +55,22 @@ spec: memory: {{ .Values.resources.limits.memory }} cpu: {{ .Values.resources.limits.cpu }} env: + {{ if or (and .Values.global .Values.global.clusterName) .Values.kubernetes.clusterName }} + - name: STEADYBIT_EXTENSION_KUBERNETES_CLUSTER_NAME + value: {{ if and .Values.global .Values.global.clusterName }}{{ .Values.global.clusterName | quote }}{{ else }}{{ .Values.kubernetes.clusterName }}{{ end }} + {{- end }} + - name: STEADYBIT_EXTENSION_KUBERNETES_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: STEADYBIT_EXTENSION_KUBERNETES_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: STEADYBIT_EXTENSION_KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace {{- include "extensionlib.deployment.env" (list .) | nindent 12 }} {{- with .Values.extraEnv }} {{- toYaml . | nindent 12 }} diff --git a/charts/steadybit-extension-http/templates/service.yaml b/charts/steadybit-extension-http/templates/service.yaml index 69b5a50..ac13e14 100644 --- a/charts/steadybit-extension-http/templates/service.yaml +++ b/charts/steadybit-extension-http/templates/service.yaml @@ -1 +1 @@ -{{- include "extensionlib.service" (list . 8085 (list "ACTION" )) -}} +{{- include "extensionlib.service" (list . 8085 (list "ACTION" "DISCOVERY" )) -}} diff --git a/charts/steadybit-extension-http/tests/__snapshot__/deployment_test.yaml.snap b/charts/steadybit-extension-http/tests/__snapshot__/deployment_test.yaml.snap index 8c32679..be50038 100644 --- a/charts/steadybit-extension-http/tests/__snapshot__/deployment_test.yaml.snap +++ b/charts/steadybit-extension-http/tests/__snapshot__/deployment_test.yaml.snap @@ -28,6 +28,18 @@ manifest should match snapshot using podAnnotations and Labels: spec: containers: - env: + - name: STEADYBIT_EXTENSION_KUBERNETES_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: STEADYBIT_EXTENSION_KUBERNETES_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: STEADYBIT_EXTENSION_KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace - name: STEADYBIT_LOG_LEVEL value: INFO - name: STEADYBIT_LOG_FORMAT @@ -100,6 +112,18 @@ manifest should match snapshot with TLS: spec: containers: - env: + - name: STEADYBIT_EXTENSION_KUBERNETES_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: STEADYBIT_EXTENSION_KUBERNETES_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: STEADYBIT_EXTENSION_KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace - name: STEADYBIT_LOG_LEVEL value: INFO - name: STEADYBIT_LOG_FORMAT @@ -183,6 +207,18 @@ manifest should match snapshot with extra env vars: spec: containers: - env: + - name: STEADYBIT_EXTENSION_KUBERNETES_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: STEADYBIT_EXTENSION_KUBERNETES_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: STEADYBIT_EXTENSION_KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace - name: STEADYBIT_LOG_LEVEL value: INFO - name: STEADYBIT_LOG_FORMAT @@ -264,6 +300,18 @@ manifest should match snapshot with extra labels: spec: containers: - env: + - name: STEADYBIT_EXTENSION_KUBERNETES_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: STEADYBIT_EXTENSION_KUBERNETES_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: STEADYBIT_EXTENSION_KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace - name: STEADYBIT_LOG_LEVEL value: INFO - name: STEADYBIT_LOG_FORMAT @@ -336,6 +384,18 @@ manifest should match snapshot with mutual TLS: spec: containers: - env: + - name: STEADYBIT_EXTENSION_KUBERNETES_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: STEADYBIT_EXTENSION_KUBERNETES_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: STEADYBIT_EXTENSION_KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace - name: STEADYBIT_LOG_LEVEL value: INFO - name: STEADYBIT_LOG_FORMAT @@ -428,6 +488,18 @@ manifest should match snapshot with mutual TLS using containerPaths: spec: containers: - env: + - name: STEADYBIT_EXTENSION_KUBERNETES_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: STEADYBIT_EXTENSION_KUBERNETES_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: STEADYBIT_EXTENSION_KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace - name: STEADYBIT_LOG_LEVEL value: INFO - name: STEADYBIT_LOG_FORMAT @@ -506,6 +578,18 @@ manifest should match snapshot with podSecurityContext: spec: containers: - env: + - name: STEADYBIT_EXTENSION_KUBERNETES_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: STEADYBIT_EXTENSION_KUBERNETES_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: STEADYBIT_EXTENSION_KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace - name: STEADYBIT_LOG_LEVEL value: INFO - name: STEADYBIT_LOG_FORMAT @@ -580,6 +664,18 @@ manifest should match snapshot with priority class: spec: containers: - env: + - name: STEADYBIT_EXTENSION_KUBERNETES_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: STEADYBIT_EXTENSION_KUBERNETES_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: STEADYBIT_EXTENSION_KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace - name: STEADYBIT_LOG_LEVEL value: INFO - name: STEADYBIT_LOG_FORMAT @@ -653,6 +749,190 @@ manifest should match snapshot without TLS: spec: containers: - env: + - name: STEADYBIT_EXTENSION_KUBERNETES_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: STEADYBIT_EXTENSION_KUBERNETES_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: STEADYBIT_EXTENSION_KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: STEADYBIT_LOG_LEVEL + value: INFO + - name: STEADYBIT_LOG_FORMAT + value: text + image: ghcr.io/steadybit/extension-http:v0.0.0 + imagePullPolicy: IfNotPresent + livenessProbe: + failureThreshold: 5 + httpGet: + path: /health/liveness + port: 8081 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + name: extension + readinessProbe: + failureThreshold: 3 + httpGet: + path: /health/readiness + port: 8081 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + resources: + limits: + cpu: 200m + memory: 128Mi + requests: + cpu: 50m + memory: 32Mi + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsGroup: 10000 + runAsNonRoot: true + runAsUser: 10000 + volumeMounts: null + serviceAccountName: steadybit-extension-http + volumes: null +should add cluster name from global values: + 1: | + apiVersion: apps/v1 + kind: Deployment + metadata: + labels: + steadybit.com/discovery-disabled: "true" + steadybit.com/extension: "true" + name: RELEASE-NAME-steadybit-extension-http + namespace: NAMESPACE + spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/instance: RELEASE-NAME + app.kubernetes.io/name: steadybit-extension-http + template: + metadata: + annotations: + oneagent.dynatrace.com/injection: "false" + labels: + app.kubernetes.io/instance: RELEASE-NAME + app.kubernetes.io/name: steadybit-extension-http + steadybit.com/discovery-disabled: "true" + steadybit.com/extension: "true" + spec: + containers: + - env: + - name: STEADYBIT_EXTENSION_KUBERNETES_CLUSTER_NAME + value: beautiful-cluster + - name: STEADYBIT_EXTENSION_KUBERNETES_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: STEADYBIT_EXTENSION_KUBERNETES_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: STEADYBIT_EXTENSION_KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: STEADYBIT_LOG_LEVEL + value: INFO + - name: STEADYBIT_LOG_FORMAT + value: text + image: ghcr.io/steadybit/extension-http:v0.0.0 + imagePullPolicy: IfNotPresent + livenessProbe: + failureThreshold: 5 + httpGet: + path: /health/liveness + port: 8081 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + name: extension + readinessProbe: + failureThreshold: 3 + httpGet: + path: /health/readiness + port: 8081 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + resources: + limits: + cpu: 200m + memory: 128Mi + requests: + cpu: 50m + memory: 32Mi + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsGroup: 10000 + runAsNonRoot: true + runAsUser: 10000 + volumeMounts: null + serviceAccountName: steadybit-extension-http + volumes: null +should add cluster name from local values: + 1: | + apiVersion: apps/v1 + kind: Deployment + metadata: + labels: + steadybit.com/discovery-disabled: "true" + steadybit.com/extension: "true" + name: RELEASE-NAME-steadybit-extension-http + namespace: NAMESPACE + spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/instance: RELEASE-NAME + app.kubernetes.io/name: steadybit-extension-http + template: + metadata: + annotations: + oneagent.dynatrace.com/injection: "false" + labels: + app.kubernetes.io/instance: RELEASE-NAME + app.kubernetes.io/name: steadybit-extension-http + steadybit.com/discovery-disabled: "true" + steadybit.com/extension: "true" + spec: + containers: + - env: + - name: STEADYBIT_EXTENSION_KUBERNETES_CLUSTER_NAME + value: beautiful-cluster + - name: STEADYBIT_EXTENSION_KUBERNETES_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: STEADYBIT_EXTENSION_KUBERNETES_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: STEADYBIT_EXTENSION_KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace - name: STEADYBIT_LOG_LEVEL value: INFO - name: STEADYBIT_LOG_FORMAT diff --git a/charts/steadybit-extension-http/tests/__snapshot__/service_test.yaml.snap b/charts/steadybit-extension-http/tests/__snapshot__/service_test.yaml.snap index 6eea4d1..d305574 100644 --- a/charts/steadybit-extension-http/tests/__snapshot__/service_test.yaml.snap +++ b/charts/steadybit-extension-http/tests/__snapshot__/service_test.yaml.snap @@ -5,7 +5,7 @@ manifest should match snapshot with TLS: metadata: annotations: steadybit.com/extension-auto-discovery: | - {"extensions":[{"port":8085,"protocol":"https","types":["ACTION"]}]} + {"extensions":[{"port":8085,"protocol":"https","types":["ACTION","DISCOVERY"]}]} labels: null name: RELEASE-NAME-steadybit-extension-http namespace: NAMESPACE @@ -26,7 +26,7 @@ manifest should match snapshot with mutual TLS: metadata: annotations: steadybit.com/extension-auto-discovery: | - {"extensions":[{"port":8085,"protocol":"https","types":["ACTION"]}]} + {"extensions":[{"port":8085,"protocol":"https","types":["ACTION","DISCOVERY"]}]} labels: null name: RELEASE-NAME-steadybit-extension-http namespace: NAMESPACE @@ -47,7 +47,7 @@ manifest should match snapshot with mutual TLS using containerPaths: metadata: annotations: steadybit.com/extension-auto-discovery: | - {"extensions":[{"port":8085,"protocol":"https","types":["ACTION"]}]} + {"extensions":[{"port":8085,"protocol":"https","types":["ACTION","DISCOVERY"]}]} labels: null name: RELEASE-NAME-steadybit-extension-http namespace: NAMESPACE @@ -68,7 +68,7 @@ manifest should match snapshot without TLS: metadata: annotations: steadybit.com/extension-auto-discovery: | - {"extensions":[{"port":8085,"protocol":"http","types":["ACTION"]}]} + {"extensions":[{"port":8085,"protocol":"http","types":["ACTION","DISCOVERY"]}]} labels: null name: RELEASE-NAME-steadybit-extension-http namespace: NAMESPACE diff --git a/charts/steadybit-extension-http/tests/deployment_test.yaml b/charts/steadybit-extension-http/tests/deployment_test.yaml index b6ae49f..65377cc 100644 --- a/charts/steadybit-extension-http/tests/deployment_test.yaml +++ b/charts/steadybit-extension-http/tests/deployment_test.yaml @@ -74,9 +74,21 @@ tests: runAsUser: 2222 asserts: - matchSnapshot: {} - - it: manifest should match snapshot with priority class set: priorityClassName: my-priority-class asserts: - matchSnapshot: {} + - it: should add cluster name from global values + set: + global: + clusterName: beautiful-cluster + asserts: + - matchSnapshot: {} + - it: should add cluster name from local values + set: + kubernetes: + clusterName: beautiful-cluster + asserts: + - matchSnapshot: {} + diff --git a/charts/steadybit-extension-http/values.yaml b/charts/steadybit-extension-http/values.yaml index 8daf2c7..c3561d5 100644 --- a/charts/steadybit-extension-http/values.yaml +++ b/charts/steadybit-extension-http/values.yaml @@ -1,6 +1,11 @@ # Default values for steadybit-extension-kubernetes. # This is a YAML-formatted file. # Declare variables to be passed into your templates. + +kubernetes: + # kubernetes.clusterName -- The name of the kubernetes cluster (if not set, the global.clusterName will be used) + clusterName: null + image: # image.name -- The container image to use for the Steadybit scaffold extension. name: ghcr.io/steadybit/extension-http diff --git a/config/config.go b/config/config.go index 4cd55e2..4d847d8 100644 --- a/config/config.go +++ b/config/config.go @@ -13,7 +13,10 @@ import ( // through environment variables. Learn more through the documentation of the envconfig package. // https://github.com/kelseyhightower/envconfig type Specification struct { - // no config at the moment + KubernetesClusterName string `json:"kubernetesClusterName" split_words:"true" required:"false"` + KubernetesNodeName string `json:"kubernetesNodeName" split_words:"true" required:"false"` + KubernetesPodName string `json:"kubernetesPodName" split_words:"true" required:"false"` + KubernetesNamespace string `json:"kubernetesNamespace" split_words:"true" required:"false"` } var ( diff --git a/e2e/integration_test.go b/e2e/integration_test.go index e51e747..cf8cb64 100644 --- a/e2e/integration_test.go +++ b/e2e/integration_test.go @@ -90,7 +90,7 @@ func testPeriodically(t *testing.T, m *e2e.Minikube, e *e2e.Extension) { } t.Run(tt.name, func(t *testing.T) { - action, err := e.RunAction(exthttpcheck.TargetIDPeriodically, nil, config, nil) + action, err := e.RunAction(exthttpcheck.ActionIDPeriodically, nil, config, nil) defer func() { _ = action.Cancel() }() require.NoError(t, err) @@ -169,7 +169,7 @@ func testFixAmount(t *testing.T, m *e2e.Minikube, e *e2e.Extension) { } t.Run(tt.name, func(t *testing.T) { - action, err := e.RunAction(exthttpcheck.TargetIDFixedAmount, nil, config, nil) + action, err := e.RunAction(exthttpcheck.ActionIDFixedAmount, nil, config, nil) defer func() { _ = action.Cancel() }() require.NoError(t, err) diff --git a/exthttpcheck/common.go b/exthttpcheck/common.go index a069599..a510b52 100644 --- a/exthttpcheck/common.go +++ b/exthttpcheck/common.go @@ -6,11 +6,14 @@ import ( ) const ( - TargetIDPeriodically = "com.steadybit.extension_http.check.periodically" - TargetIDFixedAmount = "com.steadybit.extension_http.check.fixed_amount" + targetType = "com.steadybit.extension_http.client-location" + targetIcon = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00LjUgOS4xQzQuNSA0LjkyIDcuODc1IDEuNSAxMiAxLjVDMTYuMTI1IDEuNSAxOS41IDQuOTIgMTkuNSA5LjFDMTkuNSAxMy45MTM1IDEzLjcyMjQgMTkuMzEyNCAxMi43NzcgMjAuMTk1OEMxMi43MTQ5IDIwLjI1MzkgMTIuNjczNiAyMC4yOTI0IDEyLjY1NjIgMjAuMzFDMTIuNDY4OCAyMC40MDUgMTIuMTg3NSAyMC41IDEyIDIwLjVDMTEuODEyNSAyMC41IDExLjUzMTIgMjAuNDA1IDExLjM0MzggMjAuMzFDMTEuMzI2NCAyMC4yOTI0IDExLjI4NTEgMjAuMjUzOSAxMS4yMjMgMjAuMTk1OEMxMC4yNzc2IDE5LjMxMjQgNC41IDEzLjkxMzUgNC41IDkuMVpNNi4zNzUgOS4xQzYuMzc1IDEyLjMzIDEwLjAzMTIgMTYuNDE1IDEyIDE4LjMxNUMxMy45Njg4IDE2LjQxNSAxNy42MjUgMTIuMjM1IDE3LjYyNSA5LjFDMTcuNjI1IDUuOTY1IDE1LjA5MzggMy40IDEyIDMuNEM4LjkwNjI1IDMuNCA2LjM3NSA1Ljk2NSA2LjM3NSA5LjFaTTguMjUgOS4xQzguMjUgNy4wMSA5LjkzNzUgNS4zIDEyIDUuM0MxNC4wNjI1IDUuMyAxNS43NSA3LjAxIDE1Ljc1IDkuMUMxNS43NSAxMS4xOSAxNC4wNjI1IDEyLjkgMTIgMTIuOUM5LjkzNzUgMTIuOSA4LjI1IDExLjE5IDguMjUgOS4xWk0xMC4xMjUgOS4xQzEwLjEyNSAxMC4xNDUgMTAuOTY4OCAxMSAxMiAxMUMxMy4wMzEyIDExIDEzLjg3NSAxMC4xNDUgMTMuODc1IDkuMUMxMy44NzUgOC4wNTUgMTMuMDMxMiA3LjIgMTIgNy4yQzEwLjk2ODggNy4yIDEwLjEyNSA4LjA1NSAxMC4xMjUgOS4xWk01LjA3MzMyIDE2Ljg3NDVDNS41NTYyNyAxNi42MDY2IDUuNzMwNjEgMTUuOTk3OSA1LjQ2MjcgMTUuNTE0OUM1LjE5NDggMTUuMDMyIDQuNTg2MSAxNC44NTc2IDQuMTAzMTUgMTUuMTI1NUMyLjc0Mzg0IDE1Ljg3OTYgMiAxNi45NTE1IDIgMTguMjVDMiAxOS4xMTYxIDIuNDI1NTEgMTkuODUwNyAzLjAwNTQ4IDIwLjQyMjFDMy41ODE5MyAyMC45ODk5IDQuMzY0NzYgMjEuNDU1MyA1LjI1MTQyIDIxLjgyNDdDNy4wMjkxMyAyMi41NjU0IDkuNDE1NjkgMjMgMTIgMjNDMTQuNTg0MyAyMyAxNi45NzA5IDIyLjU2NTQgMTguNzQ4NiAyMS44MjQ3QzE5LjYzNTIgMjEuNDU1MyAyMC40MTgxIDIwLjk4OTkgMjAuOTk0NSAyMC40MjIxQzIxLjU3NDUgMTkuODUwNyAyMiAxOS4xMTYxIDIyIDE4LjI1QzIyIDE2Ljk1MTUgMjEuMjU2MiAxNS44Nzk2IDE5Ljg5NjkgMTUuMTI1NUMxOS40MTM5IDE0Ljg1NzYgMTguODA1MiAxNS4wMzIgMTguNTM3MyAxNS41MTQ5QzE4LjI2OTQgMTUuOTk3OSAxOC40NDM3IDE2LjYwNjYgMTguOTI2NyAxNi44NzQ1QzE5LjgyNzEgMTcuMzczOSAyMCAxNy44NjAxIDIwIDE4LjI1QzIwIDE4LjQxOTQgMTkuOTIxOCAxOC42NzEzIDE5LjU5MSAxOC45OTczQzE5LjI1NjUgMTkuMzI2NyAxOC43MjE0IDE5LjY2OTQgMTcuOTc5MyAxOS45Nzg2QzE2LjQ5OTcgMjAuNTk1MSAxNC4zODYzIDIxIDEyIDIxQzkuNjEzNzUgMjEgNy41MDAzMSAyMC41OTUxIDYuMDIwNjUgMTkuOTc4NkM1LjI3ODY0IDE5LjY2OTQgNC43NDM0NSAxOS4zMjY3IDQuNDA5MDUgMTguOTk3M0M0LjA3ODE3IDE4LjY3MTMgNCAxOC40MTk0IDQgMTguMjVDNCAxNy44NjAxIDQuMTcyOTUgMTcuMzczOSA1LjA3MzMyIDE2Ljg3NDVaIiBmaWxsPSIjMUQyNjMyIi8+Cjwvc3ZnPgo=" - targetIconPeriodically = "data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M4.38098%2013C4.17057%2013%204%2012.8294%204%2012.619V9.38098C4%209.17057%204.17057%209%204.38098%209V9C4.59139%209%204.76196%209.17057%204.76196%209.38098V10.6934H6.71103V9.38201C6.71103%209.17103%206.88206%209%207.09304%209V9C7.30402%209%207.47505%209.17103%207.47505%209.38201V12.618C7.47505%2012.829%207.30402%2013%207.09304%2013V13C6.88206%2013%206.71103%2012.829%206.71103%2012.618V11.3008H4.76196V12.619C4.76196%2012.8294%204.59139%2013%204.38098%2013V13Z%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M8.42263%209.60742C8.25489%209.60742%208.11892%209.47145%208.11892%209.30371V9.30371C8.11892%209.13598%208.25489%209%208.42263%209H11.1711C11.3389%209%2011.4748%209.13598%2011.4748%209.30371V9.30371C11.4748%209.47145%2011.3389%209.60742%2011.1711%209.60742H10.1748V12.6221C10.1748%2012.8308%2010.0056%2013%209.79688%2013V13C9.58817%2013%209.41898%2012.8308%209.41898%2012.6221V9.60742H8.42263Z%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M12.2407%209.60742C12.0729%209.60742%2011.9369%209.47145%2011.9369%209.30371V9.30371C11.9369%209.13598%2012.0729%209%2012.2407%209H14.9892C15.1569%209%2015.2929%209.13598%2015.2929%209.30371V9.30371C15.2929%209.47145%2015.1569%209.60742%2014.9892%209.60742H13.9928V12.6221C13.9928%2012.8308%2013.8236%2013%2013.6149%2013V13C13.4062%2013%2013.237%2012.8308%2013.237%2012.6221V9.60742H12.2407Z%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M16.3208%2013C16.1104%2013%2015.9398%2012.8294%2015.9398%2012.619V9.5C15.9398%209.22386%2016.1637%209%2016.4398%209H17.5171C17.8403%209%2018.1114%209.05729%2018.3305%209.17187C18.5509%209.28646%2018.7173%209.44401%2018.8295%209.64453C18.9432%209.84375%2019%2010.0703%2019%2010.3242C19%2010.5807%2018.9432%2010.8086%2018.8295%2011.0078C18.7159%2011.207%2018.5482%2011.3639%2018.3263%2011.4785C18.1045%2011.5918%2017.8314%2011.6484%2017.5069%2011.6484H16.4615V11.0527H17.4042C17.5931%2011.0527%2017.7479%2011.0215%2017.8684%2010.959C17.9888%2010.8965%2018.0778%2010.8105%2018.1353%2010.7012C18.1942%2010.5918%2018.2237%2010.4661%2018.2237%2010.3242C18.2237%2010.1823%2018.1942%2010.0573%2018.1353%209.94922C18.0778%209.84115%2017.9882%209.75716%2017.8663%209.69727C17.7458%209.63607%2017.5904%209.60547%2017.4001%209.60547H16.7018V12.619C16.7018%2012.8294%2016.5312%2013%2016.3208%2013V13Z%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M4.38098%2013C4.17057%2013%204%2012.8294%204%2012.619V9.38098C4%209.17057%204.17057%209%204.38098%209V9C4.59139%209%204.76196%209.17057%204.76196%209.38098V10.6934H6.71103V9.38201C6.71103%209.17103%206.88206%209%207.09304%209V9C7.30402%209%207.47505%209.17103%207.47505%209.38201V12.618C7.47505%2012.829%207.30402%2013%207.09304%2013V13C6.88206%2013%206.71103%2012.829%206.71103%2012.618V11.3008H4.76196V12.619C4.76196%2012.8294%204.59139%2013%204.38098%2013V13Z%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Cpath%20d%3D%22M8.42263%209.60742C8.25489%209.60742%208.11892%209.47145%208.11892%209.30371V9.30371C8.11892%209.13598%208.25489%209%208.42263%209H11.1711C11.3389%209%2011.4748%209.13598%2011.4748%209.30371V9.30371C11.4748%209.47145%2011.3389%209.60742%2011.1711%209.60742H10.1748V12.6221C10.1748%2012.8308%2010.0056%2013%209.79688%2013V13C9.58817%2013%209.41898%2012.8308%209.41898%2012.6221V9.60742H8.42263Z%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Cpath%20d%3D%22M12.2407%209.60742C12.0729%209.60742%2011.9369%209.47145%2011.9369%209.30371V9.30371C11.9369%209.13598%2012.0729%209%2012.2407%209H14.9892C15.1569%209%2015.2929%209.13598%2015.2929%209.30371V9.30371C15.2929%209.47145%2015.1569%209.60742%2014.9892%209.60742H13.9928V12.6221C13.9928%2012.8308%2013.8236%2013%2013.6149%2013V13C13.4062%2013%2013.237%2012.8308%2013.237%2012.6221V9.60742H12.2407Z%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Cpath%20d%3D%22M16.3208%2013C16.1104%2013%2015.9398%2012.8294%2015.9398%2012.619V9.5C15.9398%209.22386%2016.1637%209%2016.4398%209H17.5171C17.8403%209%2018.1114%209.05729%2018.3305%209.17187C18.5509%209.28646%2018.7173%209.44401%2018.8295%209.64453C18.9432%209.84375%2019%2010.0703%2019%2010.3242C19%2010.5807%2018.9432%2010.8086%2018.8295%2011.0078C18.7159%2011.207%2018.5482%2011.3639%2018.3263%2011.4785C18.1045%2011.5918%2017.8314%2011.6484%2017.5069%2011.6484H16.4615V11.0527H17.4042C17.5931%2011.0527%2017.7479%2011.0215%2017.8684%2010.959C17.9888%2010.8965%2018.0778%2010.8105%2018.1353%2010.7012C18.1942%2010.5918%2018.2237%2010.4661%2018.2237%2010.3242C18.2237%2010.1823%2018.1942%2010.0573%2018.1353%209.94922C18.0778%209.84115%2017.9882%209.75716%2017.8663%209.69727C17.7458%209.63607%2017.5904%209.60547%2017.4001%209.60547H16.7018V12.619C16.7018%2012.8294%2016.5312%2013%2016.3208%2013V13Z%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Ccircle%20cx%3D%224.5%22%20cy%3D%224.5%22%20r%3D%220.5%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Ccircle%20cx%3D%226.5%22%20cy%3D%224.5%22%20r%3D%220.5%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Ccircle%20cx%3D%228.5%22%20cy%3D%224.5%22%20r%3D%220.5%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M10.5%2022H4C2.89543%2022%202%2021.1046%202%2020V7M22%2012V7M2%207V4C2%202.89543%202.89543%202%204%202H20C21.1046%202%2022%202.89543%2022%204V7M2%207H22%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.5006%2015C16.5673%2015%2015.0001%2016.567%2015.0001%2018.5C15.0001%2020.433%2016.5673%2022%2018.5006%2022C20.4338%2022%2022.001%2020.433%2022.001%2018.5C22.001%2016.567%2020.4338%2015%2018.5006%2015ZM14%2018.5C14%2016.0147%2016.015%2014%2018.5006%2014C20.9862%2014%2023.0011%2016.0147%2023.0011%2018.5C23.0011%2020.9853%2020.9862%2023%2018.5006%2023C16.015%2023%2014%2020.9853%2014%2018.5Z%22%20fill%3D%22%231D2632%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.2%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.4516%2017C18.701%2017%2018.9032%2017.2022%2018.9032%2017.4516V18.5962H20.0484C20.2978%2018.5962%2020.5%2018.7984%2020.5%2019.0478C20.5%2019.2972%2020.2978%2019.4994%2020.0484%2019.4994H18.4516C18.2022%2019.4994%2018%2019.2972%2018%2019.0478V17.4516C18%2017.2022%2018.2022%2017%2018.4516%2017Z%22%20fill%3D%22%231D2632%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.2%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A" - targetIconFixedAmount = "data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M4.38098%2013C4.17057%2013%204%2012.8294%204%2012.619V9.38098C4%209.17057%204.17057%209%204.38098%209V9C4.59139%209%204.76196%209.17057%204.76196%209.38098V10.6934H6.71103V9.38201C6.71103%209.17103%206.88206%209%207.09304%209V9C7.30402%209%207.47505%209.17103%207.47505%209.38201V12.618C7.47505%2012.829%207.30402%2013%207.09304%2013V13C6.88206%2013%206.71103%2012.829%206.71103%2012.618V11.3008H4.76196V12.619C4.76196%2012.8294%204.59139%2013%204.38098%2013V13Z%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M8.42263%209.60742C8.25489%209.60742%208.11892%209.47145%208.11892%209.30371V9.30371C8.11892%209.13598%208.25489%209%208.42263%209H11.1711C11.3389%209%2011.4748%209.13598%2011.4748%209.30371V9.30371C11.4748%209.47145%2011.3389%209.60742%2011.1711%209.60742H10.1748V12.6221C10.1748%2012.8308%2010.0056%2013%209.79688%2013V13C9.58817%2013%209.41898%2012.8308%209.41898%2012.6221V9.60742H8.42263Z%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M12.2407%209.60742C12.0729%209.60742%2011.9369%209.47145%2011.9369%209.30371V9.30371C11.9369%209.13598%2012.0729%209%2012.2407%209H14.9892C15.1569%209%2015.2929%209.13598%2015.2929%209.30371V9.30371C15.2929%209.47145%2015.1569%209.60742%2014.9892%209.60742H13.9928V12.6221C13.9928%2012.8308%2013.8236%2013%2013.6149%2013V13C13.4062%2013%2013.237%2012.8308%2013.237%2012.6221V9.60742H12.2407Z%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M16.3208%2013C16.1104%2013%2015.9398%2012.8294%2015.9398%2012.619V9.5C15.9398%209.22386%2016.1637%209%2016.4398%209H17.5171C17.8403%209%2018.1114%209.05729%2018.3305%209.17187C18.5509%209.28646%2018.7173%209.44401%2018.8295%209.64453C18.9432%209.84375%2019%2010.0703%2019%2010.3242C19%2010.5807%2018.9432%2010.8086%2018.8295%2011.0078C18.7159%2011.207%2018.5482%2011.3639%2018.3263%2011.4785C18.1045%2011.5918%2017.8314%2011.6484%2017.5069%2011.6484H16.4615V11.0527H17.4042C17.5931%2011.0527%2017.7479%2011.0215%2017.8684%2010.959C17.9888%2010.8965%2018.0778%2010.8105%2018.1353%2010.7012C18.1942%2010.5918%2018.2237%2010.4661%2018.2237%2010.3242C18.2237%2010.1823%2018.1942%2010.0573%2018.1353%209.94922C18.0778%209.84115%2017.9882%209.75716%2017.8663%209.69727C17.7458%209.63607%2017.5904%209.60547%2017.4001%209.60547H16.7018V12.619C16.7018%2012.8294%2016.5312%2013%2016.3208%2013V13Z%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M4.38098%2013C4.17057%2013%204%2012.8294%204%2012.619V9.38098C4%209.17057%204.17057%209%204.38098%209V9C4.59139%209%204.76196%209.17057%204.76196%209.38098V10.6934H6.71103V9.38201C6.71103%209.17103%206.88206%209%207.09304%209V9C7.30402%209%207.47505%209.17103%207.47505%209.38201V12.618C7.47505%2012.829%207.30402%2013%207.09304%2013V13C6.88206%2013%206.71103%2012.829%206.71103%2012.618V11.3008H4.76196V12.619C4.76196%2012.8294%204.59139%2013%204.38098%2013V13Z%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Cpath%20d%3D%22M8.42263%209.60742C8.25489%209.60742%208.11892%209.47145%208.11892%209.30371V9.30371C8.11892%209.13598%208.25489%209%208.42263%209H11.1711C11.3389%209%2011.4748%209.13598%2011.4748%209.30371V9.30371C11.4748%209.47145%2011.3389%209.60742%2011.1711%209.60742H10.1748V12.6221C10.1748%2012.8308%2010.0056%2013%209.79688%2013V13C9.58817%2013%209.41898%2012.8308%209.41898%2012.6221V9.60742H8.42263Z%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Cpath%20d%3D%22M12.2407%209.60742C12.0729%209.60742%2011.9369%209.47145%2011.9369%209.30371V9.30371C11.9369%209.13598%2012.0729%209%2012.2407%209H14.9892C15.1569%209%2015.2929%209.13598%2015.2929%209.30371V9.30371C15.2929%209.47145%2015.1569%209.60742%2014.9892%209.60742H13.9928V12.6221C13.9928%2012.8308%2013.8236%2013%2013.6149%2013V13C13.4062%2013%2013.237%2012.8308%2013.237%2012.6221V9.60742H12.2407Z%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Cpath%20d%3D%22M16.3208%2013C16.1104%2013%2015.9398%2012.8294%2015.9398%2012.619V9.5C15.9398%209.22386%2016.1637%209%2016.4398%209H17.5171C17.8403%209%2018.1114%209.05729%2018.3305%209.17187C18.5509%209.28646%2018.7173%209.44401%2018.8295%209.64453C18.9432%209.84375%2019%2010.0703%2019%2010.3242C19%2010.5807%2018.9432%2010.8086%2018.8295%2011.0078C18.7159%2011.207%2018.5482%2011.3639%2018.3263%2011.4785C18.1045%2011.5918%2017.8314%2011.6484%2017.5069%2011.6484H16.4615V11.0527H17.4042C17.5931%2011.0527%2017.7479%2011.0215%2017.8684%2010.959C17.9888%2010.8965%2018.0778%2010.8105%2018.1353%2010.7012C18.1942%2010.5918%2018.2237%2010.4661%2018.2237%2010.3242C18.2237%2010.1823%2018.1942%2010.0573%2018.1353%209.94922C18.0778%209.84115%2017.9882%209.75716%2017.8663%209.69727C17.7458%209.63607%2017.5904%209.60547%2017.4001%209.60547H16.7018V12.619C16.7018%2012.8294%2016.5312%2013%2016.3208%2013V13Z%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Ccircle%20cx%3D%224.5%22%20cy%3D%224.5%22%20r%3D%220.5%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Ccircle%20cx%3D%226.5%22%20cy%3D%224.5%22%20r%3D%220.5%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Ccircle%20cx%3D%228.5%22%20cy%3D%224.5%22%20r%3D%220.5%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M10%2022H4C2.89543%2022%202%2021.1046%202%2020V7M22%2012V7M2%207V4C2%202.89543%202.89543%202%204%202H20C21.1046%202%2022%202.89543%2022%204V7M2%207H22%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.5006%2015C16.5673%2015%2015.0001%2016.567%2015.0001%2018.5C15.0001%2020.433%2016.5673%2022%2018.5006%2022C20.4338%2022%2022.001%2020.433%2022.001%2018.5C22.001%2016.567%2020.4338%2015%2018.5006%2015ZM14%2018.5C14%2016.0147%2016.015%2014%2018.5006%2014C20.9862%2014%2023.0011%2016.0147%2023.0011%2018.5C23.0011%2020.9853%2020.9862%2023%2018.5006%2023C16.015%2023%2014%2020.9853%2014%2018.5Z%22%20fill%3D%22%231D2632%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.2%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%0A%3Cpath%20d%3D%22M18.6508%2021L19.6157%2016H20.4199L19.4549%2021H18.6508ZM16%2019.7109L16.135%2019.0273H20.6611L20.5261%2019.7109H16ZM16.583%2021L17.548%2016H18.3521L17.3871%2021H16.583ZM16.3418%2017.9727L16.4739%2017.2891H21L20.8679%2017.9727H16.3418Z%22%20fill%3D%22%231D2632%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.2%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A" + ActionIDPeriodically = "com.steadybit.extension_http.check.periodically" + ActionIDFixedAmount = "com.steadybit.extension_http.check.fixed_amount" + + actionIconPeriodically = "data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M4.38098%2013C4.17057%2013%204%2012.8294%204%2012.619V9.38098C4%209.17057%204.17057%209%204.38098%209V9C4.59139%209%204.76196%209.17057%204.76196%209.38098V10.6934H6.71103V9.38201C6.71103%209.17103%206.88206%209%207.09304%209V9C7.30402%209%207.47505%209.17103%207.47505%209.38201V12.618C7.47505%2012.829%207.30402%2013%207.09304%2013V13C6.88206%2013%206.71103%2012.829%206.71103%2012.618V11.3008H4.76196V12.619C4.76196%2012.8294%204.59139%2013%204.38098%2013V13Z%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M8.42263%209.60742C8.25489%209.60742%208.11892%209.47145%208.11892%209.30371V9.30371C8.11892%209.13598%208.25489%209%208.42263%209H11.1711C11.3389%209%2011.4748%209.13598%2011.4748%209.30371V9.30371C11.4748%209.47145%2011.3389%209.60742%2011.1711%209.60742H10.1748V12.6221C10.1748%2012.8308%2010.0056%2013%209.79688%2013V13C9.58817%2013%209.41898%2012.8308%209.41898%2012.6221V9.60742H8.42263Z%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M12.2407%209.60742C12.0729%209.60742%2011.9369%209.47145%2011.9369%209.30371V9.30371C11.9369%209.13598%2012.0729%209%2012.2407%209H14.9892C15.1569%209%2015.2929%209.13598%2015.2929%209.30371V9.30371C15.2929%209.47145%2015.1569%209.60742%2014.9892%209.60742H13.9928V12.6221C13.9928%2012.8308%2013.8236%2013%2013.6149%2013V13C13.4062%2013%2013.237%2012.8308%2013.237%2012.6221V9.60742H12.2407Z%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M16.3208%2013C16.1104%2013%2015.9398%2012.8294%2015.9398%2012.619V9.5C15.9398%209.22386%2016.1637%209%2016.4398%209H17.5171C17.8403%209%2018.1114%209.05729%2018.3305%209.17187C18.5509%209.28646%2018.7173%209.44401%2018.8295%209.64453C18.9432%209.84375%2019%2010.0703%2019%2010.3242C19%2010.5807%2018.9432%2010.8086%2018.8295%2011.0078C18.7159%2011.207%2018.5482%2011.3639%2018.3263%2011.4785C18.1045%2011.5918%2017.8314%2011.6484%2017.5069%2011.6484H16.4615V11.0527H17.4042C17.5931%2011.0527%2017.7479%2011.0215%2017.8684%2010.959C17.9888%2010.8965%2018.0778%2010.8105%2018.1353%2010.7012C18.1942%2010.5918%2018.2237%2010.4661%2018.2237%2010.3242C18.2237%2010.1823%2018.1942%2010.0573%2018.1353%209.94922C18.0778%209.84115%2017.9882%209.75716%2017.8663%209.69727C17.7458%209.63607%2017.5904%209.60547%2017.4001%209.60547H16.7018V12.619C16.7018%2012.8294%2016.5312%2013%2016.3208%2013V13Z%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M4.38098%2013C4.17057%2013%204%2012.8294%204%2012.619V9.38098C4%209.17057%204.17057%209%204.38098%209V9C4.59139%209%204.76196%209.17057%204.76196%209.38098V10.6934H6.71103V9.38201C6.71103%209.17103%206.88206%209%207.09304%209V9C7.30402%209%207.47505%209.17103%207.47505%209.38201V12.618C7.47505%2012.829%207.30402%2013%207.09304%2013V13C6.88206%2013%206.71103%2012.829%206.71103%2012.618V11.3008H4.76196V12.619C4.76196%2012.8294%204.59139%2013%204.38098%2013V13Z%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Cpath%20d%3D%22M8.42263%209.60742C8.25489%209.60742%208.11892%209.47145%208.11892%209.30371V9.30371C8.11892%209.13598%208.25489%209%208.42263%209H11.1711C11.3389%209%2011.4748%209.13598%2011.4748%209.30371V9.30371C11.4748%209.47145%2011.3389%209.60742%2011.1711%209.60742H10.1748V12.6221C10.1748%2012.8308%2010.0056%2013%209.79688%2013V13C9.58817%2013%209.41898%2012.8308%209.41898%2012.6221V9.60742H8.42263Z%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Cpath%20d%3D%22M12.2407%209.60742C12.0729%209.60742%2011.9369%209.47145%2011.9369%209.30371V9.30371C11.9369%209.13598%2012.0729%209%2012.2407%209H14.9892C15.1569%209%2015.2929%209.13598%2015.2929%209.30371V9.30371C15.2929%209.47145%2015.1569%209.60742%2014.9892%209.60742H13.9928V12.6221C13.9928%2012.8308%2013.8236%2013%2013.6149%2013V13C13.4062%2013%2013.237%2012.8308%2013.237%2012.6221V9.60742H12.2407Z%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Cpath%20d%3D%22M16.3208%2013C16.1104%2013%2015.9398%2012.8294%2015.9398%2012.619V9.5C15.9398%209.22386%2016.1637%209%2016.4398%209H17.5171C17.8403%209%2018.1114%209.05729%2018.3305%209.17187C18.5509%209.28646%2018.7173%209.44401%2018.8295%209.64453C18.9432%209.84375%2019%2010.0703%2019%2010.3242C19%2010.5807%2018.9432%2010.8086%2018.8295%2011.0078C18.7159%2011.207%2018.5482%2011.3639%2018.3263%2011.4785C18.1045%2011.5918%2017.8314%2011.6484%2017.5069%2011.6484H16.4615V11.0527H17.4042C17.5931%2011.0527%2017.7479%2011.0215%2017.8684%2010.959C17.9888%2010.8965%2018.0778%2010.8105%2018.1353%2010.7012C18.1942%2010.5918%2018.2237%2010.4661%2018.2237%2010.3242C18.2237%2010.1823%2018.1942%2010.0573%2018.1353%209.94922C18.0778%209.84115%2017.9882%209.75716%2017.8663%209.69727C17.7458%209.63607%2017.5904%209.60547%2017.4001%209.60547H16.7018V12.619C16.7018%2012.8294%2016.5312%2013%2016.3208%2013V13Z%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Ccircle%20cx%3D%224.5%22%20cy%3D%224.5%22%20r%3D%220.5%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Ccircle%20cx%3D%226.5%22%20cy%3D%224.5%22%20r%3D%220.5%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Ccircle%20cx%3D%228.5%22%20cy%3D%224.5%22%20r%3D%220.5%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M10.5%2022H4C2.89543%2022%202%2021.1046%202%2020V7M22%2012V7M2%207V4C2%202.89543%202.89543%202%204%202H20C21.1046%202%2022%202.89543%2022%204V7M2%207H22%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.5006%2015C16.5673%2015%2015.0001%2016.567%2015.0001%2018.5C15.0001%2020.433%2016.5673%2022%2018.5006%2022C20.4338%2022%2022.001%2020.433%2022.001%2018.5C22.001%2016.567%2020.4338%2015%2018.5006%2015ZM14%2018.5C14%2016.0147%2016.015%2014%2018.5006%2014C20.9862%2014%2023.0011%2016.0147%2023.0011%2018.5C23.0011%2020.9853%2020.9862%2023%2018.5006%2023C16.015%2023%2014%2020.9853%2014%2018.5Z%22%20fill%3D%22%231D2632%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.2%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.4516%2017C18.701%2017%2018.9032%2017.2022%2018.9032%2017.4516V18.5962H20.0484C20.2978%2018.5962%2020.5%2018.7984%2020.5%2019.0478C20.5%2019.2972%2020.2978%2019.4994%2020.0484%2019.4994H18.4516C18.2022%2019.4994%2018%2019.2972%2018%2019.0478V17.4516C18%2017.2022%2018.2022%2017%2018.4516%2017Z%22%20fill%3D%22%231D2632%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.2%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A" + actionIconFixedAmount = "data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M4.38098%2013C4.17057%2013%204%2012.8294%204%2012.619V9.38098C4%209.17057%204.17057%209%204.38098%209V9C4.59139%209%204.76196%209.17057%204.76196%209.38098V10.6934H6.71103V9.38201C6.71103%209.17103%206.88206%209%207.09304%209V9C7.30402%209%207.47505%209.17103%207.47505%209.38201V12.618C7.47505%2012.829%207.30402%2013%207.09304%2013V13C6.88206%2013%206.71103%2012.829%206.71103%2012.618V11.3008H4.76196V12.619C4.76196%2012.8294%204.59139%2013%204.38098%2013V13Z%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M8.42263%209.60742C8.25489%209.60742%208.11892%209.47145%208.11892%209.30371V9.30371C8.11892%209.13598%208.25489%209%208.42263%209H11.1711C11.3389%209%2011.4748%209.13598%2011.4748%209.30371V9.30371C11.4748%209.47145%2011.3389%209.60742%2011.1711%209.60742H10.1748V12.6221C10.1748%2012.8308%2010.0056%2013%209.79688%2013V13C9.58817%2013%209.41898%2012.8308%209.41898%2012.6221V9.60742H8.42263Z%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M12.2407%209.60742C12.0729%209.60742%2011.9369%209.47145%2011.9369%209.30371V9.30371C11.9369%209.13598%2012.0729%209%2012.2407%209H14.9892C15.1569%209%2015.2929%209.13598%2015.2929%209.30371V9.30371C15.2929%209.47145%2015.1569%209.60742%2014.9892%209.60742H13.9928V12.6221C13.9928%2012.8308%2013.8236%2013%2013.6149%2013V13C13.4062%2013%2013.237%2012.8308%2013.237%2012.6221V9.60742H12.2407Z%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M16.3208%2013C16.1104%2013%2015.9398%2012.8294%2015.9398%2012.619V9.5C15.9398%209.22386%2016.1637%209%2016.4398%209H17.5171C17.8403%209%2018.1114%209.05729%2018.3305%209.17187C18.5509%209.28646%2018.7173%209.44401%2018.8295%209.64453C18.9432%209.84375%2019%2010.0703%2019%2010.3242C19%2010.5807%2018.9432%2010.8086%2018.8295%2011.0078C18.7159%2011.207%2018.5482%2011.3639%2018.3263%2011.4785C18.1045%2011.5918%2017.8314%2011.6484%2017.5069%2011.6484H16.4615V11.0527H17.4042C17.5931%2011.0527%2017.7479%2011.0215%2017.8684%2010.959C17.9888%2010.8965%2018.0778%2010.8105%2018.1353%2010.7012C18.1942%2010.5918%2018.2237%2010.4661%2018.2237%2010.3242C18.2237%2010.1823%2018.1942%2010.0573%2018.1353%209.94922C18.0778%209.84115%2017.9882%209.75716%2017.8663%209.69727C17.7458%209.63607%2017.5904%209.60547%2017.4001%209.60547H16.7018V12.619C16.7018%2012.8294%2016.5312%2013%2016.3208%2013V13Z%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M4.38098%2013C4.17057%2013%204%2012.8294%204%2012.619V9.38098C4%209.17057%204.17057%209%204.38098%209V9C4.59139%209%204.76196%209.17057%204.76196%209.38098V10.6934H6.71103V9.38201C6.71103%209.17103%206.88206%209%207.09304%209V9C7.30402%209%207.47505%209.17103%207.47505%209.38201V12.618C7.47505%2012.829%207.30402%2013%207.09304%2013V13C6.88206%2013%206.71103%2012.829%206.71103%2012.618V11.3008H4.76196V12.619C4.76196%2012.8294%204.59139%2013%204.38098%2013V13Z%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Cpath%20d%3D%22M8.42263%209.60742C8.25489%209.60742%208.11892%209.47145%208.11892%209.30371V9.30371C8.11892%209.13598%208.25489%209%208.42263%209H11.1711C11.3389%209%2011.4748%209.13598%2011.4748%209.30371V9.30371C11.4748%209.47145%2011.3389%209.60742%2011.1711%209.60742H10.1748V12.6221C10.1748%2012.8308%2010.0056%2013%209.79688%2013V13C9.58817%2013%209.41898%2012.8308%209.41898%2012.6221V9.60742H8.42263Z%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Cpath%20d%3D%22M12.2407%209.60742C12.0729%209.60742%2011.9369%209.47145%2011.9369%209.30371V9.30371C11.9369%209.13598%2012.0729%209%2012.2407%209H14.9892C15.1569%209%2015.2929%209.13598%2015.2929%209.30371V9.30371C15.2929%209.47145%2015.1569%209.60742%2014.9892%209.60742H13.9928V12.6221C13.9928%2012.8308%2013.8236%2013%2013.6149%2013V13C13.4062%2013%2013.237%2012.8308%2013.237%2012.6221V9.60742H12.2407Z%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Cpath%20d%3D%22M16.3208%2013C16.1104%2013%2015.9398%2012.8294%2015.9398%2012.619V9.5C15.9398%209.22386%2016.1637%209%2016.4398%209H17.5171C17.8403%209%2018.1114%209.05729%2018.3305%209.17187C18.5509%209.28646%2018.7173%209.44401%2018.8295%209.64453C18.9432%209.84375%2019%2010.0703%2019%2010.3242C19%2010.5807%2018.9432%2010.8086%2018.8295%2011.0078C18.7159%2011.207%2018.5482%2011.3639%2018.3263%2011.4785C18.1045%2011.5918%2017.8314%2011.6484%2017.5069%2011.6484H16.4615V11.0527H17.4042C17.5931%2011.0527%2017.7479%2011.0215%2017.8684%2010.959C17.9888%2010.8965%2018.0778%2010.8105%2018.1353%2010.7012C18.1942%2010.5918%2018.2237%2010.4661%2018.2237%2010.3242C18.2237%2010.1823%2018.1942%2010.0573%2018.1353%209.94922C18.0778%209.84115%2017.9882%209.75716%2017.8663%209.69727C17.7458%209.63607%2017.5904%209.60547%2017.4001%209.60547H16.7018V12.619C16.7018%2012.8294%2016.5312%2013%2016.3208%2013V13Z%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Ccircle%20cx%3D%224.5%22%20cy%3D%224.5%22%20r%3D%220.5%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Ccircle%20cx%3D%226.5%22%20cy%3D%224.5%22%20r%3D%220.5%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Ccircle%20cx%3D%228.5%22%20cy%3D%224.5%22%20r%3D%220.5%22%20fill%3D%22%231D2632%22%2F%3E%0A%3Cpath%20d%3D%22M10%2022H4C2.89543%2022%202%2021.1046%202%2020V7M22%2012V7M2%207V4C2%202.89543%202.89543%202%204%202H20C21.1046%202%2022%202.89543%2022%204V7M2%207H22%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.5006%2015C16.5673%2015%2015.0001%2016.567%2015.0001%2018.5C15.0001%2020.433%2016.5673%2022%2018.5006%2022C20.4338%2022%2022.001%2020.433%2022.001%2018.5C22.001%2016.567%2020.4338%2015%2018.5006%2015ZM14%2018.5C14%2016.0147%2016.015%2014%2018.5006%2014C20.9862%2014%2023.0011%2016.0147%2023.0011%2018.5C23.0011%2020.9853%2020.9862%2023%2018.5006%2023C16.015%2023%2014%2020.9853%2014%2018.5Z%22%20fill%3D%22%231D2632%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.2%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%0A%3Cpath%20d%3D%22M18.6508%2021L19.6157%2016H20.4199L19.4549%2021H18.6508ZM16%2019.7109L16.135%2019.0273H20.6611L20.5261%2019.7109H16ZM16.583%2021L17.548%2016H18.3521L17.3871%2021H16.583ZM16.3418%2017.9727L16.4739%2017.2891H21L20.8679%2017.9727H16.3418Z%22%20fill%3D%22%231D2632%22%20stroke%3D%22%231D2632%22%20stroke-width%3D%220.2%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A" ) var ( diff --git a/exthttpcheck/discovery.go b/exthttpcheck/discovery.go new file mode 100644 index 0000000..ab945c8 --- /dev/null +++ b/exthttpcheck/discovery.go @@ -0,0 +1,97 @@ +// SPDX-License-Identifier: MIT +// SPDX-FileCopyrightText: 2024 Steadybit GmbH + +package exthttpcheck + +import ( + "context" + "fmt" + "github.com/steadybit/discovery-kit/go/discovery_kit_api" + "github.com/steadybit/discovery-kit/go/discovery_kit_sdk" + "github.com/steadybit/extension-http/config" + "github.com/steadybit/extension-kit/extbuild" + "github.com/steadybit/extension-kit/extutil" + "os" +) + +type httpClientLocationDiscovery struct{} + +var ( + _ discovery_kit_sdk.TargetDescriber = (*httpClientLocationDiscovery)(nil) +) + +func NewDiscovery() discovery_kit_sdk.TargetDiscovery { + discovery := &httpClientLocationDiscovery{} + return discovery_kit_sdk.NewCachedTargetDiscovery(discovery, + discovery_kit_sdk.WithRefreshTargetsNow(), + //No interval, target is not changing during runtime + ) +} + +func (e *httpClientLocationDiscovery) Describe() discovery_kit_api.DiscoveryDescription { + return discovery_kit_api.DiscoveryDescription{ + Id: targetType, + Discover: discovery_kit_api.DescribingEndpointReferenceWithCallInterval{ + CallInterval: extutil.Ptr(fmt.Sprintf("%ds", 300)), + }, + } +} + +func (e *httpClientLocationDiscovery) DescribeTarget() discovery_kit_api.TargetDescription { + return discovery_kit_api.TargetDescription{ + Id: targetType, + Label: discovery_kit_api.PluralLabel{One: "HTTP Client Location", Other: "HTTP Client Locations"}, + Category: extutil.Ptr("check"), + Version: extbuild.GetSemverVersionStringOrUnknown(), + Icon: extutil.Ptr(targetIcon), + + Table: discovery_kit_api.Table{ + Columns: []discovery_kit_api.Column{ + {Attribute: "k8s.cluster-name"}, + {Attribute: "k8s.namespace"}, + {Attribute: "aws.account", FallbackAttributes: &[]string{"gcp.project.id", "azure.subscription.id"}}, + {Attribute: "aws.zone", FallbackAttributes: &[]string{"google.zone", "azure.zone"}}, + }, + OrderBy: []discovery_kit_api.OrderBy{ + { + Attribute: "k8s.cluster-name", + Direction: "ASC", + }, + }, + }, + } +} + +func (e *httpClientLocationDiscovery) DiscoverTargets(ctx context.Context) ([]discovery_kit_api.Target, error) { + attributes := make(map[string][]string) + + var id, label string + if (config.Config.KubernetesNamespace != "") && (config.Config.KubernetesPodName != "") && (config.Config.KubernetesNodeName != "") { + id = fmt.Sprintf("%s-%s", config.Config.KubernetesNamespace, config.Config.KubernetesPodName) + label = fmt.Sprintf("%s/%s", config.Config.KubernetesNamespace, config.Config.KubernetesPodName) + attributes["k8s.namespace"] = []string{config.Config.KubernetesNamespace} + attributes["k8s.pod.name"] = []string{config.Config.KubernetesPodName} + attributes["k8s.node.name"] = []string{config.Config.KubernetesNodeName} + attributes["host.hostname"] = []string{config.Config.KubernetesPodName} + } else { + hostname, _ := os.Hostname() + pid := os.Getpid() + id = fmt.Sprintf("%s-%d", hostname, pid) + label = fmt.Sprintf("%s/%d", hostname, pid) + attributes["host.hostname"] = []string{hostname} + attributes["process.pid"] = []string{fmt.Sprintf("%d", pid)} + } + + if config.Config.KubernetesClusterName != "" { + attributes["k8s.cluster-name"] = []string{config.Config.KubernetesClusterName} + } + + return []discovery_kit_api.Target{ + { + Id: id, + Label: label, + TargetType: targetType, + Attributes: attributes, + }, + }, nil +} diff --git a/exthttpcheck/fixAmount.go b/exthttpcheck/fixAmount.go index bcf44bd..290341d 100644 --- a/exthttpcheck/fixAmount.go +++ b/exthttpcheck/fixAmount.go @@ -36,11 +36,11 @@ func (l *httpCheckActionFixedAmount) NewEmptyState() HTTPCheckState { // Describe returns the action description for the platform with all required information. func (l *httpCheckActionFixedAmount) Describe() action_kit_api.ActionDescription { return action_kit_api.ActionDescription{ - Id: TargetIDFixedAmount, + Id: ActionIDFixedAmount, Label: "HTTP (# of Requests)", Description: "Calls an http endpoint a specified number of times and checks the response", Version: extbuild.GetSemverVersionStringOrUnknown(), - Icon: extutil.Ptr(targetIconFixedAmount), + Icon: extutil.Ptr(actionIconFixedAmount), Widgets: extutil.Ptr([]action_kit_api.Widget{ action_kit_api.PredefinedWidget{ Type: action_kit_api.ComSteadybitWidgetPredefined, diff --git a/exthttpcheck/periodically.go b/exthttpcheck/periodically.go index 2791403..dfc811c 100644 --- a/exthttpcheck/periodically.go +++ b/exthttpcheck/periodically.go @@ -35,11 +35,11 @@ func (l *httpCheckActionPeriodically) NewEmptyState() HTTPCheckState { // Describe returns the action description for the platform with all required information. func (l *httpCheckActionPeriodically) Describe() action_kit_api.ActionDescription { return action_kit_api.ActionDescription{ - Id: TargetIDPeriodically, + Id: ActionIDPeriodically, Label: "HTTP (Requests / s)", Description: "Calls a http endpoint periodically (requests / s) and checks the response", Version: extbuild.GetSemverVersionStringOrUnknown(), - Icon: extutil.Ptr(targetIconPeriodically), + Icon: extutil.Ptr(actionIconPeriodically), Widgets: extutil.Ptr([]action_kit_api.Widget{ action_kit_api.PredefinedWidget{ Type: action_kit_api.ComSteadybitWidgetPredefined, diff --git a/go.mod b/go.mod index 8d67f73..218b759 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,9 @@ require ( github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.4 github.com/steadybit/action-kit/go/action_kit_sdk v1.1.14 github.com/steadybit/action-kit/go/action_kit_test v1.3.0 + github.com/steadybit/discovery-kit/go/discovery_kit_api v1.6.0 + github.com/steadybit/discovery-kit/go/discovery_kit_commons v0.2.0 + github.com/steadybit/discovery-kit/go/discovery_kit_sdk v1.2.1 github.com/steadybit/extension-kit v1.8.22 github.com/stretchr/testify v1.9.0 go.uber.org/automaxprocs v1.6.0 @@ -63,11 +66,11 @@ require ( github.com/rs/xid v1.6.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/steadybit/discovery-kit/go/discovery_kit_api v1.6.0 // indirect github.com/steadybit/discovery-kit/go/discovery_kit_test v1.1.2 // indirect github.com/ugorji/go/codec v1.2.12 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 // indirect + github.com/zmwangx/debounce v1.0.0 // indirect golang.org/x/net v0.30.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sync v0.8.0 // indirect diff --git a/go.sum b/go.sum index 09252c8..8907ec9 100644 --- a/go.sum +++ b/go.sum @@ -63,6 +63,8 @@ github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQu github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g= +github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= @@ -80,6 +82,8 @@ github.com/jsimonetti/rtnetlink/v2 v2.0.1 h1:xda7qaHDSVOsADNouv7ukSuicKZO7GgVUCX github.com/jsimonetti/rtnetlink/v2 v2.0.1/go.mod h1:7MoNYNbb3UaDHtF8udiJo/RH6VsTKP1pqKLUTVCvToE= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= @@ -148,6 +152,10 @@ github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/smartystreets/assertions v1.13.1 h1:Ef7KhSmjZcK6AVf9YbJdvPYG9avaF0ZxudX+ThRdWfU= +github.com/smartystreets/assertions v1.13.1/go.mod h1:cXr/IwVfSo/RbCSPhoAPv73p3hlSdrBH/b3SdnW/LMY= +github.com/smartystreets/goconvey v1.8.0 h1:Oi49ha/2MURE0WexF052Z0m+BNSGirfjg5RL+JXWq3w= +github.com/smartystreets/goconvey v1.8.0/go.mod h1:EdX8jtrTIj26jmjCOVNMVSIYAtgexqXKHOXW2Dx9JLg= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= @@ -159,11 +167,17 @@ github.com/steadybit/action-kit/go/action_kit_test v1.3.0 h1:PZ8BfKQyFlFmbOcrp0P github.com/steadybit/action-kit/go/action_kit_test v1.3.0/go.mod h1:R4L0LaZ60cE/pUOOrl3FoFgXNF1jT1tfQOWqJRdszbg= github.com/steadybit/discovery-kit/go/discovery_kit_api v1.6.0 h1:q24S067wJ7uUZsi9LcccDJIEdsk9Ikss15hbqAt/OuE= github.com/steadybit/discovery-kit/go/discovery_kit_api v1.6.0/go.mod h1:kGpQOWXnHTOle5c73wganP/iBXeVqEfD3mQYMvJJskI= +github.com/steadybit/discovery-kit/go/discovery_kit_commons v0.2.0 h1:vhi6HK60UDBYOa7p9GKnwcq0BpBOemmjC63ZmRb+1O4= +github.com/steadybit/discovery-kit/go/discovery_kit_commons v0.2.0/go.mod h1:ls7es3pBOMqLJyCWEtepREVLqADvJeoNkVLXUjkPZ9k= +github.com/steadybit/discovery-kit/go/discovery_kit_sdk v1.2.1 h1:M2OX0sMGE+CnSBuZd37FScOxOI8UBDdqV9ZKAIcS1bw= +github.com/steadybit/discovery-kit/go/discovery_kit_sdk v1.2.1/go.mod h1:dEJgg7BcW0E8pGMjpqtDU7m0lN6d38ievgFEUG39cxE= github.com/steadybit/discovery-kit/go/discovery_kit_test v1.1.2 h1:IrTUwb69FDwOt/8OvY1Lvhv+qGNmy+Eu53HEjmsj0TA= github.com/steadybit/discovery-kit/go/discovery_kit_test v1.1.2/go.mod h1:tr4oRjpqr2WOKwO4auJR+/m+YKA2EAUuvvpbz1faUxw= github.com/steadybit/extension-kit v1.8.22 h1:rowDG0kBeTQi+lB9vGxi08HH6E+dEJ8vLjyKYREh9Bs= github.com/steadybit/extension-kit v1.8.22/go.mod h1:Ym+tCgtMCcTw7iv/aPwB64E4/2WT8gsfYUIyb3kx+9g= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= @@ -176,6 +190,8 @@ github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJx github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/zmwangx/debounce v1.0.0 h1:Dyf+WfLESjc2bqFKHgI1dZTW9oh6CJm8SBDkhXrwLB4= +github.com/zmwangx/debounce v1.0.0/go.mod h1:U+/QHt+bSMdUh8XKOb6U+MQV5Ew4eS8M3ua5WJ7Ns6I= go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs= go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= diff --git a/main.go b/main.go index 7134c66..9bd6bc0 100644 --- a/main.go +++ b/main.go @@ -9,6 +9,8 @@ import ( "github.com/rs/zerolog" "github.com/steadybit/action-kit/go/action_kit_api/v2" "github.com/steadybit/action-kit/go/action_kit_sdk" + "github.com/steadybit/discovery-kit/go/discovery_kit_api" + "github.com/steadybit/discovery-kit/go/discovery_kit_sdk" "github.com/steadybit/extension-http/config" "github.com/steadybit/extension-http/exthttpcheck" "github.com/steadybit/extension-kit/extbuild" @@ -52,6 +54,7 @@ func main() { action_kit_sdk.RegisterAction(exthttpcheck.NewHTTPCheckActionFixedAmount()) action_kit_sdk.RegisterAction(exthttpcheck.NewHTTPCheckActionPeriodically()) + discovery_kit_sdk.Register(exthttpcheck.NewDiscovery()) //This will install a signal handlder, that will stop active actions when receiving a SIGURS1, SIGTERM or SIGINT extsignals.ActivateSignalHandlers() @@ -71,7 +74,8 @@ func main() { // ExtensionListResponse exists to merge the possible root path responses supported by the // various extension kits. In this case, the response for ActionKit, DiscoveryKit and EventKit. type ExtensionListResponse struct { - action_kit_api.ActionList `json:",inline"` + action_kit_api.ActionList `json:",inline"` + discovery_kit_api.DiscoveryList `json:",inline"` } func getExtensionList() ExtensionListResponse { @@ -79,5 +83,8 @@ func getExtensionList() ExtensionListResponse { // See this document to learn more about the action list: // https://github.com/steadybit/action-kit/blob/main/docs/action-api.md#action-list ActionList: action_kit_sdk.GetActionList(), + // See this document to learn more about the discovery list: + // https://github.com/steadybit/discovery-kit/blob/main/docs/discovery-api.md#index-response + DiscoveryList: discovery_kit_sdk.GetDiscoveryList(), } } From 32b01b34e7b1c0d5ec843254f52375bfd8774b5a Mon Sep 17 00:00:00 2001 From: Daniel Reuter Date: Fri, 15 Nov 2024 07:56:35 +0100 Subject: [PATCH 09/33] feat: Location selection for http checks --- exthttpcheck/discovery.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exthttpcheck/discovery.go b/exthttpcheck/discovery.go index ab945c8..7900b72 100644 --- a/exthttpcheck/discovery.go +++ b/exthttpcheck/discovery.go @@ -72,7 +72,7 @@ func (e *httpClientLocationDiscovery) DiscoverTargets(ctx context.Context) ([]di attributes["k8s.namespace"] = []string{config.Config.KubernetesNamespace} attributes["k8s.pod.name"] = []string{config.Config.KubernetesPodName} attributes["k8s.node.name"] = []string{config.Config.KubernetesNodeName} - attributes["host.hostname"] = []string{config.Config.KubernetesPodName} + attributes["host.hostname"] = []string{config.Config.KubernetesNodeName} } else { hostname, _ := os.Hostname() pid := os.Getpid() From a390f3cf8b9387ee6b31493949095bf5ffafaa12 Mon Sep 17 00:00:00 2001 From: Daniel Reuter Date: Fri, 15 Nov 2024 08:33:09 +0100 Subject: [PATCH 10/33] feat: Location selection for http checks --- exthttpcheck/discovery.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exthttpcheck/discovery.go b/exthttpcheck/discovery.go index 7900b72..74026c0 100644 --- a/exthttpcheck/discovery.go +++ b/exthttpcheck/discovery.go @@ -50,7 +50,7 @@ func (e *httpClientLocationDiscovery) DescribeTarget() discovery_kit_api.TargetD {Attribute: "k8s.cluster-name"}, {Attribute: "k8s.namespace"}, {Attribute: "aws.account", FallbackAttributes: &[]string{"gcp.project.id", "azure.subscription.id"}}, - {Attribute: "aws.zone", FallbackAttributes: &[]string{"google.zone", "azure.zone"}}, + {Attribute: "aws.zone", FallbackAttributes: &[]string{"gcp.zone", "azure.zone"}}, }, OrderBy: []discovery_kit_api.OrderBy{ { From 234ed467c33042f78e8af323389ae6f2bd75f9c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 03:14:00 +0000 Subject: [PATCH 11/33] build(deps): bump goreleaser/goreleaser from v2.4.4 to v2.4.6 Bumps goreleaser/goreleaser from v2.4.4 to v2.4.6. --- updated-dependencies: - dependency-name: goreleaser/goreleaser dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 719ee62..5028b53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ## ## Build ## -FROM --platform=$BUILDPLATFORM goreleaser/goreleaser:v2.4.4 AS build +FROM --platform=$BUILDPLATFORM goreleaser/goreleaser:v2.4.6 AS build ARG TARGETOS TARGETARCH ARG BUILD_WITH_COVERAGE From 038c2f7ae5586061fdd300d5727e79c328e1ead4 Mon Sep 17 00:00:00 2001 From: Daniel Reuter Date: Wed, 20 Nov 2024 09:22:52 +0100 Subject: [PATCH 12/33] feat: location selection for http checks --- CHANGELOG.md | 2 +- charts/steadybit-extension-http/Chart.yaml | 2 +- .../templates/deployment.yaml | 4 + .../__snapshot__/deployment_test.yaml.snap | 86 +++++++++++++++++++ .../tests/deployment_test.yaml | 6 +- charts/steadybit-extension-http/values.yaml | 3 + config/config.go | 9 +- exthttpcheck/common.go | 70 ++++++++++----- exthttpcheck/fixAmount.go | 41 ++++++--- exthttpcheck/periodically.go | 40 +++++++-- go.mod | 3 +- go.sum | 6 +- 12 files changed, 216 insertions(+), 56 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e56654..47adc2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## v1.0.23 (next release) -- Location selection for http checks +- Location selection for http checks (can be enabled via STEADYBIT_EXTENSION_ENABLE_LOCATION_SELECTION env var, requires platform => 2.1.25) ## v1.0.22 diff --git a/charts/steadybit-extension-http/Chart.yaml b/charts/steadybit-extension-http/Chart.yaml index 30d41fa..f1bdb89 100644 --- a/charts/steadybit-extension-http/Chart.yaml +++ b/charts/steadybit-extension-http/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: steadybit-extension-http description: Steadybit action implementation to check HTTP endpoints. -version: 1.1.11 +version: 1.1.12 appVersion: v1.0.22 home: https://www.steadybit.com/ icon: https://steadybit-website-assets.s3.amazonaws.com/logo-symbol-transparent.png diff --git a/charts/steadybit-extension-http/templates/deployment.yaml b/charts/steadybit-extension-http/templates/deployment.yaml index ecb42c1..b0e875d 100644 --- a/charts/steadybit-extension-http/templates/deployment.yaml +++ b/charts/steadybit-extension-http/templates/deployment.yaml @@ -59,6 +59,10 @@ spec: - name: STEADYBIT_EXTENSION_KUBERNETES_CLUSTER_NAME value: {{ if and .Values.global .Values.global.clusterName }}{{ .Values.global.clusterName | quote }}{{ else }}{{ .Values.kubernetes.clusterName }}{{ end }} {{- end }} + {{ if .Values.enableLocationSelection }} + - name: STEADYBIT_EXTENSION_ENABLE_LOCATION_SELECTION + value: "true" + {{- end }} - name: STEADYBIT_EXTENSION_KUBERNETES_NODE_NAME valueFrom: fieldRef: diff --git a/charts/steadybit-extension-http/tests/__snapshot__/deployment_test.yaml.snap b/charts/steadybit-extension-http/tests/__snapshot__/deployment_test.yaml.snap index be50038..1043f25 100644 --- a/charts/steadybit-extension-http/tests/__snapshot__/deployment_test.yaml.snap +++ b/charts/steadybit-extension-http/tests/__snapshot__/deployment_test.yaml.snap @@ -977,3 +977,89 @@ should add cluster name from local values: volumeMounts: null serviceAccountName: steadybit-extension-http volumes: null +should enable location selection: + 1: | + apiVersion: apps/v1 + kind: Deployment + metadata: + labels: + steadybit.com/discovery-disabled: "true" + steadybit.com/extension: "true" + name: RELEASE-NAME-steadybit-extension-http + namespace: NAMESPACE + spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/instance: RELEASE-NAME + app.kubernetes.io/name: steadybit-extension-http + template: + metadata: + annotations: + oneagent.dynatrace.com/injection: "false" + labels: + app.kubernetes.io/instance: RELEASE-NAME + app.kubernetes.io/name: steadybit-extension-http + steadybit.com/discovery-disabled: "true" + steadybit.com/extension: "true" + spec: + containers: + - env: + - name: STEADYBIT_EXTENSION_ENABLE_LOCATION_SELECTION + value: "true" + - name: STEADYBIT_EXTENSION_KUBERNETES_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: STEADYBIT_EXTENSION_KUBERNETES_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: STEADYBIT_EXTENSION_KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: STEADYBIT_LOG_LEVEL + value: INFO + - name: STEADYBIT_LOG_FORMAT + value: text + image: ghcr.io/steadybit/extension-http:v0.0.0 + imagePullPolicy: IfNotPresent + livenessProbe: + failureThreshold: 5 + httpGet: + path: /health/liveness + port: 8081 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + name: extension + readinessProbe: + failureThreshold: 3 + httpGet: + path: /health/readiness + port: 8081 + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + resources: + limits: + cpu: 200m + memory: 128Mi + requests: + cpu: 50m + memory: 32Mi + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsGroup: 10000 + runAsNonRoot: true + runAsUser: 10000 + volumeMounts: null + serviceAccountName: steadybit-extension-http + volumes: null diff --git a/charts/steadybit-extension-http/tests/deployment_test.yaml b/charts/steadybit-extension-http/tests/deployment_test.yaml index 65377cc..0879953 100644 --- a/charts/steadybit-extension-http/tests/deployment_test.yaml +++ b/charts/steadybit-extension-http/tests/deployment_test.yaml @@ -91,4 +91,8 @@ tests: clusterName: beautiful-cluster asserts: - matchSnapshot: {} - + - it: should enable location selection + set: + enableLocationSelection: true + asserts: + - matchSnapshot: {} diff --git a/charts/steadybit-extension-http/values.yaml b/charts/steadybit-extension-http/values.yaml index c3561d5..6f69980 100644 --- a/charts/steadybit-extension-http/values.yaml +++ b/charts/steadybit-extension-http/values.yaml @@ -6,6 +6,9 @@ kubernetes: # kubernetes.clusterName -- The name of the kubernetes cluster (if not set, the global.clusterName will be used) clusterName: null +# enableLocationSelection -- Specifies whether the extension should allow the user to select a location for the http checks. This requires platform >= 2.1.25 +enableLocationSelection: false + image: # image.name -- The container image to use for the Steadybit scaffold extension. name: ghcr.io/steadybit/extension-http diff --git a/config/config.go b/config/config.go index 4d847d8..5021863 100644 --- a/config/config.go +++ b/config/config.go @@ -13,10 +13,11 @@ import ( // through environment variables. Learn more through the documentation of the envconfig package. // https://github.com/kelseyhightower/envconfig type Specification struct { - KubernetesClusterName string `json:"kubernetesClusterName" split_words:"true" required:"false"` - KubernetesNodeName string `json:"kubernetesNodeName" split_words:"true" required:"false"` - KubernetesPodName string `json:"kubernetesPodName" split_words:"true" required:"false"` - KubernetesNamespace string `json:"kubernetesNamespace" split_words:"true" required:"false"` + KubernetesClusterName string `json:"kubernetesClusterName" split_words:"true" required:"false"` + KubernetesNodeName string `json:"kubernetesNodeName" split_words:"true" required:"false"` + KubernetesPodName string `json:"kubernetesPodName" split_words:"true" required:"false"` + KubernetesNamespace string `json:"kubernetesNamespace" split_words:"true" required:"false"` + EnableLocationSelection bool `json:"enableLocationSelection" split_words:"true" required:"false"` } var ( diff --git a/exthttpcheck/common.go b/exthttpcheck/common.go index a510b52..bf41e89 100644 --- a/exthttpcheck/common.go +++ b/exthttpcheck/common.go @@ -17,17 +17,26 @@ const ( ) var ( + targetSelection = extutil.Ptr(action_kit_api.TargetSelection{ + TargetType: targetType, + DefaultBlastRadius: extutil.Ptr(action_kit_api.DefaultBlastRadius{ + Mode: action_kit_api.DefaultBlastRadiusModeMaximum, + Value: 1, + }), + MissingQuerySelection: extutil.Ptr(action_kit_api.MissingQuerySelectionIncludeAll), + }) + requestDefinition = action_kit_api.ActionParameter{ Name: "requestDefinition", Label: "Request Definition", - Type: action_kit_api.Header, + Type: action_kit_api.ActionParameterTypeHeader, Order: extutil.Ptr(0), } method = action_kit_api.ActionParameter{ Name: "method", Label: "HTTP Method", Description: extutil.Ptr("The HTTP method to use."), - Type: action_kit_api.String, + Type: action_kit_api.ActionParameterTypeString, DefaultValue: extutil.Ptr("GET"), Required: extutil.Ptr(true), Order: extutil.Ptr(1), @@ -62,7 +71,7 @@ var ( Name: "url", Label: "Target URL", Description: extutil.Ptr("The URL to check."), - Type: action_kit_api.Url, + Type: action_kit_api.ActionParameterTypeUrl, Required: extutil.Ptr(true), Order: extutil.Ptr(2), } @@ -70,27 +79,27 @@ var ( Name: "body", Label: "HTTP Body", Description: extutil.Ptr("The HTTP Body."), - Type: action_kit_api.Textarea, + Type: action_kit_api.ActionParameterTypeTextarea, Order: extutil.Ptr(3), } headers = action_kit_api.ActionParameter{ Name: "headers", Label: "HTTP Headers", Description: extutil.Ptr("The HTTP Headers."), - Type: action_kit_api.KeyValue, + Type: action_kit_api.ActionParameterTypeKeyValue, Order: extutil.Ptr(4), } repetitionControl = action_kit_api.ActionParameter{ Name: "repetitionControl", Label: "Repetition Control", - Type: action_kit_api.Header, + Type: action_kit_api.ActionParameterTypeHeader, Order: extutil.Ptr(6), } duration = action_kit_api.ActionParameter{ Name: "duration", Label: "Duration", Description: extutil.Ptr("In which timeframe should the specified requests be executed?"), - Type: action_kit_api.Duration, + Type: action_kit_api.ActionParameterTypeDuration, DefaultValue: extutil.Ptr("10s"), Required: extutil.Ptr(true), Order: extutil.Ptr(8), @@ -98,14 +107,14 @@ var ( resultVerification = action_kit_api.ActionParameter{ Name: "resultVerification", Label: "Result Verification", - Type: action_kit_api.Header, + Type: action_kit_api.ActionParameterTypeHeader, Order: extutil.Ptr(10), } successRate = action_kit_api.ActionParameter{ Name: "successRate", Label: "Required Success Rate", Description: extutil.Ptr("How many percent of the Request must be at least successful (in terms of the following response verifications) to continue the experiment execution? The result will be evaluated and the end of the given duration."), - Type: action_kit_api.Percentage, + Type: action_kit_api.ActionParameterTypePercentage, DefaultValue: extutil.Ptr("100"), Required: extutil.Ptr(true), Order: extutil.Ptr(11), @@ -116,7 +125,7 @@ var ( Name: "statusCode", Label: "Response status codes", Description: extutil.Ptr("Which HTTP-Status code should be considered as success? This field supports ranges with '-' and multiple codes delimited by ';' for example '200-399;429'."), - Type: action_kit_api.String, + Type: action_kit_api.ActionParameterTypeString, DefaultValue: extutil.Ptr("200-299"), Required: extutil.Ptr(true), Order: extutil.Ptr(12), @@ -125,7 +134,7 @@ var ( Name: "responsesContains", Label: "Responses contains", Description: extutil.Ptr("The Responses needs to contain the given string, otherwise the experiment will fail. The responses will be evaluated and the end of the given duration."), - Type: action_kit_api.String, + Type: action_kit_api.ActionParameterTypeString, Required: extutil.Ptr(false), Order: extutil.Ptr(13), } @@ -133,7 +142,7 @@ var ( Name: "responseTimeMode", Label: "Response Time Verification Mode", Description: extutil.Ptr("Should the Response Time be shorter or longer than the given duration?"), - Type: action_kit_api.String, + Type: action_kit_api.ActionParameterTypeString, Required: extutil.Ptr(false), Order: extutil.Ptr(14), DefaultValue: extutil.Ptr("NO_VERIFICATION"), @@ -156,55 +165,70 @@ var ( Name: "responseTime", Label: "Response Time", Description: extutil.Ptr("The value for the response time verification."), - Type: action_kit_api.Duration, + Type: action_kit_api.ActionParameterTypeDuration, Required: extutil.Ptr(false), Order: extutil.Ptr(15), DefaultValue: extutil.Ptr("500ms"), } + targetSelectionParameter = action_kit_api.ActionParameter{ + Name: "-", + Label: "Filter HTTP Client Locations", + Type: action_kit_api.ActionParameterTypeTargetSelection, + Order: extutil.Ptr(17), + } maxConcurrent = action_kit_api.ActionParameter{ Name: "maxConcurrent", Label: "Max concurrent requests", Description: extutil.Ptr("Maximum count on parallel running requests. (min 1, max 10)"), - Type: action_kit_api.Integer, + Type: action_kit_api.ActionParameterTypeInteger, DefaultValue: extutil.Ptr("5"), Required: extutil.Ptr(true), Advanced: extutil.Ptr(true), - Order: extutil.Ptr(16), + Order: extutil.Ptr(18), } clientSettings = action_kit_api.ActionParameter{ Name: "clientSettings", Label: "HTTP Client Settings", - Type: action_kit_api.Header, + Type: action_kit_api.ActionParameterTypeHeader, Advanced: extutil.Ptr(true), - Order: extutil.Ptr(17), + Order: extutil.Ptr(19), } followRedirects = action_kit_api.ActionParameter{ Name: "followRedirects", Label: "Follow Redirects?", Description: extutil.Ptr("Should Redirects be followed?"), - Type: action_kit_api.Boolean, + Type: action_kit_api.ActionParameterTypeBoolean, Required: extutil.Ptr(true), Advanced: extutil.Ptr(true), - Order: extutil.Ptr(18), + Order: extutil.Ptr(20), } connectTimeout = action_kit_api.ActionParameter{ Name: "connectTimeout", Label: "Connection Timeout", Description: extutil.Ptr("Connection Timeout for a single Call in seconds. Should be between 1 and 10 seconds."), - Type: action_kit_api.Duration, + Type: action_kit_api.ActionParameterTypeDuration, DefaultValue: extutil.Ptr("5s"), Required: extutil.Ptr(true), Advanced: extutil.Ptr(true), - Order: extutil.Ptr(19), + Order: extutil.Ptr(21), } readTimeout = action_kit_api.ActionParameter{ Name: "readTimeout", Label: "Read Timeout", Description: extutil.Ptr("Read Timeout for a single Call in seconds. Should be between 1 and 10 seconds."), - Type: action_kit_api.Duration, + Type: action_kit_api.ActionParameterTypeDuration, DefaultValue: extutil.Ptr("5s"), Required: extutil.Ptr(true), Advanced: extutil.Ptr(true), - Order: extutil.Ptr(20), + Order: extutil.Ptr(22), } ) + +func filter[T any](ss []T, test func(T) bool) (ret []T) { + for _, s := range ss { + if test(s) { + ret = append(ret, s) + } + } + return +} diff --git a/exthttpcheck/fixAmount.go b/exthttpcheck/fixAmount.go index 290341d..6ae4c62 100644 --- a/exthttpcheck/fixAmount.go +++ b/exthttpcheck/fixAmount.go @@ -11,6 +11,7 @@ import ( "github.com/rs/zerolog/log" "github.com/steadybit/action-kit/go/action_kit_api/v2" "github.com/steadybit/action-kit/go/action_kit_sdk" + "github.com/steadybit/extension-http/config" "github.com/steadybit/extension-kit/extbuild" "github.com/steadybit/extension-kit/extutil" ) @@ -35,12 +36,13 @@ func (l *httpCheckActionFixedAmount) NewEmptyState() HTTPCheckState { // Describe returns the action description for the platform with all required information. func (l *httpCheckActionFixedAmount) Describe() action_kit_api.ActionDescription { - return action_kit_api.ActionDescription{ - Id: ActionIDFixedAmount, - Label: "HTTP (# of Requests)", - Description: "Calls an http endpoint a specified number of times and checks the response", - Version: extbuild.GetSemverVersionStringOrUnknown(), - Icon: extutil.Ptr(actionIconFixedAmount), + description := action_kit_api.ActionDescription{ + Id: ActionIDFixedAmount, + Label: "HTTP (# of Requests)", + Description: "Calls an http endpoint a specified number of times and checks the response", + Version: extbuild.GetSemverVersionStringOrUnknown(), + Icon: extutil.Ptr(actionIconFixedAmount), + TargetSelection: targetSelection, Widgets: extutil.Ptr([]action_kit_api.Widget{ action_kit_api.PredefinedWidget{ Type: action_kit_api.ComSteadybitWidgetPredefined, @@ -74,7 +76,7 @@ func (l *httpCheckActionFixedAmount) Describe() action_kit_api.ActionDescription { Name: "-", Label: "-", - Type: action_kit_api.Separator, + Type: action_kit_api.ActionParameterTypeSeparator, Order: extutil.Ptr(5), }, //------------------------ @@ -85,7 +87,7 @@ func (l *httpCheckActionFixedAmount) Describe() action_kit_api.ActionDescription Name: "numberOfRequests", Label: "Number of Requests.", Description: extutil.Ptr("Fixed number of Requests, distributed to given duration"), - Type: action_kit_api.Integer, + Type: action_kit_api.ActionParameterTypeInteger, Required: extutil.Ptr(true), DefaultValue: extutil.Ptr("1"), Order: extutil.Ptr(7), @@ -94,7 +96,7 @@ func (l *httpCheckActionFixedAmount) Describe() action_kit_api.ActionDescription { Name: "-", Label: "-", - Type: action_kit_api.Separator, + Type: action_kit_api.ActionParameterTypeSeparator, Order: extutil.Ptr(9), }, //------------------------ @@ -106,11 +108,19 @@ func (l *httpCheckActionFixedAmount) Describe() action_kit_api.ActionDescription responsesContains, responsesTimeMode, responseTime, - + { + Name: "-", + Label: "-", + Type: action_kit_api.ActionParameterTypeSeparator, + Order: extutil.Ptr(16), + }, + //------------------------ + // Target Selection + //------------------------ + targetSelectionParameter, //------------------------ // Additional Settings //------------------------ - maxConcurrent, clientSettings, followRedirects, @@ -122,6 +132,15 @@ func (l *httpCheckActionFixedAmount) Describe() action_kit_api.ActionDescription }), Stop: extutil.Ptr(action_kit_api.MutatingEndpointReference{}), } + + if !config.Config.EnableLocationSelection { + description.Parameters = filter(description.Parameters, func(p action_kit_api.ActionParameter) bool { + return p.Type != action_kit_api.ActionParameterTypeTargetSelection + }) + description.TargetSelection = nil + } + + return description } func getDelayBetweenRequestsInMsFixedAmount(duration int64, numberOfRequests int64) int64 { diff --git a/exthttpcheck/periodically.go b/exthttpcheck/periodically.go index dfc811c..d1e75ac 100644 --- a/exthttpcheck/periodically.go +++ b/exthttpcheck/periodically.go @@ -10,6 +10,7 @@ import ( "github.com/rs/zerolog/log" "github.com/steadybit/action-kit/go/action_kit_api/v2" "github.com/steadybit/action-kit/go/action_kit_sdk" + "github.com/steadybit/extension-http/config" "github.com/steadybit/extension-kit/extbuild" "github.com/steadybit/extension-kit/extutil" ) @@ -34,12 +35,13 @@ func (l *httpCheckActionPeriodically) NewEmptyState() HTTPCheckState { // Describe returns the action description for the platform with all required information. func (l *httpCheckActionPeriodically) Describe() action_kit_api.ActionDescription { - return action_kit_api.ActionDescription{ - Id: ActionIDPeriodically, - Label: "HTTP (Requests / s)", - Description: "Calls a http endpoint periodically (requests / s) and checks the response", - Version: extbuild.GetSemverVersionStringOrUnknown(), - Icon: extutil.Ptr(actionIconPeriodically), + description := action_kit_api.ActionDescription{ + Id: ActionIDPeriodically, + Label: "HTTP (Requests / s)", + Description: "Calls a http endpoint periodically (requests / s) and checks the response", + Version: extbuild.GetSemverVersionStringOrUnknown(), + Icon: extutil.Ptr(actionIconPeriodically), + TargetSelection: targetSelection, Widgets: extutil.Ptr([]action_kit_api.Widget{ action_kit_api.PredefinedWidget{ Type: action_kit_api.ComSteadybitWidgetPredefined, @@ -73,7 +75,7 @@ func (l *httpCheckActionPeriodically) Describe() action_kit_api.ActionDescriptio { Name: "-", Label: "-", - Type: action_kit_api.Separator, + Type: action_kit_api.ActionParameterTypeSeparator, Order: extutil.Ptr(5), }, //------------------------ @@ -84,7 +86,7 @@ func (l *httpCheckActionPeriodically) Describe() action_kit_api.ActionDescriptio Name: "requestsPerSecond", Label: "Requests per second", Description: extutil.Ptr("The number of requests per second. Should be between 1 and 10."), - Type: action_kit_api.Integer, + Type: action_kit_api.ActionParameterTypeInteger, DefaultValue: extutil.Ptr("1"), Required: extutil.Ptr(true), Order: extutil.Ptr(7), @@ -93,7 +95,7 @@ func (l *httpCheckActionPeriodically) Describe() action_kit_api.ActionDescriptio { Name: "-", Label: "-", - Type: action_kit_api.Separator, + Type: action_kit_api.ActionParameterTypeSeparator, Order: extutil.Ptr(9), }, //------------------------ @@ -105,6 +107,17 @@ func (l *httpCheckActionPeriodically) Describe() action_kit_api.ActionDescriptio responsesContains, responsesTimeMode, responseTime, + { + Name: "-", + Label: "-", + Type: action_kit_api.ActionParameterTypeSeparator, + Order: extutil.Ptr(16), + }, + + //------------------------ + // Target Selection + //------------------------ + targetSelectionParameter, //------------------------ // Additional Settings @@ -121,6 +134,15 @@ func (l *httpCheckActionPeriodically) Describe() action_kit_api.ActionDescriptio }), Stop: extutil.Ptr(action_kit_api.MutatingEndpointReference{}), } + + if !config.Config.EnableLocationSelection { + description.Parameters = filter(description.Parameters, func(p action_kit_api.ActionParameter) bool { + return p.Type != action_kit_api.ActionParameterTypeTargetSelection + }) + description.TargetSelection = nil + } + + return description } func getDelayBetweenRequestsInMsPeriodically(requestsPerSecond int64) int64 { diff --git a/go.mod b/go.mod index 218b759..c63f71c 100644 --- a/go.mod +++ b/go.mod @@ -7,11 +7,10 @@ require ( github.com/google/uuid v1.6.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/rs/zerolog v1.33.0 - github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.4 + github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.6 github.com/steadybit/action-kit/go/action_kit_sdk v1.1.14 github.com/steadybit/action-kit/go/action_kit_test v1.3.0 github.com/steadybit/discovery-kit/go/discovery_kit_api v1.6.0 - github.com/steadybit/discovery-kit/go/discovery_kit_commons v0.2.0 github.com/steadybit/discovery-kit/go/discovery_kit_sdk v1.2.1 github.com/steadybit/extension-kit v1.8.22 github.com/stretchr/testify v1.9.0 diff --git a/go.sum b/go.sum index 8907ec9..a3deac4 100644 --- a/go.sum +++ b/go.sum @@ -159,16 +159,14 @@ github.com/smartystreets/goconvey v1.8.0/go.mod h1:EdX8jtrTIj26jmjCOVNMVSIYAtgex github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= -github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.4 h1:imlfn0m5FEwZ3/ad75TgI5DoGQD4ztnSoLfPR4afqUY= -github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.4/go.mod h1:ycF2RLgRsB8I/jD52aE+dKZKVru1GIEtmkcRcIR3vXk= +github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.6 h1:Qci7Numf66mjCIRo7KDwHUimIxUZzq+GBfyv/1f/QCU= +github.com/steadybit/action-kit/go/action_kit_api/v2 v2.9.6/go.mod h1:ycF2RLgRsB8I/jD52aE+dKZKVru1GIEtmkcRcIR3vXk= github.com/steadybit/action-kit/go/action_kit_sdk v1.1.14 h1:x94RX+vh9Iyc0tS6BhiSpvknj+xE36AV0Nc3D5Yuub0= github.com/steadybit/action-kit/go/action_kit_sdk v1.1.14/go.mod h1:Tp/klK5b7k+BCvb3JTSDZSNcnpFBaHauhndzOarnMW4= github.com/steadybit/action-kit/go/action_kit_test v1.3.0 h1:PZ8BfKQyFlFmbOcrp0PKHjHFT3S8y3mOBTGo/mGQcAE= github.com/steadybit/action-kit/go/action_kit_test v1.3.0/go.mod h1:R4L0LaZ60cE/pUOOrl3FoFgXNF1jT1tfQOWqJRdszbg= github.com/steadybit/discovery-kit/go/discovery_kit_api v1.6.0 h1:q24S067wJ7uUZsi9LcccDJIEdsk9Ikss15hbqAt/OuE= github.com/steadybit/discovery-kit/go/discovery_kit_api v1.6.0/go.mod h1:kGpQOWXnHTOle5c73wganP/iBXeVqEfD3mQYMvJJskI= -github.com/steadybit/discovery-kit/go/discovery_kit_commons v0.2.0 h1:vhi6HK60UDBYOa7p9GKnwcq0BpBOemmjC63ZmRb+1O4= -github.com/steadybit/discovery-kit/go/discovery_kit_commons v0.2.0/go.mod h1:ls7es3pBOMqLJyCWEtepREVLqADvJeoNkVLXUjkPZ9k= github.com/steadybit/discovery-kit/go/discovery_kit_sdk v1.2.1 h1:M2OX0sMGE+CnSBuZd37FScOxOI8UBDdqV9ZKAIcS1bw= github.com/steadybit/discovery-kit/go/discovery_kit_sdk v1.2.1/go.mod h1:dEJgg7BcW0E8pGMjpqtDU7m0lN6d38ievgFEUG39cxE= github.com/steadybit/discovery-kit/go/discovery_kit_test v1.1.2 h1:IrTUwb69FDwOt/8OvY1Lvhv+qGNmy+Eu53HEjmsj0TA= From 0e73dc2f548c91aa32d0c5175a5e77a9c0f25b37 Mon Sep 17 00:00:00 2001 From: Daniel Reuter Date: Wed, 20 Nov 2024 13:57:11 +0100 Subject: [PATCH 13/33] build: ignore deprecation warnings --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fc7c904..8b9a7fc 100755 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ tidy: .PHONY: audit audit: go vet ./... - go run honnef.co/go/tools/cmd/staticcheck@latest -checks=all,-ST1000,-ST1003,-U1000 ./... + go run honnef.co/go/tools/cmd/staticcheck@latest -checks=all,-SA1019,-ST1000,-ST1003,-U1000 ./... go test -race -vet=off -coverprofile=coverage.out -timeout 30m ./... go mod verify From daf98f568334fa825836dc7318de35d5eb4a9fa7 Mon Sep 17 00:00:00 2001 From: Daniel Reuter Date: Wed, 20 Nov 2024 16:15:45 +0100 Subject: [PATCH 14/33] chore: minor code fixes --- charts/steadybit-extension-http/Chart.yaml | 2 +- charts/steadybit-extension-http/templates/deployment.yaml | 8 ++++---- exthttpcheck/discovery.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/steadybit-extension-http/Chart.yaml b/charts/steadybit-extension-http/Chart.yaml index f1bdb89..e26ec81 100644 --- a/charts/steadybit-extension-http/Chart.yaml +++ b/charts/steadybit-extension-http/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: steadybit-extension-http description: Steadybit action implementation to check HTTP endpoints. -version: 1.1.12 +version: 1.1.13 appVersion: v1.0.22 home: https://www.steadybit.com/ icon: https://steadybit-website-assets.s3.amazonaws.com/logo-symbol-transparent.png diff --git a/charts/steadybit-extension-http/templates/deployment.yaml b/charts/steadybit-extension-http/templates/deployment.yaml index b0e875d..24f74ea 100644 --- a/charts/steadybit-extension-http/templates/deployment.yaml +++ b/charts/steadybit-extension-http/templates/deployment.yaml @@ -55,14 +55,14 @@ spec: memory: {{ .Values.resources.limits.memory }} cpu: {{ .Values.resources.limits.cpu }} env: - {{ if or (and .Values.global .Values.global.clusterName) .Values.kubernetes.clusterName }} - - name: STEADYBIT_EXTENSION_KUBERNETES_CLUSTER_NAME - value: {{ if and .Values.global .Values.global.clusterName }}{{ .Values.global.clusterName | quote }}{{ else }}{{ .Values.kubernetes.clusterName }}{{ end }} - {{- end }} {{ if .Values.enableLocationSelection }} - name: STEADYBIT_EXTENSION_ENABLE_LOCATION_SELECTION value: "true" {{- end }} + {{ if or (and .Values.global .Values.global.clusterName) .Values.kubernetes.clusterName }} + - name: STEADYBIT_EXTENSION_KUBERNETES_CLUSTER_NAME + value: {{ if and .Values.global .Values.global.clusterName }}{{ .Values.global.clusterName | quote }}{{ else }}{{ .Values.kubernetes.clusterName }}{{ end }} + {{- end }} - name: STEADYBIT_EXTENSION_KUBERNETES_NODE_NAME valueFrom: fieldRef: diff --git a/exthttpcheck/discovery.go b/exthttpcheck/discovery.go index 74026c0..79da251 100644 --- a/exthttpcheck/discovery.go +++ b/exthttpcheck/discovery.go @@ -62,7 +62,7 @@ func (e *httpClientLocationDiscovery) DescribeTarget() discovery_kit_api.TargetD } } -func (e *httpClientLocationDiscovery) DiscoverTargets(ctx context.Context) ([]discovery_kit_api.Target, error) { +func (e *httpClientLocationDiscovery) DiscoverTargets(_ context.Context) ([]discovery_kit_api.Target, error) { attributes := make(map[string][]string) var id, label string From 7754d189b5952cc5bbe8abda2baa5e81214d4797 Mon Sep 17 00:00:00 2001 From: Daniel Reuter Date: Wed, 20 Nov 2024 16:43:22 +0100 Subject: [PATCH 15/33] chore: rename locations target category --- exthttpcheck/discovery.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exthttpcheck/discovery.go b/exthttpcheck/discovery.go index 79da251..815f0f9 100644 --- a/exthttpcheck/discovery.go +++ b/exthttpcheck/discovery.go @@ -41,7 +41,7 @@ func (e *httpClientLocationDiscovery) DescribeTarget() discovery_kit_api.TargetD return discovery_kit_api.TargetDescription{ Id: targetType, Label: discovery_kit_api.PluralLabel{One: "HTTP Client Location", Other: "HTTP Client Locations"}, - Category: extutil.Ptr("check"), + Category: extutil.Ptr("execution locations"), Version: extbuild.GetSemverVersionStringOrUnknown(), Icon: extutil.Ptr(targetIcon), From 1c0bd04e36bb21f39f568be6cf415f68c16df176 Mon Sep 17 00:00:00 2001 From: Daniel Reuter Date: Thu, 21 Nov 2024 06:59:05 +0100 Subject: [PATCH 16/33] fix: sonar - deduplicate some code --- exthttpcheck/common.go | 9 +++++++++ exthttpcheck/fixAmount.go | 21 +++------------------ exthttpcheck/periodically.go | 21 +++------------------ 3 files changed, 15 insertions(+), 36 deletions(-) diff --git a/exthttpcheck/common.go b/exthttpcheck/common.go index bf41e89..5f75738 100644 --- a/exthttpcheck/common.go +++ b/exthttpcheck/common.go @@ -224,6 +224,15 @@ var ( } ) +func separator(order int) action_kit_api.ActionParameter { + return action_kit_api.ActionParameter{ + Name: "-", + Label: "-", + Type: action_kit_api.ActionParameterTypeSeparator, + Order: extutil.Ptr(order), + } +} + func filter[T any](ss []T, test func(T) bool) (ret []T) { for _, s := range ss { if test(s) { diff --git a/exthttpcheck/fixAmount.go b/exthttpcheck/fixAmount.go index 6ae4c62..d2dfc1b 100644 --- a/exthttpcheck/fixAmount.go +++ b/exthttpcheck/fixAmount.go @@ -73,12 +73,7 @@ func (l *httpCheckActionFixedAmount) Describe() action_kit_api.ActionDescription urlParameter, body, headers, - { - Name: "-", - Label: "-", - Type: action_kit_api.ActionParameterTypeSeparator, - Order: extutil.Ptr(5), - }, + separator(5), //------------------------ // Repitions //------------------------ @@ -93,12 +88,7 @@ func (l *httpCheckActionFixedAmount) Describe() action_kit_api.ActionDescription Order: extutil.Ptr(7), }, duration, - { - Name: "-", - Label: "-", - Type: action_kit_api.ActionParameterTypeSeparator, - Order: extutil.Ptr(9), - }, + separator(9), //------------------------ // Result Verification //------------------------ @@ -108,12 +98,7 @@ func (l *httpCheckActionFixedAmount) Describe() action_kit_api.ActionDescription responsesContains, responsesTimeMode, responseTime, - { - Name: "-", - Label: "-", - Type: action_kit_api.ActionParameterTypeSeparator, - Order: extutil.Ptr(16), - }, + separator(16), //------------------------ // Target Selection //------------------------ diff --git a/exthttpcheck/periodically.go b/exthttpcheck/periodically.go index d1e75ac..eb80a9e 100644 --- a/exthttpcheck/periodically.go +++ b/exthttpcheck/periodically.go @@ -72,12 +72,7 @@ func (l *httpCheckActionPeriodically) Describe() action_kit_api.ActionDescriptio urlParameter, body, headers, - { - Name: "-", - Label: "-", - Type: action_kit_api.ActionParameterTypeSeparator, - Order: extutil.Ptr(5), - }, + separator(5), //------------------------ // Repitions //------------------------ @@ -92,12 +87,7 @@ func (l *httpCheckActionPeriodically) Describe() action_kit_api.ActionDescriptio Order: extutil.Ptr(7), }, duration, - { - Name: "-", - Label: "-", - Type: action_kit_api.ActionParameterTypeSeparator, - Order: extutil.Ptr(9), - }, + separator(9), //------------------------ // Result Verification //------------------------ @@ -107,12 +97,7 @@ func (l *httpCheckActionPeriodically) Describe() action_kit_api.ActionDescriptio responsesContains, responsesTimeMode, responseTime, - { - Name: "-", - Label: "-", - Type: action_kit_api.ActionParameterTypeSeparator, - Order: extutil.Ptr(16), - }, + separator(16), //------------------------ // Target Selection From f48718d8274658607ee1d906852056e50d2fe2c8 Mon Sep 17 00:00:00 2001 From: Daniel Reuter Date: Thu, 21 Nov 2024 08:30:39 +0100 Subject: [PATCH 17/33] docs: add location selection configuration to README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index ba8f510..2b0c271 100755 --- a/README.md +++ b/README.md @@ -6,6 +6,10 @@ Learn about the capabilities of this extension in our [Reliability Hub](https:// ## Configuration +| Environment Variable | Helm value | Meaning | required | default | +|-------------------------------------------------|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|---------| +| `STEADYBIT_EXTENSION_ENABLE_LOCATION_SELECTION` | `enableLocationSelection` | By default, the platform will select a random instance when executing actions from this extension. If you enable location selection, users can optionally specify the location via target selection. | no | false | + The extension supports all environment variables provided by [steadybit/extension-kit](https://github.com/steadybit/extension-kit#environment-variables). ## Installation From a8f5a38e01c9116c4639b6f7eb806a47546c9fb6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 03:27:54 +0000 Subject: [PATCH 18/33] build(deps): bump github.com/stretchr/testify from 1.9.0 to 1.10.0 Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.9.0 to 1.10.0. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](https://github.com/stretchr/testify/compare/v1.9.0...v1.10.0) --- updated-dependencies: - dependency-name: github.com/stretchr/testify dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c63f71c..6557e0b 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/steadybit/discovery-kit/go/discovery_kit_api v1.6.0 github.com/steadybit/discovery-kit/go/discovery_kit_sdk v1.2.1 github.com/steadybit/extension-kit v1.8.22 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.uber.org/automaxprocs v1.6.0 golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c ) diff --git a/go.sum b/go.sum index a3deac4..ef799f8 100644 --- a/go.sum +++ b/go.sum @@ -178,8 +178,8 @@ github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= From e11e472e23b33c151b884716d59352343b2cf44e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 03:45:24 +0000 Subject: [PATCH 19/33] build(deps): bump goreleaser/goreleaser from v2.4.6 to v2.4.8 Bumps goreleaser/goreleaser from v2.4.6 to v2.4.8. --- updated-dependencies: - dependency-name: goreleaser/goreleaser dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5028b53..42e8835 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ## ## Build ## -FROM --platform=$BUILDPLATFORM goreleaser/goreleaser:v2.4.6 AS build +FROM --platform=$BUILDPLATFORM goreleaser/goreleaser:v2.4.8 AS build ARG TARGETOS TARGETARCH ARG BUILD_WITH_COVERAGE From f576e5d24e246832a1ba64be604771f31a16adb2 Mon Sep 17 00:00:00 2001 From: Daniel Reuter Date: Wed, 27 Nov 2024 08:55:09 +0100 Subject: [PATCH 20/33] docs: updated changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47adc2e..a8e9892 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## v1.0.23 (next release) -- Location selection for http checks (can be enabled via STEADYBIT_EXTENSION_ENABLE_LOCATION_SELECTION env var, requires platform => 2.1.25) +- Location selection for http checks (can be enabled via STEADYBIT_EXTENSION_ENABLE_LOCATION_SELECTION env var, requires platform => 2.1.26) ## v1.0.22 From 6d4aee2e5139eaaf8f89e1d66c64974fdf4bb838 Mon Sep 17 00:00:00 2001 From: Daniel Reuter Date: Wed, 27 Nov 2024 10:55:47 +0100 Subject: [PATCH 21/33] docs: updated changelog / remove version hint from helm chart --- CHANGELOG.md | 2 +- charts/steadybit-extension-http/Chart.yaml | 2 +- charts/steadybit-extension-http/values.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8e9892..f9ed674 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## v1.0.23 (next release) -- Location selection for http checks (can be enabled via STEADYBIT_EXTENSION_ENABLE_LOCATION_SELECTION env var, requires platform => 2.1.26) +- Location selection for http checks (can be enabled via STEADYBIT_EXTENSION_ENABLE_LOCATION_SELECTION env var, requires platform => 2.1.27) ## v1.0.22 diff --git a/charts/steadybit-extension-http/Chart.yaml b/charts/steadybit-extension-http/Chart.yaml index e26ec81..bc31e17 100644 --- a/charts/steadybit-extension-http/Chart.yaml +++ b/charts/steadybit-extension-http/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: steadybit-extension-http description: Steadybit action implementation to check HTTP endpoints. -version: 1.1.13 +version: 1.1.14 appVersion: v1.0.22 home: https://www.steadybit.com/ icon: https://steadybit-website-assets.s3.amazonaws.com/logo-symbol-transparent.png diff --git a/charts/steadybit-extension-http/values.yaml b/charts/steadybit-extension-http/values.yaml index 6f69980..ef5528e 100644 --- a/charts/steadybit-extension-http/values.yaml +++ b/charts/steadybit-extension-http/values.yaml @@ -6,7 +6,7 @@ kubernetes: # kubernetes.clusterName -- The name of the kubernetes cluster (if not set, the global.clusterName will be used) clusterName: null -# enableLocationSelection -- Specifies whether the extension should allow the user to select a location for the http checks. This requires platform >= 2.1.25 +# enableLocationSelection -- Specifies whether the extension should allow the user to select a location for the http checks. enableLocationSelection: false image: From 86fa9da6315f4dc14ca8e572ffad704f7b70cfef Mon Sep 17 00:00:00 2001 From: Johannes Edmeier Date: Wed, 27 Nov 2024 14:10:39 +0100 Subject: [PATCH 22/33] chore: revisit default memory request and limit --- charts/steadybit-extension-http/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/steadybit-extension-http/values.yaml b/charts/steadybit-extension-http/values.yaml index ef5528e..b131fbb 100644 --- a/charts/steadybit-extension-http/values.yaml +++ b/charts/steadybit-extension-http/values.yaml @@ -63,12 +63,12 @@ probes: resources: requests: # resources.requests.memory -- The minimal amount of memory needed - memory: "32Mi" + memory: "16Mi" # resources.requests.cpu -- The minimal amount of cpu shares needed cpu: "50m" limits: # resources.limits.memory -- The limit of memory to be used - memory: "128Mi" + memory: "32Mi" # resources.limits.cpu -- The limit of cpu share to be used during its interval cpu: "200m" From 12f78cd6a79303ac270a261a0e0dc865c59096fe Mon Sep 17 00:00:00 2001 From: Johannes Edmeier Date: Wed, 27 Nov 2024 14:33:05 +0100 Subject: [PATCH 23/33] chore: add missing chart version bump --- charts/steadybit-extension-http/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/steadybit-extension-http/Chart.yaml b/charts/steadybit-extension-http/Chart.yaml index bc31e17..38995b5 100644 --- a/charts/steadybit-extension-http/Chart.yaml +++ b/charts/steadybit-extension-http/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: steadybit-extension-http description: Steadybit action implementation to check HTTP endpoints. -version: 1.1.14 +version: 1.1.15 appVersion: v1.0.22 home: https://www.steadybit.com/ icon: https://steadybit-website-assets.s3.amazonaws.com/logo-symbol-transparent.png From 181f86bdcd81594d2b7ff06ef2b57f4c8bc56179 Mon Sep 17 00:00:00 2001 From: Johannes Edmeier Date: Wed, 27 Nov 2024 15:05:07 +0100 Subject: [PATCH 24/33] test: fix chart snapshots --- .../__snapshot__/deployment_test.yaml.snap | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/charts/steadybit-extension-http/tests/__snapshot__/deployment_test.yaml.snap b/charts/steadybit-extension-http/tests/__snapshot__/deployment_test.yaml.snap index 1043f25..43bb1c8 100644 --- a/charts/steadybit-extension-http/tests/__snapshot__/deployment_test.yaml.snap +++ b/charts/steadybit-extension-http/tests/__snapshot__/deployment_test.yaml.snap @@ -68,10 +68,10 @@ manifest should match snapshot using podAnnotations and Labels: resources: limits: cpu: 200m - memory: 128Mi + memory: 32Mi requests: cpu: 50m - memory: 32Mi + memory: 16Mi securityContext: allowPrivilegeEscalation: false capabilities: @@ -156,10 +156,10 @@ manifest should match snapshot with TLS: resources: limits: cpu: 200m - memory: 128Mi + memory: 32Mi requests: cpu: 50m - memory: 32Mi + memory: 16Mi securityContext: allowPrivilegeEscalation: false capabilities: @@ -254,10 +254,10 @@ manifest should match snapshot with extra env vars: resources: limits: cpu: 200m - memory: 128Mi + memory: 32Mi requests: cpu: 50m - memory: 32Mi + memory: 16Mi securityContext: allowPrivilegeEscalation: false capabilities: @@ -340,10 +340,10 @@ manifest should match snapshot with extra labels: resources: limits: cpu: 200m - memory: 128Mi + memory: 32Mi requests: cpu: 50m - memory: 32Mi + memory: 16Mi securityContext: allowPrivilegeEscalation: false capabilities: @@ -430,10 +430,10 @@ manifest should match snapshot with mutual TLS: resources: limits: cpu: 200m - memory: 128Mi + memory: 32Mi requests: cpu: 50m - memory: 32Mi + memory: 16Mi securityContext: allowPrivilegeEscalation: false capabilities: @@ -534,10 +534,10 @@ manifest should match snapshot with mutual TLS using containerPaths: resources: limits: cpu: 200m - memory: 128Mi + memory: 32Mi requests: cpu: 50m - memory: 32Mi + memory: 16Mi securityContext: allowPrivilegeEscalation: false capabilities: @@ -618,10 +618,10 @@ manifest should match snapshot with podSecurityContext: resources: limits: cpu: 200m - memory: 128Mi + memory: 32Mi requests: cpu: 50m - memory: 32Mi + memory: 16Mi securityContext: allowPrivilegeEscalation: false capabilities: @@ -704,10 +704,10 @@ manifest should match snapshot with priority class: resources: limits: cpu: 200m - memory: 128Mi + memory: 32Mi requests: cpu: 50m - memory: 32Mi + memory: 16Mi securityContext: allowPrivilegeEscalation: false capabilities: @@ -789,10 +789,10 @@ manifest should match snapshot without TLS: resources: limits: cpu: 200m - memory: 128Mi + memory: 32Mi requests: cpu: 50m - memory: 32Mi + memory: 16Mi securityContext: allowPrivilegeEscalation: false capabilities: @@ -875,10 +875,10 @@ should add cluster name from global values: resources: limits: cpu: 200m - memory: 128Mi + memory: 32Mi requests: cpu: 50m - memory: 32Mi + memory: 16Mi securityContext: allowPrivilegeEscalation: false capabilities: @@ -961,10 +961,10 @@ should add cluster name from local values: resources: limits: cpu: 200m - memory: 128Mi + memory: 32Mi requests: cpu: 50m - memory: 32Mi + memory: 16Mi securityContext: allowPrivilegeEscalation: false capabilities: @@ -1047,10 +1047,10 @@ should enable location selection: resources: limits: cpu: 200m - memory: 128Mi + memory: 32Mi requests: cpu: 50m - memory: 32Mi + memory: 16Mi securityContext: allowPrivilegeEscalation: false capabilities: From dd48ed0463edea5391b1312699eeeba7245e4d2a Mon Sep 17 00:00:00 2001 From: Daniel Reuter Date: Thu, 28 Nov 2024 11:27:31 +0100 Subject: [PATCH 25/33] feat: - Use "error" in the expected HTTP status code field to verify that requests are returning an error --- CHANGELOG.md | 1 + exthttpcheck/check.go | 6 +++--- exthttpcheck/check_test.go | 2 +- exthttpcheck/fixAmount_test.go | 2 +- exthttpcheck/periodically_test.go | 2 +- exthttpcheck/util.go | 33 ++++++++++++++++++------------- exthttpcheck/util_test.go | 8 ++++---- 7 files changed, 30 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9ed674..4e9ab5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## v1.0.23 (next release) - Location selection for http checks (can be enabled via STEADYBIT_EXTENSION_ENABLE_LOCATION_SELECTION env var, requires platform => 2.1.27) +- Use "error" in the expected HTTP status code field to verify that requests are returning an error ## v1.0.22 diff --git a/exthttpcheck/check.go b/exthttpcheck/check.go index f0af7a5..a40f4d0 100644 --- a/exthttpcheck/check.go +++ b/exthttpcheck/check.go @@ -37,7 +37,7 @@ var ( ) type HTTPCheckState struct { - ExpectedStatusCodes []int + ExpectedStatusCodes []string DelayBetweenRequestsInMS int64 Timeout time.Time ResponsesContains string @@ -221,11 +221,11 @@ func requestWorker(executionRunData *ExecutionRunData, state *HTTPCheckState, ch Value: float64(now.Sub(started).Milliseconds()), Timestamp: now, } - responseStatusWasExpected = false + responseStatusWasExpected = slices.Contains(state.ExpectedStatusCodes, "error") } else { responseTimeValue := float64(ended.Sub(requestWritten).Milliseconds()) log.Debug().Msgf("Got response %s", response.Status) - responseStatusWasExpected = slices.Contains(state.ExpectedStatusCodes, response.StatusCode) + responseStatusWasExpected = slices.Contains(state.ExpectedStatusCodes, strconv.Itoa(response.StatusCode)) metricMap := map[string]string{ "url": req.URL.String(), "http_status": strconv.Itoa(response.StatusCode), diff --git a/exthttpcheck/check_test.go b/exthttpcheck/check_test.go index 6353eac..6f59274 100644 --- a/exthttpcheck/check_test.go +++ b/exthttpcheck/check_test.go @@ -51,7 +51,7 @@ func TestAction_Prepare(t *testing.T) { }), wantedState: &HTTPCheckState{ - ExpectedStatusCodes: []int{200, 201, 202, 203, 204, 205, 206, 207, 208, 209}, + ExpectedStatusCodes: []string{"200", "201", "202", "203", "204", "205", "206", "207", "208", "209"}, DelayBetweenRequestsInMS: 1000, Timeout: time.Now(), ResponsesContains: "test", diff --git a/exthttpcheck/fixAmount_test.go b/exthttpcheck/fixAmount_test.go index 44894f4..be2773d 100644 --- a/exthttpcheck/fixAmount_test.go +++ b/exthttpcheck/fixAmount_test.go @@ -52,7 +52,7 @@ func TestNewHTTPCheckActionFixedAmount_Prepare(t *testing.T) { }), wantedState: &HTTPCheckState{ - ExpectedStatusCodes: []int{200, 201, 202, 203, 204, 205, 206, 207, 208, 209}, + ExpectedStatusCodes: []string{"200", "201", "202", "203", "204", "205", "206", "207", "208", "209"}, DelayBetweenRequestsInMS: 1000, Timeout: time.Now(), ResponsesContains: "test", diff --git a/exthttpcheck/periodically_test.go b/exthttpcheck/periodically_test.go index 01c7e4a..1b8d98e 100644 --- a/exthttpcheck/periodically_test.go +++ b/exthttpcheck/periodically_test.go @@ -53,7 +53,7 @@ func TestNewHTTPCheckActionPeriodically_Prepare(t *testing.T) { }), wantedState: &HTTPCheckState{ - ExpectedStatusCodes: []int{200, 201, 202, 203, 204, 205, 206, 207, 208, 209}, + ExpectedStatusCodes: []string{"200", "201", "202", "203", "204", "205", "206", "207", "208", "209"}, DelayBetweenRequestsInMS: 500, Timeout: time.Now(), ResponsesContains: "test", diff --git a/exthttpcheck/util.go b/exthttpcheck/util.go index 308b644..70802f1 100644 --- a/exthttpcheck/util.go +++ b/exthttpcheck/util.go @@ -13,8 +13,8 @@ import ( ) // resolveStatusCodeExpression resolves the given status code expression into a list of status codes -func resolveStatusCodeExpression(statusCodes string) ([]int, *action_kit_api.ActionKitError) { - result := make([]int, 0) +func resolveStatusCodeExpression(statusCodes string) ([]string, *action_kit_api.ActionKitError) { + result := make([]string, 0) for _, code := range strings.Split(strings.Trim(statusCodes, " "), ";") { if strings.Contains(code, "-") { rangeParts := strings.Split(code, "-") @@ -45,7 +45,7 @@ func resolveStatusCodeExpression(statusCodes string) ([]int, *action_kit_api.Act Title: fmt.Sprintf("Invalid status code '%d'. Status code should be between 100 and 599.", i), } } - result = append(result, i) + result = append(result, strconv.Itoa(i)) } } else { if len(code) == 0 { @@ -54,20 +54,25 @@ func resolveStatusCodeExpression(statusCodes string) ([]int, *action_kit_api.Act Title: "Status code is required.", } } - parsed, err := strconv.Atoi(code) - if err != nil { - log.Error().Msgf("Invalid status code '%s'", code) - return nil, &action_kit_api.ActionKitError{ - Title: fmt.Sprintf("Invalid status code '%s'. Please use '-' for ranges and ';' for enumerations. Example: '200-399;429'", code), + if code == "error" { + result = append(result, "error") + } else { + + parsed, err := strconv.Atoi(code) + if err != nil { + log.Error().Msgf("Invalid status code '%s'", code) + return nil, &action_kit_api.ActionKitError{ + Title: fmt.Sprintf("Invalid status code '%s'. Please use '-' for ranges and ';' for enumerations. Example: '200-399;429'", code), + } } - } - if parsed < 100 || parsed > 599 { - log.Error().Msgf("Invalid status code '%d'", parsed) - return nil, &action_kit_api.ActionKitError{ - Title: fmt.Sprintf("Invalid status code '%d'. Status code should be between 100 and 599.", parsed), + if parsed < 100 || parsed > 599 { + log.Error().Msgf("Invalid status code '%d'", parsed) + return nil, &action_kit_api.ActionKitError{ + Title: fmt.Sprintf("Invalid status code '%d'. Status code should be between 100 and 599.", parsed), + } } + result = append(result, strconv.Itoa(parsed)) } - result = append(result, parsed) } } return result, nil diff --git a/exthttpcheck/util_test.go b/exthttpcheck/util_test.go index 853a559..6381d5b 100644 --- a/exthttpcheck/util_test.go +++ b/exthttpcheck/util_test.go @@ -13,7 +13,7 @@ func Test_resolveStatusCodeExpression(t *testing.T) { tests := []struct { name string args args - want []int + want []string error *action_kit_api.ActionKitError }{ { @@ -21,15 +21,15 @@ func Test_resolveStatusCodeExpression(t *testing.T) { args: args{ statusCodes: "200-209", }, - want: []int{200, 201, 202, 203, 204, 205, 206, 207, 208, 209}, + want: []string{"200", "201", "202", "203", "204", "205", "206", "207", "208", "209"}, error: nil, }, { name: "Should return status codes with range and enum", args: args{ - statusCodes: "201-202;209", + statusCodes: "201-202;error;209", }, - want: []int{201, 202, 209}, + want: []string{"201", "202", "error", "209"}, error: nil, }, { From d21d6602c06179850e894361296ac70a024c24f4 Mon Sep 17 00:00:00 2001 From: Daniel Reuter Date: Thu, 28 Nov 2024 13:29:11 +0100 Subject: [PATCH 26/33] feat: - Use "error" in the expected HTTP status code field to verify that requests are returning an error --- exthttpcheck/check.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/exthttpcheck/check.go b/exthttpcheck/check.go index a40f4d0..0baf43f 100644 --- a/exthttpcheck/check.go +++ b/exthttpcheck/check.go @@ -183,8 +183,6 @@ func requestWorker(executionRunData *ExecutionRunData, state *HTTPCheckState, ch } responseStatusWasExpected := false - responseBodyWasSuccessful := true - responseTimeWasSuccessful := true req, err := createRequest(state) if err != nil { @@ -212,17 +210,23 @@ func requestWorker(executionRunData *ExecutionRunData, state *HTTPCheckState, ch if err != nil { log.Error().Err(err).Msg("Failed to execute request") now := time.Now() + responseStatusWasExpected = slices.Contains(state.ExpectedStatusCodes, "error") executionRunData.metrics <- action_kit_api.Metric{ Metric: map[string]string{ - "url": req.URL.String(), - "error": err.Error(), + "url": req.URL.String(), + "error": err.Error(), + "expected_http_status": strconv.FormatBool(responseStatusWasExpected), }, Name: extutil.Ptr("response_time"), Value: float64(now.Sub(started).Milliseconds()), Timestamp: now, } - responseStatusWasExpected = slices.Contains(state.ExpectedStatusCodes, "error") + if responseStatusWasExpected { + executionRunData.requestSuccessCounter.Add(1) + } } else { + responseBodyWasSuccessful := true + responseTimeWasSuccessful := true responseTimeValue := float64(ended.Sub(requestWritten).Milliseconds()) log.Debug().Msgf("Got response %s", response.Status) responseStatusWasExpected = slices.Contains(state.ExpectedStatusCodes, strconv.Itoa(response.StatusCode)) From 6f96435a07a1be11e583312a797612d5c41a29e7 Mon Sep 17 00:00:00 2001 From: Manuel Gerding <50632744+ManuelGerding@users.noreply.github.com> Date: Thu, 5 Dec 2024 10:56:06 +0100 Subject: [PATCH 27/33] feat: Adding docs for migrating to client locations (#75) --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 2b0c271..b7b871d 100755 --- a/README.md +++ b/README.md @@ -67,3 +67,19 @@ information about extension registration and how to verify. ## Proxy A proxy configuration is currently not supported. + +## Location Selection +When multiple HTTP extensions are deployed in different subsystems (e.g., multiple Kubernetes clusters), it can be tricky to ensure that the HTTP check is performed from the right location when testing cluster-internal URLs. +To solve this, you can activate the location selection feature. +Once you do that, the HTTP extension discovers itself as a client execution location. +When configuring the experiment, you can optionally define which extension's deployment should execute the HTTP check. +Also, the execution locations are part of Steadybit's environment concept, so you can assign permissions for execution locations. + +### Migration Guideline +Before activating the location selection feature, be sure to follow these steps: +1. The installed agent version needs to be >= X.XX, and - only for on-prem customers - the platform version needs to be >=X.X +2. Activate the location selection via environment or helm variable when deploying the latest extension version (see [configuration options](#configuration). +3. Configure every environment that should be able to run HTTP checks by including the HTTP client location in the environment configuration. + One option is to add the statement `or target via the query language.type="com.steadybit.extension_http.client-location"` to your existing query. + You can also filter the available execution locations down, e.g., via the clustername by using `(target.type="com.steadybit.extension_http.client-location" and k8s.cluster-name="CLUSTER-NAME")` + From 5a043b97bd51fbf91b808d06983c3a9f4e625c50 Mon Sep 17 00:00:00 2001 From: Manuel Gerding <50632744+ManuelGerding@users.noreply.github.com> Date: Thu, 5 Dec 2024 11:59:40 +0100 Subject: [PATCH 28/33] fix: Readme contains correct agent and platform versions (#76) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b7b871d..af1b5a6 100755 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ Also, the execution locations are part of Steadybit's environment concept, so yo ### Migration Guideline Before activating the location selection feature, be sure to follow these steps: -1. The installed agent version needs to be >= X.XX, and - only for on-prem customers - the platform version needs to be >=X.X +1. The installed agent version needs to be >= 2.0.47, and - only for on-prem customers - the platform version needs to be >=2.2.2 2. Activate the location selection via environment or helm variable when deploying the latest extension version (see [configuration options](#configuration). 3. Configure every environment that should be able to run HTTP checks by including the HTTP client location in the environment configuration. One option is to add the statement `or target via the query language.type="com.steadybit.extension_http.client-location"` to your existing query. From 26a542155757d05d70de5396b9a69673bf0a4b06 Mon Sep 17 00:00:00 2001 From: Johannes Edmeier Date: Thu, 5 Dec 2024 17:05:27 +0100 Subject: [PATCH 29/33] refa: reference user by UID instead of name this enables runAsNonRoot for Kubernetes without specifying a user --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 42e8835..109361b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,7 @@ ARG USER_UID=10000 RUN adduser -u $USER_UID -D $USERNAME -USER $USERNAME +USER $USER_UID WORKDIR / From 73f49bac7587f36900eac54046f66ef847912b09 Mon Sep 17 00:00:00 2001 From: Johannes Edmeier Date: Fri, 6 Dec 2024 14:26:37 +0100 Subject: [PATCH 30/33] chore: udpate CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e9ab5f..3cbca56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ # Changelog -## v1.0.23 (next release) +## v1.0.23 - Location selection for http checks (can be enabled via STEADYBIT_EXTENSION_ENABLE_LOCATION_SELECTION env var, requires platform => 2.1.27) - Use "error" in the expected HTTP status code field to verify that requests are returning an error +- Use uid instead of name for user statement in Dockerfile ## v1.0.22 From bf1fe4eff90d5443517f8163e513b597f343d8e7 Mon Sep 17 00:00:00 2001 From: Johannes Edmeier Date: Fri, 6 Dec 2024 14:27:05 +0100 Subject: [PATCH 31/33] refa: avoid hard-coded uid in helm chart In order to improve installation on openshift, we need to avoid the hard-coded uid/gid in the helm chart --- charts/steadybit-extension-http/Chart.yaml | 2 +- .../templates/deployment.yaml | 11 +-- .../__snapshot__/deployment_test.yaml.snap | 83 +++++++++++-------- charts/steadybit-extension-http/values.yaml | 13 ++- 4 files changed, 63 insertions(+), 46 deletions(-) diff --git a/charts/steadybit-extension-http/Chart.yaml b/charts/steadybit-extension-http/Chart.yaml index 38995b5..f63d51d 100644 --- a/charts/steadybit-extension-http/Chart.yaml +++ b/charts/steadybit-extension-http/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: steadybit-extension-http description: Steadybit action implementation to check HTTP endpoints. -version: 1.1.15 +version: 1.1.16 appVersion: v1.0.22 home: https://www.steadybit.com/ icon: https://steadybit-website-assets.s3.amazonaws.com/logo-symbol-transparent.png diff --git a/charts/steadybit-extension-http/templates/deployment.yaml b/charts/steadybit-extension-http/templates/deployment.yaml index 24f74ea..d77bd6e 100644 --- a/charts/steadybit-extension-http/templates/deployment.yaml +++ b/charts/steadybit-extension-http/templates/deployment.yaml @@ -103,15 +103,10 @@ spec: httpGet: path: /health/readiness port: 8081 + {{- with .Values.containerSecurityContext }} securityContext: - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 10000 - runAsGroup: 10000 - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL + {{- toYaml . | nindent 12 }} + {{- end }} volumes: {{- include "extensionlib.deployment.volumes" (list .) | nindent 8 }} serviceAccountName: {{ .Values.serviceAccount.name }} diff --git a/charts/steadybit-extension-http/tests/__snapshot__/deployment_test.yaml.snap b/charts/steadybit-extension-http/tests/__snapshot__/deployment_test.yaml.snap index 43bb1c8..3216f25 100644 --- a/charts/steadybit-extension-http/tests/__snapshot__/deployment_test.yaml.snap +++ b/charts/steadybit-extension-http/tests/__snapshot__/deployment_test.yaml.snap @@ -78,10 +78,11 @@ manifest should match snapshot using podAnnotations and Labels: drop: - ALL readOnlyRootFilesystem: true - runAsGroup: 10000 - runAsNonRoot: true - runAsUser: 10000 volumeMounts: null + securityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault serviceAccountName: steadybit-extension-http volumes: null manifest should match snapshot with TLS: @@ -166,13 +167,14 @@ manifest should match snapshot with TLS: drop: - ALL readOnlyRootFilesystem: true - runAsGroup: 10000 - runAsNonRoot: true - runAsUser: 10000 volumeMounts: - mountPath: /etc/extension/certificates/server-cert name: certificate-server-cert readOnly: true + securityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault serviceAccountName: steadybit-extension-http volumes: - name: certificate-server-cert @@ -264,10 +266,11 @@ manifest should match snapshot with extra env vars: drop: - ALL readOnlyRootFilesystem: true - runAsGroup: 10000 - runAsNonRoot: true - runAsUser: 10000 volumeMounts: null + securityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault serviceAccountName: steadybit-extension-http volumes: null manifest should match snapshot with extra labels: @@ -350,10 +353,11 @@ manifest should match snapshot with extra labels: drop: - ALL readOnlyRootFilesystem: true - runAsGroup: 10000 - runAsNonRoot: true - runAsUser: 10000 volumeMounts: null + securityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault serviceAccountName: steadybit-extension-http volumes: null manifest should match snapshot with mutual TLS: @@ -440,9 +444,6 @@ manifest should match snapshot with mutual TLS: drop: - ALL readOnlyRootFilesystem: true - runAsGroup: 10000 - runAsNonRoot: true - runAsUser: 10000 volumeMounts: - mountPath: /etc/extension/certificates/client-cert-a name: certificate-client-cert-a @@ -450,6 +451,10 @@ manifest should match snapshot with mutual TLS: - mountPath: /etc/extension/certificates/server-cert name: certificate-server-cert readOnly: true + securityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault serviceAccountName: steadybit-extension-http volumes: - name: certificate-client-cert-a @@ -544,10 +549,11 @@ manifest should match snapshot with mutual TLS using containerPaths: drop: - ALL readOnlyRootFilesystem: true - runAsGroup: 10000 - runAsNonRoot: true - runAsUser: 10000 volumeMounts: null + securityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault serviceAccountName: steadybit-extension-http volumes: null manifest should match snapshot with podSecurityContext: @@ -628,12 +634,12 @@ manifest should match snapshot with podSecurityContext: drop: - ALL readOnlyRootFilesystem: true - runAsGroup: 10000 - runAsNonRoot: true - runAsUser: 10000 volumeMounts: null securityContext: + runAsNonRoot: true runAsUser: 2222 + seccompProfile: + type: RuntimeDefault serviceAccountName: steadybit-extension-http volumes: null manifest should match snapshot with priority class: @@ -714,11 +720,12 @@ manifest should match snapshot with priority class: drop: - ALL readOnlyRootFilesystem: true - runAsGroup: 10000 - runAsNonRoot: true - runAsUser: 10000 volumeMounts: null priorityClassName: my-priority-class + securityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault serviceAccountName: steadybit-extension-http volumes: null manifest should match snapshot without TLS: @@ -799,10 +806,11 @@ manifest should match snapshot without TLS: drop: - ALL readOnlyRootFilesystem: true - runAsGroup: 10000 - runAsNonRoot: true - runAsUser: 10000 volumeMounts: null + securityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault serviceAccountName: steadybit-extension-http volumes: null should add cluster name from global values: @@ -885,10 +893,11 @@ should add cluster name from global values: drop: - ALL readOnlyRootFilesystem: true - runAsGroup: 10000 - runAsNonRoot: true - runAsUser: 10000 volumeMounts: null + securityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault serviceAccountName: steadybit-extension-http volumes: null should add cluster name from local values: @@ -971,10 +980,11 @@ should add cluster name from local values: drop: - ALL readOnlyRootFilesystem: true - runAsGroup: 10000 - runAsNonRoot: true - runAsUser: 10000 volumeMounts: null + securityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault serviceAccountName: steadybit-extension-http volumes: null should enable location selection: @@ -1057,9 +1067,10 @@ should enable location selection: drop: - ALL readOnlyRootFilesystem: true - runAsGroup: 10000 - runAsNonRoot: true - runAsUser: 10000 volumeMounts: null + securityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault serviceAccountName: steadybit-extension-http volumes: null diff --git a/charts/steadybit-extension-http/values.yaml b/charts/steadybit-extension-http/values.yaml index b131fbb..9ab6706 100644 --- a/charts/steadybit-extension-http/values.yaml +++ b/charts/steadybit-extension-http/values.yaml @@ -107,7 +107,18 @@ affinity: {} priorityClassName: null # podSecurityContext -- SecurityContext to apply to the pod. -podSecurityContext: {} +podSecurityContext: + seccompProfile: + type: RuntimeDefault + runAsNonRoot: true + +# containerSecurityContext -- SecurityContext to apply to the container. +containerSecurityContext: + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL # extraEnv -- Array with extra environment variables to add to the container # e.g: From 3bd27f572ac6dfb44684ef2eaf940cfeac6e49ca Mon Sep 17 00:00:00 2001 From: joshiste Date: Fri, 6 Dec 2024 18:47:46 +0000 Subject: [PATCH 32/33] chore: update helm chart version --- charts/steadybit-extension-http/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/steadybit-extension-http/Chart.yaml b/charts/steadybit-extension-http/Chart.yaml index f63d51d..f69d5b3 100644 --- a/charts/steadybit-extension-http/Chart.yaml +++ b/charts/steadybit-extension-http/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 name: steadybit-extension-http description: Steadybit action implementation to check HTTP endpoints. -version: 1.1.16 -appVersion: v1.0.22 +version: 1.1.17 +appVersion: v1.0.23 home: https://www.steadybit.com/ icon: https://steadybit-website-assets.s3.amazonaws.com/logo-symbol-transparent.png maintainers: From 7fd542ef2d6d8af677bce5c0358f5ecc6b28a5dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 03:38:53 +0000 Subject: [PATCH 33/33] build(deps): bump alpine from 3.20 to 3.21 Bumps alpine from 3.20 to 3.21. --- updated-dependencies: - dependency-name: alpine dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 109361b..363a68f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ RUN GOOS=$TARGETOS GOARCH=$TARGETARCH goreleaser build --snapshot="${BUILD_SNAPS ## ## Runtime ## -FROM alpine:3.20 +FROM alpine:3.21 LABEL "steadybit.com.discovery-disabled"="true"