Skip to content

Commit 5d93c5b

Browse files
Merge branch 'main' into hostpath-support
2 parents 4b9b21f + 7350000 commit 5d93c5b

File tree

64 files changed

+3564
-1499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3564
-1499
lines changed

api/apps/v1alpha1/common_types.go

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,19 @@ const (
3636
DefaultNamedPortGRPC = "grpc"
3737
// DefaultNamedPortMetrics is the default name for metrics port.
3838
DefaultNamedPortMetrics = "metrics"
39+
// NGCAPIKey is the environment variable name for NGC API key.
40+
NGCAPIKey = "NGC_API_KEY"
41+
// HFToken is the environment variable name for Hugging Face token.
42+
HFToken = "HF_TOKEN"
3943
)
4044

4145
// Expose defines attributes to expose the service.
4246
type Expose struct {
4347
Service Service `json:"service,omitempty"`
44-
// Deprecated: Use .spec.router instead.
48+
// Deprecated: Use .spec.expose.router instead.
4549
Ingress Ingress `json:"ingress,omitempty"`
50+
51+
Router Router `json:"router,omitempty"`
4652
}
4753

4854
// +kubebuilder:validation:XValidation:rule="!(has(self.gateway) && has(self.ingress))", message="ingress and gateway cannot be specified together"
@@ -85,12 +91,18 @@ type Gateway struct {
8591
// +kubebuilder:default:=true
8692
// HTTPRoutesEnabled is a flag to enable HTTPRoutes for the created gateway.
8793
HTTPRoutesEnabled bool `json:"httpRoutesEnabled,omitempty"`
94+
95+
// +kubebuilder:default:=false
96+
// GRPCRoutesEnabled is a flag to enable GRPCRoutes for the created gateway.
97+
GRPCRoutesEnabled bool `json:"grpcRoutesEnabled,omitempty"`
8898
}
8999

90100
// DEPRECATED ExposeV1 defines attributes to expose the service.
91101
type ExposeV1 struct {
92102
Service Service `json:"service,omitempty"`
93103
Ingress IngressV1 `json:"ingress,omitempty"`
104+
// +kubebuilder:validation:XValidation:rule="!(has(self.gateway) && self.gateway.grpcRoutesEnabled)", message="unsupported field: spec.expose.router.gateway.grpcRoutesEnabled"
105+
Router Router `json:"router,omitempty"`
94106
}
95107

96108
// Service defines attributes to create a service.
@@ -119,7 +131,7 @@ type Service struct {
119131
Annotations map[string]string `json:"annotations,omitempty"`
120132
}
121133

122-
// Deprecated: Use .spec.router.ingress instead.
134+
// Deprecated: Use .spec.expose.router.ingress instead.
123135
// IngressV1 defines attributes for ingress
124136
// +kubebuilder:validation:XValidation:rule="(has(self.spec) && has(self.enabled) && self.enabled) || !has(self.enabled) || !self.enabled", message="spec cannot be nil when ingress is enabled"
125137
type IngressV1 struct {
@@ -272,6 +284,38 @@ func (r *Router) GenerateGatewayHTTPRouteSpec(namespace, name string, port int32
272284
}
273285
}
274286

287+
func (r *Router) GenerateGatewayGRPCRouteSpec(namespace, name string, port int32) gatewayv1.GRPCRouteSpec {
288+
if r.Gateway == nil || !r.Gateway.GRPCRoutesEnabled {
289+
return gatewayv1.GRPCRouteSpec{}
290+
}
291+
292+
return gatewayv1.GRPCRouteSpec{
293+
CommonRouteSpec: gatewayv1.CommonRouteSpec{
294+
ParentRefs: []gatewayv1.ParentReference{
295+
{
296+
Name: gatewayv1.ObjectName(r.Gateway.Name),
297+
Namespace: ptr.To(gatewayv1.Namespace(r.Gateway.Namespace)),
298+
},
299+
},
300+
},
301+
Hostnames: []gatewayv1.Hostname{gatewayv1.Hostname(r.getHostname(namespace, name))},
302+
Rules: []gatewayv1.GRPCRouteRule{
303+
{
304+
BackendRefs: []gatewayv1.GRPCBackendRef{
305+
{
306+
BackendRef: gatewayv1.BackendRef{
307+
BackendObjectReference: gatewayv1.BackendObjectReference{
308+
Name: gatewayv1.ObjectName(name),
309+
Port: ptr.To(gatewayv1.PortNumber(port)),
310+
},
311+
},
312+
},
313+
},
314+
},
315+
},
316+
}
317+
}
318+
275319
func (r *Router) getHostname(namespace, name string) string {
276320
return fmt.Sprintf("%s.%s.%s", name, namespace, r.HostDomainName)
277321
}

