@@ -126,7 +126,6 @@ func AutoDetectTenantSecrets(
126
126
127
127
// Filter secrets for configured tenants.
128
128
configuredTenants := strings .Split (managedTenants , "," )
129
- missingSecretTenants := strings .Split (managedTenants , "," )
130
129
for i := range secret .Items {
131
130
lbls := secret .Items [i ].Labels
132
131
@@ -137,9 +136,6 @@ func AutoDetectTenantSecrets(
137
136
// If tenant is not configured, skip.
138
137
if ! slices .Contains (configuredTenants , lbls ["tenant" ]) {
139
138
continue
140
- } else {
141
- s , _ := slices .BinarySearch (missingSecretTenants , lbls ["tenant" ])
142
- missingSecretTenants = slices .Delete (missingSecretTenants , s , s + 1 )
143
139
}
144
140
145
141
if secret .Items [i ].Data == nil {
@@ -175,10 +171,6 @@ func AutoDetectTenantSecrets(
175
171
tenantSecret [lbls ["tenant" ]] = tOIDC
176
172
}
177
173
178
- if len (missingSecretTenants ) != 0 {
179
- return tenantSecret , errors .Newf ("missing secrets for tenants: %v" , missingSecretTenants )
180
- }
181
-
182
174
return tenantSecret , nil
183
175
}
184
176
@@ -209,9 +201,7 @@ func (o *ObsctlRulesSyncer) InitOrReloadObsctlConfig() error {
209
201
tenantSecrets , err := o .autoDetectSecretsFn (o .ctx , o .k8s , o .namespace , o .audience , o .issuerURL , o .managedTenants )
210
202
if err != nil {
211
203
level .Error (o .logger ).Log ("msg" , "auto detecting tenant secrets" , "error" , err )
212
- if len (tenantSecrets ) == 0 {
213
- return errors .Wrap (err , "no tenant secrets auto-detected" )
214
- }
204
+ return errors .Wrap (err , "auto detecting tenant secrets" )
215
205
}
216
206
217
207
// Add all managed tenants under the API.
0 commit comments