Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncing latest changes from main for ocs-client-operator #258

Merged
merged 4 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RUN make go-build

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot
FROM registry.access.redhat.com/ubi9/ubi-minimal
WORKDIR /
COPY --from=builder /workspace/bin/manager .
COPY --from=builder /workspace/bin/status-reporter .
Expand Down
13 changes: 12 additions & 1 deletion bundle/manifests/ocs-client-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
categories: Storage
console.openshift.io/plugins: '["odf-client-console"]'
containerImage: quay.io/ocs-dev/ocs-client-operator:latest
createdAt: "2024-10-07T10:43:06Z"
createdAt: "2024-10-14T12:21:27Z"
description: OpenShift Data Foundation client operator enables consumption of
storage services from a remote centralized OpenShift Data Foundation provider
cluster.
Expand Down Expand Up @@ -326,6 +326,17 @@ spec:
- list
- update
- watch
- apiGroups:
- ramendr.openshift.io
resources:
- drclusterconfigs
verbs:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- security.openshift.io
resources:
Expand Down
5 changes: 0 additions & 5 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ func main() {

ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))

storageclustersSelector := fields.SelectorFromSet(fields.Set{"metadata.name": "storageclusters.ocs.openshift.io"})
subscriptionwebhookSelector := fields.SelectorFromSet(fields.Set{"metadata.name": templates.SubscriptionWebhookName})
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
Expand All @@ -114,10 +113,6 @@ func main() {
LeaderElectionID: "7cb6f2e5.ocs.openshift.io",
Cache: cache.Options{
ByObject: map[client.Object]cache.ByObject{
&extv1.CustomResourceDefinition{}: {
// only cache storagecluster crd
Field: storageclustersSelector,
},
&admrv1.ValidatingWebhookConfiguration{}: {
// only cache our validation webhook
Field: subscriptionwebhookSelector,
Expand Down
11 changes: 11 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,17 @@ rules:
- list
- update
- watch
- apiGroups:
- ramendr.openshift.io
resources:
- drclusterconfigs
verbs:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- security.openshift.io
resources:
Expand Down
2 changes: 1 addition & 1 deletion hack/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RESTART_EXIT_CODE=42

while true; do
./usr/local/bin/ocs-operator $@
./manager $@
EXIT_CODE=$?
if [ $EXIT_CODE -ne $RESTART_EXIT_CODE ]; then
exit $EXIT_CODE
Expand Down
1 change: 1 addition & 0 deletions internal/controller/storageclaim_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func (r *StorageClaimReconciler) SetupWithManager(mgr ctrl.Manager) error {
//+kubebuilder:rbac:groups=core,resources=persistentvolumes,verbs=get;list;watch
//+kubebuilder:rbac:groups=snapshot.storage.k8s.io,resources=volumesnapshotcontents,verbs=get;list;watch
//+kubebuilder:rbac:groups=csi.ceph.io,resources=clientprofiles,verbs=get;list;update;create;watch;delete
//+kubebuilder:rbac:groups=ramendr.openshift.io,resources=drclusterconfigs,verbs=get;list;update;create;watch;delete

// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.
Expand Down
4 changes: 2 additions & 2 deletions pkg/utils/predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ func CrdCreateAndDeletePredicate(log *logr.Logger, crdName string, crdExists boo
return predicate.Funcs{
CreateFunc: func(_ event.CreateEvent) bool {
if !crdExists {
log.Info("CustomResourceDefinition %s was Created.", crdName)
log.Info("CustomResourceDefinition was Created.", "CustomResourceDefinition", crdName)
}
return !crdExists
},
DeleteFunc: func(_ event.DeleteEvent) bool {
if crdExists {
log.Info("CustomResourceDefinition %s was Deleted.", crdName)
log.Info("CustomResourceDefinition was Deleted.", "CustomResourceDefinition", crdName)
}
return crdExists
},
Expand Down
Loading