Skip to content

Add a default route#266

Open
esposem wants to merge 1 commit intoopenshift:mainfrom
esposem:route
Open

Add a default route#266
esposem wants to merge 1 commit intoopenshift:mainfrom
esposem:route

Conversation

@esposem
Copy link

@esposem esposem commented Jan 23, 2026

When Trustee is started, if there is no existing route, create a passthrough when restrictive mode and the https certs are given, otherwise create an edge one.

Copy link

@lmilleri lmilleri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @esposem, just a few nits

@vvoronko
Copy link

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 23, 2026
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 27, 2026
@openshift-ci
Copy link

openshift-ci bot commented Feb 27, 2026

New changes are detected. LGTM label has been removed.

return spec
}
spec = r.configureHttps(spec)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'd move the route creation in another place since this code is specific for creating the KbsConfigSpec

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't follow what you mean

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have added the route code into the buildKbsConfigSpec function. This code is specific for building the KbsConfigSpec instance, but the route is not part of it. Move this code to the Reconcile function, just above this line?
r.trusteeConfig.Status.IsReady = true

// createOrUpdateKbsRoute creates a route for the KBS service if it doesn't already exist
// If the route already exists, this function does nothing
func (r *TrusteeConfigReconciler) createOrUpdateKbsRoute(ctx context.Context, termination routev1.TLSTerminationType) error {
routeName := KbsRouteName

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd follow the same name convention as other objects, otherwise we could have issues when having multiple TrusteeConfig in the same namespace.
For example r.trusteeConfig.Name + "-kbs-route"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes but the service is hardcoded anyways, so wouldn't be the same issue with the service?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok fair enough, we can address this in another PR

When Trustee is started, if there is no existing route, create a
passthrough when restrictive mode and the https certs are given,
otherwise create an edge one.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Copy link

@lmilleri lmilleri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens with different service types, e.g. ClusterIp or NodePort. Does the route need to change?

return spec
}
spec = r.configureHttps(spec)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have added the route code into the buildKbsConfigSpec function. This code is specific for building the KbsConfigSpec instance, but the route is not part of it. Move this code to the Reconcile function, just above this line?
r.trusteeConfig.Status.IsReady = true

// createOrUpdateKbsRoute creates a route for the KBS service if it doesn't already exist
// If the route already exists, this function does nothing
func (r *TrusteeConfigReconciler) createOrUpdateKbsRoute(ctx context.Context, termination routev1.TLSTerminationType) error {
routeName := KbsRouteName

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok fair enough, we can address this in another PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants