Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update status to check for 2xx and any other 200 http code with regex #27

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PROJECT
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
domain: amazee.io
repo: github.com/amazeeio/aergia-controller
repo: github.com/uselagoon/aergia-controller
version: "2"
2 changes: 1 addition & 1 deletion build-push.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
REPO=${2:-amazeeio}
REPO=${2:-uselagoon}
TAG=${1:-latest}
IMGNAME=${3:-aergia}
echo "Creating image for $REPO/${IMGNAME}:$TAG and pushing to docker hub"
Expand Down
4 changes: 2 additions & 2 deletions controllers/idling_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"encoding/json"
"fmt"

"github.com/amazeeio/aergia-controller/handlers/idler"
"github.com/amazeeio/aergia-controller/handlers/unidler"
"github.com/go-logr/logr"
"github.com/uselagoon/aergia-controller/handlers/idler"
"github.com/uselagoon/aergia-controller/handlers/unidler"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
ctrl "sigs.k8s.io/controller-runtime"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/amazeeio/aergia-controller
module github.com/uselagoon/aergia-controller

go 1.21

Expand Down
2 changes: 1 addition & 1 deletion handlers/idler/service-kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (h *Idler) KubernetesServiceIdler(ctx context.Context, opLog logr.Logger, n
defer cancel()
// get the number of requests to any ingress in the exported namespace by status code
promQuery := fmt.Sprintf(
`round(sum(increase(nginx_ingress_controller_requests{exported_namespace="%s",status="200"}[%s])) by (status))`,
`round(sum(increase(nginx_ingress_controller_requests{exported_namespace="%s",status=~"2[0-9x]{2}"}[%s])) by (status))`,
namespace.ObjectMeta.Name,
prometheusInternalCheck,
)
Expand Down
61 changes: 0 additions & 61 deletions helm-update.sh

This file was deleted.

10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import (
"os"
"time"

"github.com/amazeeio/aergia-controller/controllers"
"github.com/amazeeio/aergia-controller/handlers/idler"
"github.com/amazeeio/aergia-controller/handlers/metrics"
"github.com/amazeeio/aergia-controller/handlers/unidler"
u "github.com/amazeeio/aergia-controller/handlers/unidler"
prometheusapi "github.com/prometheus/client_golang/api"
"github.com/prometheus/client_golang/prometheus"
"github.com/uselagoon/aergia-controller/controllers"
"github.com/uselagoon/aergia-controller/handlers/idler"
"github.com/uselagoon/aergia-controller/handlers/metrics"
"github.com/uselagoon/aergia-controller/handlers/unidler"
u "github.com/uselagoon/aergia-controller/handlers/unidler"
variables "github.com/uselagoon/machinery/utils/variables"
"gopkg.in/robfig/cron.v2"
"gopkg.in/yaml.v2"
Expand Down
Loading