Skip to content

Commit 51c8014

Browse files
Merge pull request #273 from red-hat-storage/sync_ds--main
Syncing latest changes from main for ocs-client-operator
2 parents 627e8ec + 59e1460 commit 51c8014

File tree

9 files changed

+118
-53
lines changed

9 files changed

+118
-53
lines changed

bundle/manifests/ocs-client-operator.clusterserviceversion.yaml

+12-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
categories: Storage
88
console.openshift.io/plugins: '["odf-client-console"]'
99
containerImage: quay.io/ocs-dev/ocs-client-operator:latest
10-
createdAt: "2024-11-14T15:13:37Z"
10+
createdAt: "2024-11-18T12:48:54Z"
1111
description: OpenShift Data Foundation client operator enables consumption of
1212
storage services from a remote centralized OpenShift Data Foundation provider
1313
cluster.
@@ -164,6 +164,17 @@ spec:
164164
- list
165165
- update
166166
- watch
167+
- apiGroups:
168+
- csi.ceph.io
169+
resources:
170+
- clientprofilemappings
171+
verbs:
172+
- create
173+
- delete
174+
- get
175+
- list
176+
- update
177+
- watch
167178
- apiGroups:
168179
- csi.ceph.io
169180
resources:

config/rbac/role.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,17 @@ rules:
121121
- list
122122
- update
123123
- watch
124+
- apiGroups:
125+
- csi.ceph.io
126+
resources:
127+
- clientprofilemappings
128+
verbs:
129+
- create
130+
- delete
131+
- get
132+
- list
133+
- update
134+
- watch
124135
- apiGroups:
125136
- csi.ceph.io
126137
resources:

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exclude (
1818
)
1919

2020
require (
21-
github.com/ceph/ceph-csi-operator/api v0.0.0-20240812072523-4d50cf3a32a0
21+
github.com/ceph/ceph-csi-operator/api v0.0.0-20241114115439-f325f74205d3
2222
github.com/go-logr/logr v1.4.2
2323
github.com/kubernetes-csi/external-snapshotter/client/v8 v8.0.0
2424
github.com/onsi/ginkgo v1.16.5

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r
5454
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
5555
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
5656
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
57-
github.com/ceph/ceph-csi-operator/api v0.0.0-20240812072523-4d50cf3a32a0 h1:LIAWGeOu1JzrhknCyD0JbuCUuCuhfiY/H+cBz4nsUcg=
58-
github.com/ceph/ceph-csi-operator/api v0.0.0-20240812072523-4d50cf3a32a0/go.mod h1:odEUoarG26wXBCC2l4O4nMWhAz6VTKr2FRkv9yELgi8=
57+
github.com/ceph/ceph-csi-operator/api v0.0.0-20241114115439-f325f74205d3 h1:ft8h5V7BfQqIGJAyiTvn6x86Oi/yMs8yqW7rfKvN9SQ=
58+
github.com/ceph/ceph-csi-operator/api v0.0.0-20241114115439-f325f74205d3/go.mod h1:odEUoarG26wXBCC2l4O4nMWhAz6VTKr2FRkv9yELgi8=
5959
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
6060
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
6161
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=

internal/controller/storageclient_controller.go

+18-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ func (r *StorageClientReconciler) SetupWithManager(mgr ctrl.Manager) error {
103103
Owns(&quotav1.ClusterResourceQuota{}, builder.WithPredicates(generationChangePredicate)).
104104
Owns(&nbv1.NooBaa{}, builder.WithPredicates(predicate.GenerationChangedPredicate{})).
105105
Owns(&corev1.Secret{}).
106-
Owns(&csiopv1a1.CephConnection{}, builder.WithPredicates(generationChangePredicate))
106+
Owns(&csiopv1a1.CephConnection{}, builder.WithPredicates(generationChangePredicate)).
107+
Owns(&csiopv1a1.ClientProfileMapping{}, builder.WithPredicates(generationChangePredicate))
107108

108109
return bldr.Complete(r)
109110
}
@@ -118,6 +119,7 @@ func (r *StorageClientReconciler) SetupWithManager(mgr ctrl.Manager) error {
118119
//+kubebuilder:rbac:groups=csi.ceph.io,resources=cephconnections,verbs=get;list;update;create;watch;delete
119120
//+kubebuilder:rbac:groups=noobaa.io,resources=noobaas,verbs=get;list;watch;create;update;delete
120121
//+kubebuilder:rbac:groups="",resources=secrets,verbs=get;list;watch;create;update;delete
122+
//+kubebuilder:rbac:groups=csi.ceph.io,resources=clientprofilemappings,verbs=get;list;update;create;watch;delete
121123

122124
func (r *StorageClientReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
123125
var err error
@@ -235,6 +237,21 @@ func (r *StorageClientReconciler) reconcilePhases() (ctrl.Result, error) {
235237
}); err != nil {
236238
return reconcile.Result{}, fmt.Errorf("failed to reconcile cephConnection: %v", err)
237239
}
240+
case "ClientProfileMapping":
241+
clientProfileMapping := &csiopv1a1.ClientProfileMapping{}
242+
clientProfileMapping.Name = eResource.Name
243+
clientProfileMapping.Namespace = r.OperatorNamespace
244+
if _, err := controllerutil.CreateOrUpdate(r.ctx, r.Client, clientProfileMapping, func() error {
245+
if err := r.own(clientProfileMapping); err != nil {
246+
return fmt.Errorf("failed to own clientProfileMapping resource: %v", err)
247+
}
248+
if err := json.Unmarshal(eResource.Data, &clientProfileMapping.Spec); err != nil {
249+
return fmt.Errorf("failed to unmarshall clientProfileMapping spec: %v", err)
250+
}
251+
return nil
252+
}); err != nil {
253+
return reconcile.Result{}, fmt.Errorf("failed to reconcile clientProfileMapping: %v", err)
254+
}
238255
case "Secret":
239256
data := map[string]string{}
240257
if err := json.Unmarshal(eResource.Data, &data); err != nil {

vendor/github.com/ceph/ceph-csi-operator/api/v1alpha1/clientprofilemapping_types.go

+17-19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/ceph/ceph-csi-operator/api/v1alpha1/driver_types.go

+10-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/ceph/ceph-csi-operator/api/v1alpha1/zz_generated.deepcopy.go

+46-26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ github.com/beorn7/perks/quantile
44
# github.com/blang/semver/v4 v4.0.0
55
## explicit; go 1.14
66
github.com/blang/semver/v4
7-
# github.com/ceph/ceph-csi-operator/api v0.0.0-20240812072523-4d50cf3a32a0
7+
# github.com/ceph/ceph-csi-operator/api v0.0.0-20241114115439-f325f74205d3
88
## explicit; go 1.22.0
99
github.com/ceph/ceph-csi-operator/api/v1alpha1
1010
# github.com/cespare/xxhash/v2 v2.3.0

0 commit comments

Comments
 (0)