Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions cmd/controllers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,25 @@ func init() {
}

func RegisterSchemas(scheme *runtime.Scheme) error {
podAutoscalerEnabled := features.IsControllerEnabled(features.PodAutoscalerController)
modelAdapterEnabled := features.IsControllerEnabled(features.ModelAdapterController)
distributedInferenceEnabled := features.IsControllerEnabled(features.DistributedInferenceController)
kvCacheEnabled := features.IsControllerEnabled(features.KVCacheController)
stormServiceEnabled := features.IsControllerEnabled(features.StormServiceController)

if features.IsControllerEnabled(features.PodAutoscalerController) {
if podAutoscalerEnabled {
utilruntime.Must(autoscalingv1alpha1.AddToScheme(scheme))
}

if features.IsControllerEnabled(features.ModelAdapterController) {
if modelAdapterEnabled {
utilruntime.Must(modelv1alpha1.AddToScheme(scheme))
}

if features.IsControllerEnabled(features.DistributedInferenceController) {
utilruntime.Must(orchestrationv1alpha1.AddToScheme(scheme))
if distributedInferenceEnabled {
utilruntime.Must(rayclusterv1.AddToScheme(scheme))
}

if features.IsControllerEnabled(features.KVCacheController) {
utilruntime.Must(orchestrationv1alpha1.AddToScheme(scheme))
}

if features.IsControllerEnabled(features.StormServiceController) {
if distributedInferenceEnabled || kvCacheEnabled || stormServiceEnabled {
Copy link
Collaborator

Choose a reason for hiding this comment

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

do you know whether there's a way fine grain control the scheme. Currently, we have to register the group level.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't quite understand. Do you mean whether can we more finely control which CRDs are registered to the scheme?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

IIUC, Kubernetes runtime.Scheme now registers types at the API group level (e.g., orchestrationv1alpha1), and not to register individual CRDs selectively. 🤔

However, it is technically possible to achieve finer control by manually registering specific types using scheme.AddKnownTypes()(maybe..but not test this at all), also this increases maintenance cost.

Copy link
Collaborator

Choose a reason for hiding this comment

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

sure. let's keep group level at this moment

utilruntime.Must(orchestrationv1alpha1.AddToScheme(scheme))
}

Expand Down