Skip to content

Commit

Permalink
Change catalogPersistenceEnabled property name
Browse files Browse the repository at this point in the history
  • Loading branch information
dzeromski-hazelcast committed Aug 14, 2023
1 parent 4ed2fc8 commit b0c524e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 24 deletions.
4 changes: 2 additions & 2 deletions api/v1alpha1/hazelcast_types.go
Expand Up @@ -1065,15 +1065,15 @@ type SQL struct {
// +optional
StatementTimeout int32 `json:"statementTimeout"`

// CatalogPersistence sets whether SQL Catalog persistence is enabled for the node.
// CatalogPersistenceEnabled sets whether SQL Catalog persistence is enabled for the node.
// With SQL Catalog persistence enabled you can restart the whole cluster without
// losing schema definition objects (such as MAPPINGs, TYPEs, VIEWs and DATA CONNECTIONs).
// The feature is implemented on top of the Hot Restart feature of Hazelcast
// which persists the data to disk. If enabled, you have to also configure
// Hot Restart. Feature is disabled by default.
// +kubebuilder:default:=false
// +optional
CatalogPersistence bool `json:"catalogPersistence"`
CatalogPersistenceEnabled bool `json:"catalogPersistenceEnabled"`
}

// HazelcastStatus defines the observed state of Hazelcast
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/hazelcast_validation.go
Expand Up @@ -530,7 +530,7 @@ func (v *hazelcastValidator) validateSQL(h *Hazelcast) {
return
}

if h.Spec.SQL.CatalogPersistence && !h.Spec.Persistence.IsEnabled() {
if h.Spec.SQL.CatalogPersistenceEnabled && !h.Spec.Persistence.IsEnabled() {
v.addErr(field.Forbidden(field.NewPath("spec").Child("sql").Child("catalogPersistence"),
"catalogPersistence requires Hazelcast persistence enabled"))
}
Expand Down
17 changes: 9 additions & 8 deletions config/crd/bases/hazelcast.com_hazelcasts.yaml
Expand Up @@ -1824,15 +1824,16 @@ spec:
sql:
description: Hazelcast SQL configuration
properties:
catalogPersistence:
catalogPersistenceEnabled:
default: false
description: CatalogPersistence sets whether SQL Catalog persistence
is enabled for the node. With SQL Catalog persistence enabled
you can restart the whole cluster without losing schema definition
objects (such as MAPPINGs, TYPEs, VIEWs and DATA CONNECTIONs).
The feature is implemented on top of the Hot Restart feature
of Hazelcast which persists the data to disk. If enabled, you
have to also configure Hot Restart. Feature is disabled by default.
description: CatalogPersistenceEnabled sets whether SQL Catalog
persistence is enabled for the node. With SQL Catalog persistence
enabled you can restart the whole cluster without losing schema
definition objects (such as MAPPINGs, TYPEs, VIEWs and DATA
CONNECTIONs). The feature is implemented on top of the Hot Restart
feature of Hazelcast which persists the data to disk. If enabled,
you have to also configure Hot Restart. Feature is disabled
by default.
type: boolean
statementTimeout:
default: 0
Expand Down
2 changes: 1 addition & 1 deletion controllers/hazelcast/hazelcast_resources.go
Expand Up @@ -937,7 +937,7 @@ func hazelcastBasicConfig(h *hazelcastv1alpha1.Hazelcast) config.Hazelcast {
if h.Spec.SQL != nil {
cfg.SQL = config.SQL{
StatementTimeout: h.Spec.SQL.StatementTimeout,
CatalogPersistence: h.Spec.SQL.CatalogPersistence,
CatalogPersistence: h.Spec.SQL.CatalogPersistenceEnabled,
}
}

Expand Down
Expand Up @@ -2099,15 +2099,16 @@ spec:
sql:
description: Hazelcast SQL configuration
properties:
catalogPersistence:
catalogPersistenceEnabled:
default: false
description: CatalogPersistence sets whether SQL Catalog persistence
is enabled for the node. With SQL Catalog persistence enabled
you can restart the whole cluster without losing schema definition
objects (such as MAPPINGs, TYPEs, VIEWs and DATA CONNECTIONs).
The feature is implemented on top of the Hot Restart feature
of Hazelcast which persists the data to disk. If enabled, you
have to also configure Hot Restart. Feature is disabled by default.
description: CatalogPersistenceEnabled sets whether SQL Catalog
persistence is enabled for the node. With SQL Catalog persistence
enabled you can restart the whole cluster without losing schema
definition objects (such as MAPPINGs, TYPEs, VIEWs and DATA
CONNECTIONs). The feature is implemented on top of the Hot Restart
feature of Hazelcast which persists the data to disk. If enabled,
you have to also configure Hot Restart. Feature is disabled
by default.
type: boolean
statementTimeout:
default: 0
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/config/hazelcast/config.go
Expand Up @@ -471,7 +471,7 @@ var (
},
},
SQL: &hazelcastv1alpha1.SQL{
CatalogPersistence: true,
CatalogPersistenceEnabled: true,
},
},
}
Expand Down
6 changes: 3 additions & 3 deletions test/integration/hazelcast_test.go
Expand Up @@ -2067,7 +2067,7 @@ var _ = Describe("Hazelcast CR", func() {
It("should fail if Hazelcast persistence is not enabled", Label("fast"), func() {
spec := test.HazelcastSpec(defaultHazelcastSpecValues(), ee)
spec.SQL = &hazelcastv1alpha1.SQL{
CatalogPersistence: true,
CatalogPersistenceEnabled: true,
}

hz := &hazelcastv1alpha1.Hazelcast{
Expand All @@ -2090,7 +2090,7 @@ var _ = Describe("Hazelcast CR", func() {
},
}
spec.SQL = &hazelcastv1alpha1.SQL{
CatalogPersistence: true,
CatalogPersistenceEnabled: true,
}
hz := &hazelcastv1alpha1.Hazelcast{
ObjectMeta: randomObjectMeta(namespace),
Expand All @@ -2100,7 +2100,7 @@ var _ = Describe("Hazelcast CR", func() {
Create(hz)
hz = ensureHzStatusIsPending(hz)

Expect(hz.Spec.SQL.CatalogPersistence).Should(BeTrue())
Expect(hz.Spec.SQL.CatalogPersistenceEnabled).Should(BeTrue())
})
})
})
Expand Down

0 comments on commit b0c524e

Please sign in to comment.