Skip to content

Commit

Permalink
Merge branch 'main' into migrator-bump-kim-dep
Browse files Browse the repository at this point in the history
  • Loading branch information
akgalwas authored Oct 25, 2024
2 parents c7e1f81 + c795e7f commit f838ac5
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_kim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ jobs:
path: ${{ env.trivy-table }}

- name: Print trivy table
if: success() || failure()
run: test -f ${{ env.trivy-table }} && cat ${{ env.trivy-table }} || echo ':: no data ::'
if: success() || failure()
run: "test -f ${{ env.trivy-table }} && cat ${{ env.trivy-table }} || echo ':: no data ::'"

build-image:
needs: setup
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/daily-markdown-link-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gaurav-nelson/github-action-markdown-link-check@v1
- uses: gaurav-nelson/github-action-markdown-link-check@d53a906aa6b22b8979d33bc86170567e619495ec
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
config-file: '.mlc.config.json'
folder-path: '.'
max-depth: -1
max-depth: -1
12 changes: 11 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package main

import (
"context"
"encoding/json"
"flag"
"fmt"
Expand All @@ -27,7 +28,7 @@ import (
"github.com/gardener/gardener/pkg/apis/core/v1beta1"
gardener_apis "github.com/gardener/gardener/pkg/client/core/clientset/versioned/typed/core/v1beta1"
gardener_oidc "github.com/gardener/oidc-webhook-authenticator/apis/authentication/v1alpha1"
"github.com/go-playground/validator/v10"
validator "github.com/go-playground/validator/v10"
infrastructuremanagerv1 "github.com/kyma-project/infrastructure-manager/api/v1"
"github.com/kyma-project/infrastructure-manager/internal/auditlogging"
kubeconfig_controller "github.com/kyma-project/infrastructure-manager/internal/controller/kubeconfig"
Expand Down Expand Up @@ -182,6 +183,15 @@ func main() {
os.Exit(1)
}

// refresh runtime metrics
metrics.ResetRuntimeMetrics()
var runtimeList infrastructuremanagerv1.RuntimeList
if err = mgr.GetClient().List(context.TODO(), &runtimeList); err != nil {
for _, rt := range runtimeList.Items {
metrics.SetRuntimeStates(rt)
}
}

cfg := fsm.RCCfg{
GardenerRequeueDuration: defaultGardenerRequeueDuration,
ControlPlaneRequeueDuration: defaultControlPlaneRequeueDuration,
Expand Down
5 changes: 5 additions & 0 deletions internal/controller/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const (
type Metrics interface {
SetRuntimeStates(runtime v1.Runtime)
CleanUpRuntimeGauge(runtimeID string)
ResetRuntimeMetrics()
IncRuntimeFSMStopCounter()
SetGardenerClusterStates(cluster v1.GardenerCluster)
CleanUpGardenerClusterGauge(runtimeID string)
Expand Down Expand Up @@ -100,6 +101,10 @@ func (m metricsImpl) CleanUpRuntimeGauge(runtimeID string) {
})
}

func (m metricsImpl) ResetRuntimeMetrics() {
m.runtimeStateGauge.Reset()
}

func (m metricsImpl) IncRuntimeFSMStopCounter() {
m.runtimeFSMUnexpectedStopsCnt.Inc()
}
Expand Down
5 changes: 5 additions & 0 deletions internal/controller/metrics/mocks/Metrics.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f838ac5

Please sign in to comment.