Skip to content

Commit 3ee9061

Browse files
authored
Merge pull request #309 from periklis/backport-pr-13299
[release-5.9] Backport PR grafana#13299
2 parents afa4533 + db95764 commit 3ee9061

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

operator/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## Main
22

3+
## Release 5.9.4
4+
5+
- [13299](https://github.com/grafana/loki/pull/13299) **periklis**: fix(operator): Watch for CredentialsRequests on CCOAuthEnv only
6+
37
## Release 5.9.3
48

59
- [13066](https://github.com/grafana/loki/pull/13066) **xperimental**: Use a minimum value for replay memory ceiling

operator/controllers/loki/lokistack_controller.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,11 @@ func (r *LokiStackReconciler) buildController(bld k8s.Builder) error {
221221
}
222222

223223
if r.FeatureGates.OpenShift.Enabled {
224-
bld = bld.
225-
Owns(&routev1.Route{}, updateOrDeleteOnlyPred).
226-
Owns(&cloudcredentialv1.CredentialsRequest{}, updateOrDeleteOnlyPred)
224+
bld = bld.Owns(&routev1.Route{}, updateOrDeleteOnlyPred)
225+
226+
if r.FeatureGates.OpenShift.TokenCCOAuthEnv {
227+
bld = bld.Owns(&cloudcredentialv1.CredentialsRequest{}, updateOrDeleteOnlyPred)
228+
}
227229

228230
if r.FeatureGates.OpenShift.ClusterTLSPolicy {
229231
bld = bld.Watches(&openshiftconfigv1.APIServer{}, r.enqueueAllLokiStacksHandler(), updateOrDeleteOnlyPred)

operator/controllers/loki/lokistack_controller_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func TestLokiStackController_RegisterOwnedResourcesForUpdateOrDeleteOnly(t *test
161161
{
162162
obj: &routev1.Route{},
163163
index: 10,
164-
ownCallsCount: 12,
164+
ownCallsCount: 11,
165165
featureGates: configv1.FeatureGates{
166166
OpenShift: configv1.OpenShiftFeatureGates{
167167
Enabled: true,
@@ -175,7 +175,8 @@ func TestLokiStackController_RegisterOwnedResourcesForUpdateOrDeleteOnly(t *test
175175
ownCallsCount: 12,
176176
featureGates: configv1.FeatureGates{
177177
OpenShift: configv1.OpenShiftFeatureGates{
178-
Enabled: true,
178+
Enabled: true,
179+
TokenCCOAuthEnv: true,
179180
},
180181
},
181182
pred: updateOrDeleteOnlyPred,

0 commit comments

Comments
 (0)