Skip to content

Commit

Permalink
Disable StorageConfig webhook validation failure
Browse files Browse the repository at this point in the history
  • Loading branch information
burmanm committed Jun 28, 2024
1 parent 9099f2a commit 9eaec35
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
17 changes: 8 additions & 9 deletions apis/cassandra/v1beta1/cassandradatacenter_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"encoding/json"
"errors"
"fmt"
"reflect"
"strings"

"github.com/k8ssandra/cass-operator/pkg/images"
Expand Down Expand Up @@ -175,15 +174,15 @@ func ValidateDatacenterFieldChanges(oldDc CassandraDatacenter, newDc CassandraDa

// CassandraDataVolumeClaimSpec changes are disallowed

if !reflect.DeepEqual(oldDc.Spec.StorageConfig.CassandraDataVolumeClaimSpec, newDc.Spec.StorageConfig.CassandraDataVolumeClaimSpec) {
return attemptedTo("change storageConfig.CassandraDataVolumeClaimSpec")
}
// if !reflect.DeepEqual(oldDc.Spec.StorageConfig.CassandraDataVolumeClaimSpec, newDc.Spec.StorageConfig.CassandraDataVolumeClaimSpec) {
// return attemptedTo("change storageConfig.CassandraDataVolumeClaimSpec")
// }

if oldDc.Spec.StorageConfig.CassandraDataVolumeClaimSpec != nil {
if !reflect.DeepEqual(*oldDc.Spec.StorageConfig.CassandraDataVolumeClaimSpec, *newDc.Spec.StorageConfig.CassandraDataVolumeClaimSpec) {
return attemptedTo("change storageConfig.CassandraDataVolumeClaimSpec")
}
}
// if oldDc.Spec.StorageConfig.CassandraDataVolumeClaimSpec != nil {
// if !reflect.DeepEqual(*oldDc.Spec.StorageConfig.CassandraDataVolumeClaimSpec, *newDc.Spec.StorageConfig.CassandraDataVolumeClaimSpec) {
// return attemptedTo("change storageConfig.CassandraDataVolumeClaimSpec")
// }
// }

// Topology changes - Racks
// - Rack Name and Zone changes are disallowed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.15.0
name: cassandradatacenters.cassandra.datastax.com
spec:
group: cassandra.datastax.com
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/control.k8ssandra.io_cassandratasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.15.0
name: cassandratasks.control.k8ssandra.io
spec:
group: control.k8ssandra.io
Expand Down

0 comments on commit 9eaec35

Please sign in to comment.