Skip to content

Commit

Permalink
Merge pull request #2440 from raaizik/rdr-odfinfo
Browse files Browse the repository at this point in the history
RDR: ODF info CM logic
  • Loading branch information
openshift-merge-bot[bot] committed May 19, 2024
2 parents 05df196 + 8d54518 commit ec44394
Show file tree
Hide file tree
Showing 72 changed files with 500 additions and 7,335 deletions.
11 changes: 0 additions & 11 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,6 @@ rules:
- list
- update
- watch
- apiGroups:
- cluster.open-cluster-management.io
resources:
- clusterclaims
verbs:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- config.openshift.io
resources:
Expand Down
296 changes: 0 additions & 296 deletions controllers/storagecluster/clusterclaims.go

This file was deleted.

3 changes: 2 additions & 1 deletion controllers/storagecluster/external_resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ func createExternalClusterReconcilerFromCustomResources(
UninstallModeAnnotation: string(UninstallModeGraceful),
CleanupPolicyAnnotation: string(CleanupPolicyDelete),
},
Finalizers: []string{storageClusterFinalizer},
Finalizers: []string{storageClusterFinalizer},
OwnerReferences: []metav1.OwnerReference{{Name: "storage-test", Kind: "StorageSystem", APIVersion: "v1"}},
},
Spec: api.StorageClusterSpec{
ExternalStorage: api.ExternalStorageClusterSpec{
Expand Down
30 changes: 28 additions & 2 deletions controllers/storagecluster/initialization_reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ package storagecluster

import (
"context"
"fmt"
"github.com/blang/semver/v4"
oprverion "github.com/operator-framework/api/pkg/lib/version"
opv1a1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
ocsversion "github.com/red-hat-storage/ocs-operator/v4/version"
"os"
"testing"

Expand Down Expand Up @@ -39,7 +44,8 @@ func createStorageCluster(scName, failureDomainName string,
UninstallModeAnnotation: string(UninstallModeGraceful),
CleanupPolicyAnnotation: string(CleanupPolicyDelete),
},
Finalizers: []string{storageClusterFinalizer},
Finalizers: []string{storageClusterFinalizer},
OwnerReferences: []metav1.OwnerReference{{Name: "storage-test", Kind: "StorageSystem", APIVersion: "v1"}},
},
Spec: api.StorageClusterSpec{
Monitoring: &api.MonitoringSpec{
Expand Down Expand Up @@ -349,6 +355,26 @@ func createFakeInitializationStorageClusterReconciler(t *testing.T, obj ...runti
Phase: cephv1.ConditionType(util.PhaseReady),
},
}
verOcs, err := semver.Make(getSemVer(ocsversion.Version, 1, true))
if err != nil {
panic(err)
}
csv := &opv1a1.ClusterServiceVersion{
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("ocs-operator-%s", sc.Name),
Namespace: sc.Namespace,
},
Spec: opv1a1.ClusterServiceVersionSpec{
Version: oprverion.OperatorVersion{Version: verOcs},
},
}

rookCephMonSecret := &v1.Secret{
ObjectMeta: metav1.ObjectMeta{Name: "rook-ceph-mon", Namespace: sc.Namespace},
Data: map[string][]byte{
"fsid": []byte(cephFSID),
},
}

statusSubresourceObjs := []client.Object{sc}
var runtimeObjects []runtime.Object
Expand All @@ -363,7 +389,7 @@ func createFakeInitializationStorageClusterReconciler(t *testing.T, obj ...runti
}
}

runtimeObjects = append(runtimeObjects, mockNodeList.DeepCopy(), cbp, cfs, cnfs, cnfsbp, cnfssvc, infrastructure, networkConfig)
runtimeObjects = append(runtimeObjects, mockNodeList.DeepCopy(), cbp, cfs, cnfs, cnfsbp, cnfssvc, infrastructure, networkConfig, rookCephMonSecret, csv)
client := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(runtimeObjects...).WithStatusSubresource(statusSubresourceObjs...).Build()

return StorageClusterReconciler{
Expand Down

0 comments on commit ec44394

Please sign in to comment.