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

RDR: ODF info CM logic #2440

Merged
merged 2 commits into from
May 19, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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