Skip to content

Commit 3a49729

Browse files
authored
[Bugfix] Fix Checksum Calculation (#1905)
1 parent 9c8921a commit 3a49729

File tree

6 files changed

+32
-17
lines changed

6 files changed

+32
-17
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- (Feature) (Platform) OpenID Integration
1818
- (Maintenance) Operator Labeling Skip
1919
- (Feature) Optional LocalStorage CRD
20+
- (Bugfix) Fix Checksum Calculation
2021

2122
## [1.2.48](https://github.com/arangodb/kube-arangodb/tree/1.2.48) (2025-05-08)
2223
- (Maintenance) Extend Documentation

docs/api/ArangoDeployment.V1.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3182,7 +3182,7 @@ Possible Values:
31823182

31833183
### .spec.gateway.cookiesSupport
31843184

3185-
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway.go#L49)</sup>
3185+
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway.go#L48)</sup>
31863186

31873187
CookiesSupport defines if Cookie based authentication via `X-ArangoDB-Token-JWT`
31883188

@@ -3192,7 +3192,7 @@ Default Value: `true`
31923192

31933193
### .spec.gateway.createUsers
31943194

3195-
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway.go#L53)</sup>
3195+
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway.go#L52)</sup>
31963196

31973197
CreateUsers defines if authenticated users will be created in ArangoDB
31983198

@@ -3202,7 +3202,7 @@ Default Value: `false`
32023202

32033203
### .spec.gateway.defaultTargetAuthentication
32043204

3205-
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway.go#L57)</sup>
3205+
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway.go#L56)</sup>
32063206

32073207
DefaultTargetAuthentication defines if default endpoints check authentication via envoy (Cookie and Header based auth)
32083208

@@ -3212,7 +3212,7 @@ Default Value: `true`
32123212

32133213
### .spec.gateway.dynamic
32143214

3215-
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway.go#L41)</sup>
3215+
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway.go#L40)</sup>
32163216

32173217
Dynamic setting enables/disables support dynamic configuration of the gateway in the cluster.
32183218
When enabled, gateway config will be reloaded by ConfigMap live updates.
@@ -3223,7 +3223,7 @@ Default Value: `true`
32233223

32243224
### .spec.gateway.enabled
32253225

3226-
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway.go#L36)</sup>
3226+
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway.go#L35)</sup>
32273227

32283228
Enabled setting enables/disables support for gateway in the cluster.
32293229
When enabled, the cluster will contain a number of `gateway` servers.
@@ -3234,7 +3234,7 @@ Default Value: `false`
32343234

32353235
### .spec.gateway.image
32363236

3237-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway.go#L45)</sup>
3237+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway.go#L44)</sup>
32383238

32393239
Image is the image to use for the gateway.
32403240
By default, the image is determined by the operator.
@@ -3243,7 +3243,7 @@ By default, the image is determined by the operator.
32433243

32443244
### .spec.gateway.timeout
32453245

3246-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway.go#L62)</sup>
3246+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.48/pkg/apis/deployment/v1/deployment_spec_gateway.go#L61)</sup>
32473247

32483248
Timeout defines default timeout for the upstream actions (if not overridden)
32493249

pkg/apis/deployment/v1/deployment_spec.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -656,9 +656,14 @@ func (s DeploymentSpec) ResetImmutableFields(target *DeploymentSpec) []string {
656656
if s.Gateways != nil {
657657
if target.Gateways == nil {
658658
target.Gateways = &ServerGroupSpec{}
659-
}
660-
if l := s.Gateways.ResetImmutableFields(ServerGroupGateways, "gateways", target.Gateways); l != nil {
661-
resetFields = append(resetFields, l...)
659+
if l := s.Gateways.ResetImmutableFields(ServerGroupGateways, "gateways", target.Gateways); l != nil {
660+
resetFields = append(resetFields, l...)
661+
}
662+
target.Gateways = nil
663+
} else {
664+
if l := s.Gateways.ResetImmutableFields(ServerGroupGateways, "gateways", target.Gateways); l != nil {
665+
resetFields = append(resetFields, l...)
666+
}
662667
}
663668
}
664669
if l := s.Metrics.ResetImmutableFields("metrics", &target.Metrics); l != nil {

pkg/apis/deployment/v1/deployment_spec_gateway.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
2525

2626
shared "github.com/arangodb/kube-arangodb/pkg/apis/shared"
27-
"github.com/arangodb/kube-arangodb/pkg/util"
2827
"github.com/arangodb/kube-arangodb/pkg/util/constants"
2928
"github.com/arangodb/kube-arangodb/pkg/util/errors"
3029
)
@@ -141,5 +140,8 @@ func (d *DeploymentSpecGateway) Validate() error {
141140

142141
// GetImage returns the image to use for the gateway.
143142
func (d *DeploymentSpecGateway) GetImage() string {
144-
return util.TypeOrDefault[string](d.Image)
143+
if d == nil || d.Image == nil {
144+
return ""
145+
}
146+
return *d.Image
145147
}

pkg/apis/deployment/v2alpha1/deployment_spec.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -656,9 +656,14 @@ func (s DeploymentSpec) ResetImmutableFields(target *DeploymentSpec) []string {
656656
if s.Gateways != nil {
657657
if target.Gateways == nil {
658658
target.Gateways = &ServerGroupSpec{}
659-
}
660-
if l := s.Gateways.ResetImmutableFields(ServerGroupGateways, "gateways", target.Gateways); l != nil {
661-
resetFields = append(resetFields, l...)
659+
if l := s.Gateways.ResetImmutableFields(ServerGroupGateways, "gateways", target.Gateways); l != nil {
660+
resetFields = append(resetFields, l...)
661+
}
662+
target.Gateways = nil
663+
} else {
664+
if l := s.Gateways.ResetImmutableFields(ServerGroupGateways, "gateways", target.Gateways); l != nil {
665+
resetFields = append(resetFields, l...)
666+
}
662667
}
663668
}
664669
if l := s.Metrics.ResetImmutableFields("metrics", &target.Metrics); l != nil {

pkg/apis/deployment/v2alpha1/deployment_spec_gateway.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
2525

2626
shared "github.com/arangodb/kube-arangodb/pkg/apis/shared"
27-
"github.com/arangodb/kube-arangodb/pkg/util"
2827
"github.com/arangodb/kube-arangodb/pkg/util/constants"
2928
"github.com/arangodb/kube-arangodb/pkg/util/errors"
3029
)
@@ -141,5 +140,8 @@ func (d *DeploymentSpecGateway) Validate() error {
141140

142141
// GetImage returns the image to use for the gateway.
143142
func (d *DeploymentSpecGateway) GetImage() string {
144-
return util.TypeOrDefault[string](d.Image)
143+
if d == nil || d.Image == nil {
144+
return ""
145+
}
146+
return *d.Image
145147
}

0 commit comments

Comments
 (0)