diff --git a/docs/Manual/Deployment/Kubernetes/DeploymentResource.md b/docs/Manual/Deployment/Kubernetes/DeploymentResource.md index 1e05de4aa..b6f3fb9bb 100644 --- a/docs/Manual/Deployment/Kubernetes/DeploymentResource.md +++ b/docs/Manual/Deployment/Kubernetes/DeploymentResource.md @@ -325,7 +325,7 @@ servers. When not specified, no monitoring token is used. The default value is empty. -### `spec.disableIPV6: bool` +### `spec.disableIPv6: bool` This setting prevents the use of IPv6 addresses by ArangoDB servers. The default is `false`. diff --git a/pkg/apis/deployment/v1alpha/deployment_spec.go b/pkg/apis/deployment/v1alpha/deployment_spec.go index 5c51a4728..3a55163b4 100644 --- a/pkg/apis/deployment/v1alpha/deployment_spec.go +++ b/pkg/apis/deployment/v1alpha/deployment_spec.go @@ -51,7 +51,7 @@ type DeploymentSpec struct { Image *string `json:"image,omitempty"` ImagePullPolicy *v1.PullPolicy `json:"imagePullPolicy,omitempty"` DowntimeAllowed *bool `json:"downtimeAllowed,omitempty"` - DisableIPV6 *bool `json:"disableIPV6,omitempty"` + DisableIPv6 *bool `json:"disableIPv6,omitempty"` ExternalAccess ExternalAccessSpec `json:"externalAccess"` RocksDB RocksDBSpec `json:"rocksdb"` @@ -99,14 +99,14 @@ func (s DeploymentSpec) IsDowntimeAllowed() bool { return util.BoolOrDefault(s.DowntimeAllowed) } -// IsDisableIPV6 returns the value of disableIPV6. -func (s DeploymentSpec) IsDisableIPV6() bool { - return util.BoolOrDefault(s.DisableIPV6) +// IsDisableIPv6 returns the value of disableIPv6. +func (s DeploymentSpec) IsDisableIPv6() bool { + return util.BoolOrDefault(s.DisableIPv6) } -// GetListenAddr returns "[::]" or "0.0.0.0" depending on IsDisableIPV6 +// GetListenAddr returns "[::]" or "0.0.0.0" depending on IsDisableIPv6 func (s DeploymentSpec) GetListenAddr() string { - if s.IsDisableIPV6() { + if s.IsDisableIPv6() { return "0.0.0.0" } return "[::]" @@ -194,8 +194,8 @@ func (s *DeploymentSpec) SetDefaultsFrom(source DeploymentSpec) { if s.DowntimeAllowed == nil { s.DowntimeAllowed = util.NewBoolOrNil(source.DowntimeAllowed) } - if s.DisableIPV6 == nil { - s.DisableIPV6 = util.NewBoolOrNil(source.DisableIPV6) + if s.DisableIPv6 == nil { + s.DisableIPv6 = util.NewBoolOrNil(source.DisableIPv6) } s.ExternalAccess.SetDefaultsFrom(source.ExternalAccess) s.RocksDB.SetDefaultsFrom(source.RocksDB) @@ -286,9 +286,9 @@ func (s DeploymentSpec) ResetImmutableFields(target *DeploymentSpec) []string { target.StorageEngine = NewStorageEngineOrNil(s.StorageEngine) resetFields = append(resetFields, "storageEngine") } - if s.IsDisableIPV6() != target.IsDisableIPV6() { - target.DisableIPV6 = util.NewBoolOrNil(s.DisableIPV6) - resetFields = append(resetFields, "disableIPV6") + if s.IsDisableIPv6() != target.IsDisableIPv6() { + target.DisableIPv6 = util.NewBoolOrNil(s.DisableIPv6) + resetFields = append(resetFields, "disableIPv6") } if l := s.ExternalAccess.ResetImmutableFields("externalAccess", &target.ExternalAccess); l != nil { resetFields = append(resetFields, l...) diff --git a/pkg/apis/deployment/v1alpha/deployment_spec_test.go b/pkg/apis/deployment/v1alpha/deployment_spec_test.go index 4bd447905..a30ee351f 100644 --- a/pkg/apis/deployment/v1alpha/deployment_spec_test.go +++ b/pkg/apis/deployment/v1alpha/deployment_spec_test.go @@ -97,11 +97,11 @@ func TestDeploymentSpecResetImmutableFields(t *testing.T) { []string{"mode", "agents.count"}, }, { - DeploymentSpec{DisableIPV6: util.NewBool(false)}, - DeploymentSpec{DisableIPV6: util.NewBool(true)}, - DeploymentSpec{DisableIPV6: util.NewBool(false)}, + DeploymentSpec{DisableIPv6: util.NewBool(false)}, + DeploymentSpec{DisableIPv6: util.NewBool(true)}, + DeploymentSpec{DisableIPv6: util.NewBool(false)}, false, - []string{"disableIPV6"}, + []string{"disableIPv6"}, }, } diff --git a/pkg/apis/deployment/v1alpha/zz_generated.deepcopy.go b/pkg/apis/deployment/v1alpha/zz_generated.deepcopy.go index 37e37b3a4..2886d19ff 100644 --- a/pkg/apis/deployment/v1alpha/zz_generated.deepcopy.go +++ b/pkg/apis/deployment/v1alpha/zz_generated.deepcopy.go @@ -239,8 +239,8 @@ func (in *DeploymentSpec) DeepCopyInto(out *DeploymentSpec) { *out = new(bool) **out = **in } - if in.DisableIPV6 != nil { - in, out := &in.DisableIPV6, &out.DisableIPV6 + if in.DisableIPv6 != nil { + in, out := &in.DisableIPv6, &out.DisableIPv6 *out = new(bool) **out = **in } diff --git a/scripts/kube_run_tests.sh b/scripts/kube_run_tests.sh index 9df7dec27..0d9597c40 100755 --- a/scripts/kube_run_tests.sh +++ b/scripts/kube_run_tests.sh @@ -18,5 +18,6 @@ kubectl --namespace ${DEPLOYMENTNAMESPACE} \ --env="ARANGODIMAGE=${ARANGODIMAGE}" \ --env="TEST_NAMESPACE=${DEPLOYMENTNAMESPACE}" \ --env="CLEANDEPLOYMENTS=${CLEANDEPLOYMENTS}" \ + --env="TESTDISABLEIPV6=${TESTDISABLEIPV6}" \ -- \ -test.v -test.timeout $TESTTIMEOUT $TESTLENGTHOPTIONS $TESTOPTIONS diff --git a/tests/test_util.go b/tests/test_util.go index 0a4276e78..7d593ecc7 100644 --- a/tests/test_util.go +++ b/tests/test_util.go @@ -49,10 +49,10 @@ import ( api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1alpha" "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/arangod" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/arangodb/kube-arangodb/pkg/util/retry" - "github.com/arangodb/kube-arangodb/pkg/util" ) const ( @@ -271,6 +271,11 @@ func newDeployment(name string) *api.ArangoDeployment { depl.Spec.Image = util.NewString(image) } + disableIPv6 := strings.TrimSpace(os.Getenv("TESTDISABLEIPV6")) + if disableIPv6 != "" && disableIPv6 != "0" { + depl.Spec.DisableIPv6 = util.NewBool(true) + } + return depl }