api/apps/v1alpha1/nemo_customizer_types.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const (
6767
)
6868

6969
// NemoCustomizerSpec defines the desired state of NemoCustomizer.
70-
// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.router.ingress."
70+
// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.expose.router.ingress."
7171
// +kubebuilder:validation:XValidation:rule="!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))",message="spec.replicas cannot be set when spec.scale.enabled is true"
7272
type NemoCustomizerSpec struct {
7373
Image Image `json:"image"`
@@ -85,7 +85,6 @@ type NemoCustomizerSpec struct {
8585
// +kubebuilder:validation:XValidation:rule="!(has(self.service.grpcPort))", message="unsupported field: spec.expose.service.grpcPort"
8686
// +kubebuilder:validation:XValidation:rule="!(has(self.service.metricsPort))", message="unsupported field: spec.expose.service.metricsPort"
8787
Expose ExposeV1 `json:"expose,omitempty"`
88-
Router Router `json:"router,omitempty"`
8988
Scale Autoscaling `json:"scale,omitempty"`
9089
Metrics Metrics `json:"metrics,omitempty"`
9190

@@ -643,7 +642,7 @@ func (n *NemoCustomizer) IsAutoScalingEnabled() bool {
643642

644643
// IsIngressEnabled returns true if ingress is enabled for NemoCustomizer deployment.
645644
func (n *NemoCustomizer) IsIngressEnabled() bool {
646-
return (n.Spec.Router.Ingress != nil && n.Spec.Router.Ingress.IngressClass != "") ||
645+
return (n.Spec.Expose.Router.Ingress != nil && n.Spec.Expose.Router.Ingress.IngressClass != "") ||
647646
(n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled) // TODO deprecate this once we have removed the .spec.expose.ingress field from the spec
648647
}
649648

@@ -653,15 +652,15 @@ func (n *NemoCustomizer) GetIngressSpec() networkingv1.IngressSpec {
653652
if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled {
654653
return n.Spec.Expose.Ingress.GenerateNetworkingV1IngressSpec(n.GetName())
655654
}
656-
return n.Spec.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName())
655+
return n.Spec.Expose.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName())
657656
}
658657

659658
func (n *NemoCustomizer) IsHTTPRouteEnabled() bool {
660-
return n.Spec.Router.Gateway != nil && n.Spec.Router.Gateway.HTTPRoutesEnabled
659+
return n.Spec.Expose.Router.Gateway != nil && n.Spec.Expose.Router.Gateway.HTTPRoutesEnabled
661660
}
662661

663662
func (n *NemoCustomizer) GetHTTPRouteSpec() gatewayv1.HTTPRouteSpec {
664-
return n.Spec.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort())
663+
return n.Spec.Expose.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort())
665664
}
666665

