Skip to content

Commit a4c00e7

Browse files
committed
add dsci to schema instead of odh
Signed-off-by: Kevin <kpostlet@redhat.com>
1 parent 66efa5a commit a4c00e7

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
corev1 "k8s.io/api/core/v1"
2525
"k8s.io/apimachinery/pkg/runtime"
2626
"k8s.io/apimachinery/pkg/util/validation/field"
27-
"k8s.io/utils/pointer"
27+
"k8s.io/utils/ptr"
2828
ctrl "sigs.k8s.io/controller-runtime"
2929
logf "sigs.k8s.io/controller-runtime/pkg/log"
3030
"sigs.k8s.io/controller-runtime/pkg/webhook"
@@ -66,7 +66,7 @@ var _ webhook.CustomValidator = &rayClusterWebhook{}
6666
func (w *rayClusterWebhook) Default(ctx context.Context, obj runtime.Object) error {
6767
rayCluster := obj.(*rayv1.RayCluster)
6868

69-
if !pointer.BoolDeref(w.Config.RayDashboardOAuthEnabled, true) {
69+
if !ptr.Deref(w.Config.RayDashboardOAuthEnabled, true) {
7070
return nil
7171
}
7272

@@ -143,7 +143,7 @@ func validateOAuthProxyVolume(rayCluster *rayv1.RayCluster) field.ErrorList {
143143
func validateIngress(rayCluster *rayv1.RayCluster) field.ErrorList {
144144
var allErrors field.ErrorList
145145

146-
if pointer.BoolDeref(rayCluster.Spec.HeadGroupSpec.EnableIngress, false) {
146+
if ptr.Deref(rayCluster.Spec.HeadGroupSpec.EnableIngress, false) {
147147
allErrors = append(allErrors, field.Invalid(
148148
field.NewPath("spec", "headGroupSpec", "enableIngress"),
149149
rayCluster.Spec.HeadGroupSpec.EnableIngress,

0 commit comments

Comments
 (0)