Skip to content

Commit 428f608

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 afdae6f commit 428f608

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
@@ -182,12 +182,7 @@ func (c *authOperator) handleSync(operatorConfig *operatorv1.Authentication) err
182182
}
183183
resourceVersions = append(resourceVersions, route.GetResourceVersion())
184184

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

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

0 commit comments

Comments
 (0)