Skip to content

Commit

Permalink
DSC controller: manage missing resources previously defined v1
Browse files Browse the repository at this point in the history
Add the following resources to manage:

- PersistentVolumeClaim
- Service
- DaemonSet
- StatefulSet
- DeploymentConfig
- ImageStream
- BuildConfig
- CustomResourceDefinition
- APIService
- Ingress
- MutatingWebhookConfiguration
- ValidatingWebhookConfiguration
- ServiceAccount

It requires to add them to the scheme in main.go.
Also `go mod tidy` is run to update modules information to make it
buildable (keep bisectable).

Autogenerated files:
- go.mod
- go.sum

Closes: opendatahub-io#637

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
  • Loading branch information
ykaliuta committed Nov 5, 2023
1 parent cf40712 commit bd6a46e
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 0 deletions.
22 changes: 22 additions & 0 deletions controllers/datasciencecluster/datasciencecluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ import (
"github.com/opendatahub-io/opendatahub-operator/v2/components"
"github.com/opendatahub-io/opendatahub-operator/v2/controllers/status"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/upgrade"

admv1 "k8s.io/api/admissionregistration/v1"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
"sigs.k8s.io/controller-runtime/pkg/predicate"

ocappsv1 "github.com/openshift/api/apps/v1"
ocbuildv1 "github.com/openshift/api/build/v1"
ocimgv1 "github.com/openshift/api/image/v1"
)

// DataScienceClusterReconciler reconciles a DataScienceCluster object.
Expand Down Expand Up @@ -325,6 +334,19 @@ func (r *DataScienceClusterReconciler) SetupWithManager(mgr ctrl.Manager) error
Owns(&appsv1.Deployment{}).
Owns(&appsv1.ReplicaSet{}).
Owns(&corev1.Pod{}).
Owns(&corev1.PersistentVolumeClaim{}).
Owns(&corev1.Service{}).
Owns(&appsv1.DaemonSet{}).
Owns(&appsv1.StatefulSet{}).
Owns(&ocappsv1.DeploymentConfig{}).
Owns(&ocimgv1.ImageStream{}).
Owns(&ocbuildv1.BuildConfig{}).
Owns(&apiextensionsv1.CustomResourceDefinition{}).
Owns(&apiregistrationv1.APIService{}).
Owns(&netv1.Ingress{}).
Owns(&admv1.MutatingWebhookConfiguration{}).
Owns(&admv1.ValidatingWebhookConfiguration{}).
Owns(&corev1.ServiceAccount{}).
Watches(&source.Kind{Type: &dsci.DSCInitialization{}}, handler.EnqueueRequestsFromMapFunc(r.watchDataScienceClusterResources)).
Watches(&source.Kind{Type: &corev1.ConfigMap{}}, handler.EnqueueRequestsFromMapFunc(r.watchDataScienceClusterResources)).
// this predicates prevents meaningless reconciliations from being triggered
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ require (
k8s.io/apiextensions-apiserver v0.28.2
k8s.io/apimachinery v0.28.2
k8s.io/client-go v11.0.0+incompatible
k8s.io/kube-aggregator v0.23.0-alpha.1
sigs.k8s.io/controller-runtime v0.14.6
sigs.k8s.io/kustomize/api v0.13.4
sigs.k8s.io/kustomize/kyaml v0.14.2
Expand Down

0 comments on commit bd6a46e

Please sign in to comment.