Skip to content

Commit

Permalink
Make HttpManagement.Enabled a pointer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miles-Garnsey committed Oct 19, 2023
1 parent dc5f807 commit 874360e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apis/reaper/v1alpha1/reaper_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ type HttpManagement struct {
// When enabled, HTTP will be used instead of JMX for management connectivity between Cassandra
// and Reaper. In future, this will be true by default
// +kubebuilder:default=false
Enabled bool `json:"enabled"`
Enabled *bool `json:"enabled"`
}

// +kubebuilder:object:root=true
Expand Down
7 changes: 6 additions & 1 deletion apis/reaper/v1alpha1/zz_generated.deepcopy.go

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

2 changes: 1 addition & 1 deletion pkg/reaper/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func NewDeployment(reaper *api.Reaper, dc *cassdcapi.CassandraDatacenter, keysto
Value: fmt.Sprintf("%d", reaper.Spec.HeapSize.Value()),
})
}
if reaper.Spec.HttpManagement.Enabled {
if reaper.Spec.HttpManagement.Enabled != nil && *reaper.Spec.HttpManagement.Enabled {
envVars = append(envVars, corev1.EnvVar{
Name: "REAPER_HTTP_MANAGEMENT_ENABLE",
Value: "true",
Expand Down
2 changes: 1 addition & 1 deletion pkg/reaper/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestNewDeployment(t *testing.T) {
reaper.Spec.AutoScheduling = reaperapi.AutoScheduling{Enabled: false}
reaper.Spec.ServiceAccountName = "reaper"
reaper.Spec.DatacenterAvailability = DatacenterAvailabilityAll
reaper.Spec.HttpManagement.Enabled = true
reaper.Spec.HttpManagement.Enabled = pointer.Bool(true)
reaper.Spec.ClientEncryptionStores = &encryption.Stores{
KeystoreSecretRef: &encryption.SecretKeySelector{LocalObjectReference: corev1.LocalObjectReference{
Name: "keystore-secret",
Expand Down

0 comments on commit 874360e

Please sign in to comment.