diff --git a/docs/api.md b/docs/api.md index 934322df..9a1b0644 100644 --- a/docs/api.md +++ b/docs/api.md @@ -181,6 +181,7 @@ NamespaceOptions defines parameters for an M3DB namespace. See https://m3db.gith | snapshotEnabled | SnapshotEnabled controls whether snapshotting is enabled. | bool | false | | retentionOptions | RetentionOptions sets the retention parameters. | [RetentionOptions](#retentionoptions) | false | | indexOptions | IndexOptions sets the indexing parameters. | [IndexOptions](#indexoptions) | false | +| coldWritesEnabled | ColdWritesEnabled controls whether cold writes are enabled. | bool | false | [Back to TOC](#table-of-contents) diff --git a/pkg/apis/m3dboperator/v1alpha1/namespace.go b/pkg/apis/m3dboperator/v1alpha1/namespace.go index babfe5da..f2f5ff51 100644 --- a/pkg/apis/m3dboperator/v1alpha1/namespace.go +++ b/pkg/apis/m3dboperator/v1alpha1/namespace.go @@ -90,4 +90,7 @@ type NamespaceOptions struct { // IndexOptions sets the indexing parameters. IndexOptions IndexOptions `json:"indexOptions,omitempty"` + + // ColdWritesEnabled controls whether cold writes are enabled. + ColdWritesEnabled bool `json:"coldWritesEnabled,omitempty"` } diff --git a/pkg/controller/add_cluster_test.go b/pkg/controller/add_cluster_test.go index 6be70cb1..30d6c0d5 100644 --- a/pkg/controller/add_cluster_test.go +++ b/pkg/controller/add_cluster_test.go @@ -27,10 +27,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/pointer" "github.com/rakyll/statik/fs" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "k8s.io/utils/pointer" ) func registerValidConfigMap(content string) error { diff --git a/pkg/controller/update_cluster_test.go b/pkg/controller/update_cluster_test.go index 97340ccf..a6e877f8 100644 --- a/pkg/controller/update_cluster_test.go +++ b/pkg/controller/update_cluster_test.go @@ -31,8 +31,8 @@ import ( myspec "github.com/m3db/m3db-operator/pkg/apis/m3dboperator/v1alpha1" crdfake "github.com/m3db/m3db-operator/pkg/client/clientset/versioned/fake" - "github.com/m3db/m3db-operator/pkg/k8sops/m3db" "github.com/m3db/m3db-operator/pkg/k8sops/labels" + "github.com/m3db/m3db-operator/pkg/k8sops/m3db" "github.com/m3db/m3db-operator/pkg/k8sops/podidentity" "github.com/m3db/m3db-operator/pkg/m3admin" diff --git a/pkg/k8sops/m3db/config_map_test.go b/pkg/k8sops/m3db/config_map_test.go index 575ab8df..b9a9e640 100644 --- a/pkg/k8sops/m3db/config_map_test.go +++ b/pkg/k8sops/m3db/config_map_test.go @@ -28,10 +28,10 @@ import ( corev1 "k8s.io/api/core/v1" - "k8s.io/utils/pointer" "github.com/rakyll/statik/fs" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "k8s.io/utils/pointer" ) func registerValidConfigMap() error { diff --git a/pkg/m3admin/namespace/namespace.go b/pkg/m3admin/namespace/namespace.go index 04013325..0fbdc132 100644 --- a/pkg/m3admin/namespace/namespace.go +++ b/pkg/m3admin/namespace/namespace.go @@ -99,6 +99,7 @@ func m3dbNamespaceOptsFromSpec(opts *myspec.NamespaceOptions) (*m3ns.NamespaceOp RetentionOptions: retentionOpts, SnapshotEnabled: opts.SnapshotEnabled, IndexOptions: indexOpts, + ColdWritesEnabled: opts.ColdWritesEnabled, }, nil } diff --git a/pkg/m3admin/namespace/presets.go b/pkg/m3admin/namespace/presets.go index 1294ab17..d809be47 100644 --- a/pkg/m3admin/namespace/presets.go +++ b/pkg/m3admin/namespace/presets.go @@ -61,6 +61,7 @@ var ( Enabled: true, BlockSize: (2 * time.Hour).String(), }, + ColdWritesEnabled: false, } presetOneMinuteFourtyDaysIndexed = myspec.NamespaceOptions{ @@ -82,5 +83,6 @@ var ( Enabled: true, BlockSize: (24 * time.Hour).String(), }, + ColdWritesEnabled: false, } )