667666
// IsServiceMonitorEnabled returns true if servicemonitor is enabled for NemoCustomizer deployment.
@@ -1056,17 +1055,17 @@ func (n *NemoCustomizer) GetIngressAnnotations() map[string]string {
10561055
if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled {
10571056
return utils.MergeMaps(NemoCustomizerAnnotations, n.Spec.Expose.Ingress.Annotations)
10581057
}
1059-
if n.Spec.Router.Annotations != nil {
1060-
return utils.MergeMaps(NemoCustomizerAnnotations, n.Spec.Router.Annotations)
1058+
if n.Spec.Expose.Router.Annotations != nil {
1059+
return utils.MergeMaps(NemoCustomizerAnnotations, n.Spec.Expose.Router.Annotations)
10611060
}
10621061
return NemoCustomizerAnnotations
10631062
}
10641063

10651064
func (n *NemoCustomizer) GetHTTPRouteAnnotations() map[string]string {
10661065
annotations := n.GetNemoCustomizerAnnotations()
10671066

1068-
if n.Spec.Router.Annotations != nil {
1069-
return utils.MergeMaps(annotations, n.Spec.Router.Annotations)
1067+
if n.Spec.Expose.Router.Annotations != nil {
1068+
return utils.MergeMaps(annotations, n.Spec.Expose.Router.Annotations)
10701069
}
10711070
return annotations
10721071
}

api/apps/v1alpha1/nemo_datastore_types.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const (
5858
)
5959

6060
// NemoDatastoreSpec defines the desired state of NemoDatastore.
61-
// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.router.ingress."
61+
// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.expose.router.ingress."
6262
// +kubebuilder:validation:XValidation:rule="!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))",message="spec.replicas cannot be set when spec.scale.enabled is true"
6363
type NemoDatastoreSpec struct {
6464
Image Image `json:"image"`
@@ -76,7 +76,6 @@ type NemoDatastoreSpec struct {
7676
// +kubebuilder:validation:XValidation:rule="!(has(self.service.grpcPort))", message="unsupported field: spec.expose.service.grpcPort"
7777
// +kubebuilder:validation:XValidation:rule="!(has(self.service.metricsPort))", message="unsupported field: spec.expose.service.metricsPort"
7878
Expose ExposeV1 `json:"expose,omitempty"`
79-
Router Router `json:"router,omitempty"`
8079
Scale Autoscaling `json:"scale,omitempty"`
8180
Metrics Metrics `json:"metrics,omitempty"`
8281
// +kubebuilder:validation:Minimum=1
@@ -769,12 +768,12 @@ func (n *NemoDatastore) IsAutoScalingEnabled() bool {
769768

770769
// IsIngressEnabled returns true if ingress is enabled for NemoDatastore deployment.
771770
func (n *NemoDatastore) IsIngressEnabled() bool {
772-
return (n.Spec.Router.Ingress != nil && n.Spec.Router.Ingress.IngressClass != "") ||
771+
return (n.Spec.Expose.Router.Ingress != nil && n.Spec.Expose.Router.Ingress.IngressClass != "") ||
773772
(n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled) // TODO deprecate this once we have removed the .spec.expose.ingress field from the spec
774773
}
775774

776775
func (n *NemoDatastore) IsHTTPRouteEnabled() bool {
777-
return n.Spec.Router.Gateway != nil && n.Spec.Router.Gateway.HTTPRoutesEnabled
776+
return n.Spec.Expose.Router.Gateway != nil && n.Spec.Expose.Router.Gateway.HTTPRoutesEnabled
778777
}
779778

780779
// GetIngressSpec returns the Ingress spec NemoDatastore deployment.
@@ -783,11 +782,11 @@ func (n *NemoDatastore) GetIngressSpec() networkingv1.IngressSpec {
783782
if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled {
784783
return n.Spec.Expose.Ingress.GenerateNetworkingV1IngressSpec(n.GetName())
785784
}
786-
return n.Spec.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName())
785+
return n.Spec.Expose.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName())
787786
}
788787

789788
func (n *NemoDatastore) GetHTTPRouteSpec() gatewayv1.HTTPRouteSpec {
790-
return n.Spec.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort())
789+
return n.Spec.Expose.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort())
791790
}
792791

793792
// IsServiceMonitorEnabled returns true if servicemonitor is enabled for NemoDatastore deployment.
@@ -1107,17 +1106,17 @@ func (n *NemoDatastore) GetIngressAnnotations() map[string]string {
11071106
if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled {
11081107
return utils.MergeMaps(NemoDatastoreAnnotations, n.Spec.Expose.Ingress.Annotations)
11091108
}
1110-
if n.Spec.Router.Annotations != nil {
1111-
return utils.MergeMaps(NemoDatastoreAnnotations, n.Spec.Router.Annotations)
1109+
if n.Spec.Expose.Router.Annotations != nil {
1110+
return utils.MergeMaps(NemoDatastoreAnnotations, n.Spec.Expose.Router.Annotations)
11121111
}
11131112
return NemoDatastoreAnnotations
11141113
}
11151114

11161115
func (n *NemoDatastore) GetHTTPRouteAnnotations() map[string]string {
11171116
annotations := n.GetNemoDatastoreAnnotations()
11181117

1119-
if n.Spec.Router.Annotations != nil {
1120-
return utils.MergeMaps(annotations, n.Spec.Router.Annotations)
1118+
if n.Spec.Expose.Router.Annotations != nil {
1119+
return utils.MergeMaps(annotations, n.Spec.Expose.Router.Annotations)
11211120
}
11221121
return annotations
11231122
}

api/apps/v1alpha1/nemo_entitystore_types.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const (
5959
)
6060

6161
// NemoEntitystoreSpec defines the desired state of NemoEntitystore.
62-
// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.router.ingress."
62+
// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.expose.router.ingress."
6363
// +kubebuilder:validation:XValidation:rule="!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))",message="spec.replicas cannot be set when spec.scale.enabled is true"
6464
type NemoEntitystoreSpec struct {
6565
Image Image `json:"image"`
@@ -77,7 +77,6 @@ type NemoEntitystoreSpec struct {
7777
// +kubebuilder:validation:XValidation:rule="!(has(self.service.grpcPort))", message="unsupported field: spec.expose.service.grpcPort"
7878
// +kubebuilder:validation:XValidation:rule="!(has(self.service.metricsPort))", message="unsupported field: spec.expose.service.metricsPort"
7979
Expose ExposeV1 `json:"expose,omitempty"`
80-
Router Router `json:"router,omitempty"`
8180
Scale Autoscaling `json:"scale,omitempty"`
8281
Metrics Metrics `json:"metrics,omitempty"`
8382
// +kubebuilder:validation:Minimum=1
@@ -396,7 +395,7 @@ func (n *NemoEntitystore) IsAutoScalingEnabled() bool {
396395

397396
// IsIngressEnabled returns true if ingress is enabled for NemoEntitystore deployment.
398397
func (n *NemoEntitystore) IsIngressEnabled() bool {
399-
return (n.Spec.Router.Ingress != nil && n.Spec.Router.Ingress.IngressClass != "") ||
398+
return (n.Spec.Expose.Router.Ingress != nil && n.Spec.Expose.Router.Ingress.IngressClass != "") ||
400399
(n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled) // TODO deprecate this once we have removed the .spec.expose.ingress field from the spec
401400
}
402401

@@ -406,15 +405,15 @@ func (n *NemoEntitystore) GetIngressSpec() networkingv1.IngressSpec {
406405
if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled {
407406
return n.Spec.Expose.Ingress.GenerateNetworkingV1IngressSpec(n.GetName())
408407
}
409-
return n.Spec.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName())
408+
return n.Spec.Expose.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName())
410409
}
411410

412411
func (n *NemoEntitystore) IsHTTPRouteEnabled() bool {
413-
return n.Spec.Router.Gateway != nil && n.Spec.Router.Gateway.HTTPRoutesEnabled
412+
return n.Spec.Expose.Router.Gateway != nil && n.Spec.Expose.Router.Gateway.HTTPRoutesEnabled
414413
}
415414

416415
func (n *NemoEntitystore) GetHTTPRouteSpec() gatewayv1.HTTPRouteSpec {
417-
return n.Spec.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort())
416+
return n.Spec.Expose.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort())
418417
}
419418

420419
// IsServiceMonitorEnabled returns true if servicemonitor is enabled for NemoEntitystore deployment.
@@ -741,17 +740,17 @@ func (n *NemoEntitystore) GetIngressAnnotations() map[string]string {
741740
if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled {
742741
return utils.MergeMaps(NemoEntitystoreAnnotations, n.Spec.Expose.Ingress.Annotations)
743742
}
744-
if n.Spec.Router.Annotations != nil {
745-
return utils.MergeMaps(NemoEntitystoreAnnotations, n.Spec.Router.Annotations)
743+
if n.Spec.Expose.Router.Annotations != nil {
744+
return utils.MergeMaps(NemoEntitystoreAnnotations, n.Spec.Expose.Router.Annotations)
746745
}
747746
return NemoEntitystoreAnnotations
748747
}
749748

750749
func (n *NemoEntitystore) GetHTTPRouteAnnotations() map[string]string {
751750
annotations := n.GetNemoEntitystoreAnnotations()
752751

753-
if n.Spec.Router.Annotations != nil {
754-
return utils.MergeMaps(annotations, n.Spec.Router.Annotations)
752+
if n.Spec.Expose.Router.Annotations != nil {
753+
return utils.MergeMaps(annotations, n.Spec.Expose.Router.Annotations)
755754
}
756755
return annotations
757756
}

api/apps/v1alpha1/nemo_evaluator_types.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const (
5757
)
5858

5959
// NemoEvaluatorSpec defines the desired state of NemoEvaluator.
60-
// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.router) && has(self.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.router.ingress."
60+
// +kubebuilder:validation:XValidation:rule="!(has(self.expose.ingress) && has(self.expose.ingress.enabled) && self.expose.ingress.enabled && has(self.expose.router) && has(self.expose.router.ingress))", message=".spec.expose.ingress is deprecated, and will be removed in a future release. If .spec.expose.ingress is set, please do not set .spec.expose.router.ingress."
6161
// +kubebuilder:validation:XValidation:rule="!(has(self.scale) && has(self.scale.enabled) && self.scale.enabled && has(self.replicas))",message="spec.replicas cannot be set when spec.scale.enabled is true"
6262
type NemoEvaluatorSpec struct {
6363
Image Image `json:"image"`
@@ -76,7 +76,6 @@ type NemoEvaluatorSpec struct {
7676
// +kubebuilder:validation:XValidation:rule="!(has(self.service.grpcPort))", message="unsupported field: spec.expose.service.grpcPort"
7777
// +kubebuilder:validation:XValidation:rule="!(has(self.service.metricsPort))", message="unsupported field: spec.expose.service.metricsPort"
7878
Expose ExposeV1 `json:"expose,omitempty"`
79-
Router Router `json:"router,omitempty"`
8079
Scale Autoscaling `json:"scale,omitempty"`
8180
Metrics Metrics `json:"metrics,omitempty"`
8281
// +kubebuilder:validation:Minimum=1
@@ -586,12 +585,12 @@ func (n *NemoEvaluator) IsAutoScalingEnabled() bool {
586585

587586
// IsIngressEnabled returns true if ingress is enabled for NemoEvaluator deployment.
588587
func (n *NemoEvaluator) IsIngressEnabled() bool {
589-
return (n.Spec.Router.Ingress != nil && n.Spec.Router.Ingress.IngressClass != "") ||
588+
return (n.Spec.Expose.Router.Ingress != nil && n.Spec.Expose.Router.Ingress.IngressClass != "") ||
590589
(n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled) // TODO deprecate this once we have removed the .spec.expose.ingress field from the spec
591590
}
592591

593592
func (n *NemoEvaluator) IsHTTPRouteEnabled() bool {
594-
return n.Spec.Router.Gateway != nil && n.Spec.Router.Gateway.HTTPRoutesEnabled
593+
return n.Spec.Expose.Router.Gateway != nil && n.Spec.Expose.Router.Gateway.HTTPRoutesEnabled
595594
}
596595

597596
// GetIngressSpec returns the Ingress spec NemoEvaluator deployment.
@@ -600,11 +599,11 @@ func (n *NemoEvaluator) GetIngressSpec() networkingv1.IngressSpec {
600599
if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled {
601600
return n.Spec.Expose.Ingress.GenerateNetworkingV1IngressSpec(n.GetName())
602601
}
603-
return n.Spec.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName())
602+
return n.Spec.Expose.Router.GenerateIngressSpec(n.GetNamespace(), n.GetName())
604603
}
605604

606605
func (n *NemoEvaluator) GetHTTPRouteSpec() gatewayv1.HTTPRouteSpec {
607-
return n.Spec.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort())
606+
return n.Spec.Expose.Router.GenerateGatewayHTTPRouteSpec(n.GetNamespace(), n.GetName(), n.GetServicePort())
608607
}
609608

610609
// IsServiceMonitorEnabled returns true if servicemonitor is enabled for NemoEvaluator deployment.
@@ -929,17 +928,17 @@ func (n *NemoEvaluator) GetIngressAnnotations() map[string]string {
929928
if n.Spec.Expose.Ingress.Enabled != nil && *n.Spec.Expose.Ingress.Enabled {
930929
return utils.MergeMaps(NemoEvaluatorAnnotations, n.Spec.Expose.Ingress.Annotations)
931930
}
932-
if n.Spec.Router.Annotations != nil {
933-
return utils.MergeMaps(NemoEvaluatorAnnotations, n.Spec.Router.Annotations)
931+
if n.Spec.Expose.Router.Annotations != nil {
932+
return utils.MergeMaps(NemoEvaluatorAnnotations, n.Spec.Expose.Router.Annotations)
934933
}
935934
return NemoEvaluatorAnnotations
936935
}
937936

938937
func (n *NemoEvaluator) GetHTTPRouteAnnotations() map[string]string {
939938
annotations := n.GetNemoEvaluatorAnnotations()
940939

941-
if n.Spec.Router.Annotations != nil {
942-
return utils.MergeMaps(annotations, n.Spec.Router.Annotations)
940+
if n.Spec.Expose.Router.Annotations != nil {
941+
return utils.MergeMaps(annotations, n.Spec.Expose.Router.Annotations)
943942
}
944943
return annotations
945944
}

0 commit comments

Comments
 (0)