Skip to content

Commit f6c7929

Browse files
committed
add dsci to schema instead of odh
Signed-off-by: Kevin <[email protected]>
1 parent b1fd2ae commit f6c7929

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

config/rbac/role.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ rules:
4646
- get
4747
- patch
4848
- update
49+
- apiGroups:
50+
- dscinitialization.opendatahub.io
51+
resources:
52+
- dscinitializations
53+
verbs:
54+
- get
4955
- apiGroups:
5056
- networking.k8s.io
5157
resources:
@@ -56,12 +62,6 @@ rules:
5662
- get
5763
- patch
5864
- update
59-
- apiGroups:
60-
- dscinitialization.opendatahub.io
61-
resources:
62-
- dscinitializations
63-
verbs:
64-
- get
6565
- apiGroups:
6666
- ray.io
6767
resources:

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"strings"
2525
"time"
2626

27-
odhv1 "github.com/opendatahub-io/opendatahub-operator/v2/apis/features/v1"
27+
dsciv1 "github.com/opendatahub-io/opendatahub-operator/v2/apis/dscinitialization/v1"
2828
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
2929
"go.uber.org/zap/zapcore"
3030

@@ -72,7 +72,7 @@ func init() {
7272
// OpenShift Route
7373
utilruntime.Must(routev1.Install(scheme))
7474
// ODH
75-
utilruntime.Must(odhv1.AddToScheme(scheme))
75+
utilruntime.Must(dsciv1.AddToScheme(scheme))
7676
}
7777

7878
func main() {

pkg/controllers/raycluster_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ func (r *RayClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request)
223223
kubeRayNamespaces = []string{dsci.Spec.ApplicationsNamespace}
224224
}
225225

226-
_, err = r.kubeClient.NetworkingV1().NetworkPolicies(cluster.Namespace).Apply(ctx, desiredNetworkPolicy(&cluster, kubeRayNamespaces), metav1.ApplyOptions{FieldManager: controllerName, Force: true})
226+
_, err = r.kubeClient.NetworkingV1().NetworkPolicies(cluster.Namespace).Apply(ctx, desiredNetworkPolicy(cluster, kubeRayNamespaces), metav1.ApplyOptions{FieldManager: controllerName, Force: true})
227227
if err != nil {
228228
logger.Error(err, "Failed to update NetworkPolicy")
229229
}

pkg/controllers/raycluster_webhook.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323

2424
corev1 "k8s.io/api/core/v1"
2525
"k8s.io/apimachinery/pkg/runtime"
26-
"k8s.io/utils/pointer"
26+
"k8s.io/utils/ptr"
2727
ctrl "sigs.k8s.io/controller-runtime"
2828
logf "sigs.k8s.io/controller-runtime/pkg/log"
2929
"sigs.k8s.io/controller-runtime/pkg/webhook"
@@ -54,8 +54,7 @@ var _ webhook.CustomDefaulter = &rayClusterDefaulter{}
5454
// Default implements webhook.Defaulter so a webhook will be registered for the type
5555
func (r *rayClusterDefaulter) Default(ctx context.Context, obj runtime.Object) error {
5656
raycluster := obj.(*rayv1.RayCluster)
57-
58-
if !pointer.BoolDeref(r.Config.RayDashboardOAuthEnabled, true) {
57+
if !ptr.Deref(r.Config.RayDashboardOAuthEnabled, true) {
5958
return nil
6059
}
6160

0 commit comments

Comments
 (0)