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

Add monTimeout param in storagecluster CR #2940

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions api/v1/storagecluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ type ManageCephCluster struct {

// Whether to allow updating the device class after the OSD is initially provisioned
AllowDeviceClassUpdate bool `json:"allowDeviceClassUpdate,omitempty"`

// CephClusterHealthCheckSpec represent the healthcheck for Ceph daemons
HealthCheck *rookCephv1.CephClusterHealthCheckSpec `json:"healthCheck,omitempty"`
}

// ManageCephConfig defines how to reconcile the Ceph configuration
Expand Down
5 changes: 5 additions & 0 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

396 changes: 396 additions & 0 deletions config/crd/bases/ocs.openshift.io_storageclusters.yaml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions controllers/storagecluster/cephcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,10 @@ func newCephCluster(sc *ocsv1.StorageCluster, cephImage string, kmsConfigMap *co
cephCluster.Spec.DisruptionManagement.OSDMaintenanceTimeout = sc.Spec.ManagedResources.CephCluster.OsdMaintenanceTimeout
}

if sc.Spec.ManagedResources.CephCluster.HealthCheck != nil {
cephCluster.Spec.HealthCheck = *sc.Spec.ManagedResources.CephCluster.HealthCheck
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extra space, though I'm curious why the CI didn't catch it with go vet

Suggested change
cephCluster.Spec.HealthCheck = *sc.Spec.ManagedResources.CephCluster.HealthCheck
cephCluster.Spec.HealthCheck = *sc.Spec.ManagedResources.CephCluster.HealthCheck

}

if sc.Spec.LogCollector != nil {
if sc.Spec.LogCollector.Periodicity != "" {
cephCluster.Spec.LogCollector.Periodicity = sc.Spec.LogCollector.Periodicity
Expand Down
15 changes: 15 additions & 0 deletions controllers/storagecluster/cephcluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1539,6 +1539,21 @@ func TestEnsureUpgradeReliabilityParams(t *testing.T) {
assert.Equal(t, 45*time.Minute, expected.Spec.DisruptionManagement.OSDMaintenanceTimeout)
}

func TestMonTimeOutParam(t *testing.T) {
sc := &ocsv1.StorageCluster{}
mockStorageCluster.DeepCopyInto(sc)
sc.Spec.ManagedResources.CephCluster.HealthCheck = &rookCephv1.CephClusterHealthCheckSpec{
DaemonHealth: rookCephv1.DaemonHealthSpec{
Monitor: rookCephv1.HealthCheckSpec{
Timeout: "3",
},
},
}
expected := newCephCluster(sc, "", nil, log)
assert.Equal(t, "3", expected.Spec.HealthCheck.DaemonHealth.Monitor.Timeout)
assert.Equal(t, false, expected.Spec.HealthCheck.DaemonHealth.Monitor.Disabled)
}

func TestDetermineDefaultCephDeviceClass(t *testing.T) {
cases := []struct {
label string
Expand Down
396 changes: 396 additions & 0 deletions deploy/csv-templates/crds/ocs/ocs.openshift.io_storageclusters.yaml

Large diffs are not rendered by default.

396 changes: 396 additions & 0 deletions deploy/ocs-operator/manifests/storagecluster.crd.yaml

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading