Skip to content

Commit 7856409

Browse files
committed
Move OAuth metadata publishing right after route handling
As we don't yet have a cluster operator deployed by the CVO, we need to make sure that the OAuth metadata is published as soon as we can so that it is reflected in the API server for the other components. Once we get the cluster operator deployed by CVO, this can be done at any time as CVO will need to wait for us to report availability. Make sure to keep in mind that everything has to be in place to report available status, then!
1 parent b890cf1 commit 7856409

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pkg/operator2/operator.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,7 @@ func (c *authOperator) handleSync(operatorConfig *operatorv1.Authentication) err
183183
}
184184
resourceVersions = append(resourceVersions, route.GetResourceVersion())
185185

186-
serviceCA, servingCert, err := c.handleServiceCA()
187-
if err != nil {
188-
return err
189-
}
190-
resourceVersions = append(resourceVersions, serviceCA.GetResourceVersion(), servingCert.GetResourceVersion())
191-
186+
// make sure API server sees our metadata as soon as we've got a route with a host
192187
metadata, _, err := resourceapply.ApplyConfigMap(c.configMaps, c.recorder, getMetadataConfigMap(route))
193188
if err != nil {
194189
return err
@@ -201,6 +196,12 @@ func (c *authOperator) handleSync(operatorConfig *operatorv1.Authentication) err
201196
}
202197
resourceVersions = append(resourceVersions, authConfig.GetResourceVersion())
203198

199+
serviceCA, servingCert, err := c.handleServiceCA()
200+
if err != nil {
201+
return err
202+
}
203+
resourceVersions = append(resourceVersions, serviceCA.GetResourceVersion(), servingCert.GetResourceVersion())
204+
204205
service, _, err := resourceapply.ApplyService(c.services, c.recorder, defaultService())
205206
if err != nil {
206207
return err

0 commit comments

Comments
 (0)