Skip to content

Commit ac05654

Browse files
committed
use jumpstarter.namespace.domain
1 parent 39c1100 commit ac05654

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

deploy/operator/bundle/manifests/jumpstarter-operator.clusterserviceversion.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ metadata:
1818
}
1919
]
2020
capabilities: Basic Install
21-
createdAt: "2025-12-17T15:29:25Z"
21+
createdAt: "2025-12-19T16:12:44Z"
2222
operators.operatorframework.io/builder: operator-sdk-v1.41.1
2323
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
2424
name: jumpstarter-operator.v0.8.0
@@ -108,6 +108,14 @@ spec:
108108
- get
109109
- patch
110110
- update
111+
- apiGroups:
112+
- config.openshift.io
113+
resources:
114+
- ingresses
115+
verbs:
116+
- get
117+
- list
118+
- watch
111119
- apiGroups:
112120
- coordination.k8s.io
113121
resources:

deploy/operator/internal/controller/jumpstarter/endpoints/discovery.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package endpoints
1818

1919
import (
2020
"context"
21-
"fmt"
2221

2322
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2423
"k8s.io/apimachinery/pkg/runtime/schema"
@@ -89,10 +88,8 @@ func detectOpenShiftBaseDomain(config *rest.Config) string {
8988
return ""
9089
}
9190

92-
// Add jumpstarter prefix to the cluster's apps domain
93-
baseDomain := fmt.Sprintf("jumpstarter.%s", domain)
94-
logger.Info("Auto-detected OpenShift baseDomain", "clusterDomain", domain, "baseDomain", baseDomain)
95-
return baseDomain
91+
logger.Info("Auto-detected OpenShift cluster domain", "domain", domain)
92+
return domain
9693
}
9794

9895
// unstructuredNestedString extracts a nested string from an unstructured object

deploy/operator/internal/controller/jumpstarter/endpoints/endpoints.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,11 @@ func NewReconciler(client client.Client, scheme *runtime.Scheme, config *rest.Co
7171

7272
// ApplyDefaults applies endpoint defaults to a JumpstarterSpec using the
7373
// reconciler's discovered cluster capabilities (Route vs Ingress availability).
74-
// If baseDomain is not provided in the spec, it will use the default baseDomain
75-
// (auto-detected from OpenShift cluster config) if available.
76-
func (r *Reconciler) ApplyDefaults(spec *operatorv1alpha1.JumpstarterSpec) {
77-
// Use default baseDomain if not provided in spec
74+
// If baseDomain is not provided in the spec, it will generate one using the pattern
75+
// jumpstarter.$namespace.$clusterDomain (auto-detected from OpenShift cluster config).
76+
func (r *Reconciler) ApplyDefaults(spec *operatorv1alpha1.JumpstarterSpec, namespace string) {
7877
if spec.BaseDomain == "" && r.DefaultBaseDomain != "" {
79-
spec.BaseDomain = r.DefaultBaseDomain
78+
spec.BaseDomain = fmt.Sprintf("jumpstarter.%s.%s", namespace, r.DefaultBaseDomain)
8079
}
8180
ApplyEndpointDefaults(spec, r.RouteAvailable, r.IngressAvailable)
8281
}

deploy/operator/internal/controller/jumpstarter/jumpstarter_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func (r *JumpstarterReconciler) Reconcile(ctx context.Context, req ctrl.Request)
133133

134134
// Apply runtime-computed defaults (endpoints based on baseDomain and cluster capabilities)
135135
// Static defaults are handled by kubebuilder annotations in the CRD schema
136-
r.EndpointReconciler.ApplyDefaults(&jumpstarter.Spec)
136+
r.EndpointReconciler.ApplyDefaults(&jumpstarter.Spec, jumpstarter.Namespace)
137137

138138
// Reconcile RBAC resources first
139139
if err := r.reconcileRBAC(ctx, &jumpstarter); err != nil {

0 commit comments

Comments
 (0)