Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: fluxcd/source-controller
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e92327d453b8b8dface3699ec7e59145993a6fc9
Choose a base ref
..
head repository: fluxcd/source-controller
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5ecc6b10a8e12efee7d6cc883d5ce2cb7aedcedf
Choose a head ref
Showing with 4 additions and 2 deletions.
  1. +1 −1 internal/cache/metrics.go
  2. +3 −1 internal/oci/auth.go
2 changes: 1 addition & 1 deletion internal/cache/metrics.go
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ func NewCacheRecorder() *CacheRecorder {
return &CacheRecorder{
cacheEventsCounter: prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "gotk_cache_events_total",
Name: "gotk_sc_cache_events_total",
Help: "Total number of cache retrieval events for a Gitops Toolkit resource reconciliation.",
},
[]string{"event_type", "name", "namespace"},
4 changes: 3 additions & 1 deletion internal/oci/auth.go
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ import (
"github.com/fluxcd/pkg/oci/auth/login"
"github.com/google/go-containerregistry/pkg/authn"
"github.com/google/go-containerregistry/pkg/name"
"sigs.k8s.io/controller-runtime/pkg/metrics"

sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
)
@@ -90,7 +91,8 @@ func NewOIDCAuthenticator(opts ...OIDCAuthenticatorOptionFunc) (*OIDCAuthenticat
)
if o.capacity > 0 {
c, err = cache.New(o.capacity, cache.StoreObjectKeyFunc,
cache.WithCleanupInterval[cache.StoreObject[authn.Authenticator]](defaultAuthCacheInterval))
cache.WithCleanupInterval[cache.StoreObject[authn.Authenticator]](defaultAuthCacheInterval),
cache.WithMetricsRegisterer[cache.StoreObject[authn.Authenticator]](metrics.Registry))
if err != nil {
return nil, fmt.Errorf("failed to create cache: %w", err)
}