Skip to content

Commit

Permalink
Merge pull request #309 from periklis/backport-pr-13299
Browse files Browse the repository at this point in the history
[release-5.9] Backport PR grafana#13299
  • Loading branch information
periklis authored Jun 25, 2024
2 parents afa4533 + db95764 commit 3ee9061
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions operator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Main

## Release 5.9.4

- [13299](https://github.com/grafana/loki/pull/13299) **periklis**: fix(operator): Watch for CredentialsRequests on CCOAuthEnv only

## Release 5.9.3

- [13066](https://github.com/grafana/loki/pull/13066) **xperimental**: Use a minimum value for replay memory ceiling
Expand Down
8 changes: 5 additions & 3 deletions operator/controllers/loki/lokistack_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,11 @@ func (r *LokiStackReconciler) buildController(bld k8s.Builder) error {
}

if r.FeatureGates.OpenShift.Enabled {
bld = bld.
Owns(&routev1.Route{}, updateOrDeleteOnlyPred).
Owns(&cloudcredentialv1.CredentialsRequest{}, updateOrDeleteOnlyPred)
bld = bld.Owns(&routev1.Route{}, updateOrDeleteOnlyPred)

if r.FeatureGates.OpenShift.TokenCCOAuthEnv {
bld = bld.Owns(&cloudcredentialv1.CredentialsRequest{}, updateOrDeleteOnlyPred)
}

if r.FeatureGates.OpenShift.ClusterTLSPolicy {
bld = bld.Watches(&openshiftconfigv1.APIServer{}, r.enqueueAllLokiStacksHandler(), updateOrDeleteOnlyPred)
Expand Down
5 changes: 3 additions & 2 deletions operator/controllers/loki/lokistack_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func TestLokiStackController_RegisterOwnedResourcesForUpdateOrDeleteOnly(t *test
{
obj: &routev1.Route{},
index: 10,
ownCallsCount: 12,
ownCallsCount: 11,
featureGates: configv1.FeatureGates{
OpenShift: configv1.OpenShiftFeatureGates{
Enabled: true,
Expand All @@ -175,7 +175,8 @@ func TestLokiStackController_RegisterOwnedResourcesForUpdateOrDeleteOnly(t *test
ownCallsCount: 12,
featureGates: configv1.FeatureGates{
OpenShift: configv1.OpenShiftFeatureGates{
Enabled: true,
Enabled: true,
TokenCCOAuthEnv: true,
},
},
pred: updateOrDeleteOnlyPred,
Expand Down

0 comments on commit 3ee9061

Please sign in to comment.