Skip to content

Commit 5ee5f26

Browse files
authored
[Feature] Add ArangoMember Args (#1857)
1 parent 0bfab74 commit 5ee5f26

30 files changed

+1033
-905
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
44
- (Maintenance) Extend Documentation
55
- (Bugfix) (Platform) Cover NoAuth Case for Identity Service
6+
- (Feature) Add ArangoMember Args
67

78
## [1.2.47](https://github.com/arangodb/kube-arangodb/tree/1.2.47) (2025-03-28)
89
- (Bugfix) Use Profile Annotations

docs/api/ArangoDeployment.V1.md

Lines changed: 294 additions & 294 deletions
Large diffs are not rendered by default.

docs/api/ArangoMember.V1.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2
4040

4141
***
4242

43+
### .spec.overrides.args
44+
45+
Type: `[]string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.47/pkg/apis/deployment/v1/arango_member_spec_overrides.go#L43)</sup>
46+
47+
Args setting specifies additional command-line arguments passed to specific member added at the end.
48+
49+
Default Value: `[]`
50+
51+
***
52+
4353
### .spec.overrides.resources
4454

4555
Type: `core.ResourceRequirements` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.47/pkg/apis/deployment/v1/arango_member_spec_overrides.go#L38)</sup>

pkg/apis/deployment/v1/arango_member_spec_overrides.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2023-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -36,6 +36,11 @@ type ArangoMemberSpecOverrides struct {
3636
// +doc/type: core.ResourceRequirements
3737
// +doc/link: Documentation of core.ResourceRequirements|https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#resourcerequirements-v1-core
3838
Resources core.ResourceRequirements `json:"resources,omitempty"`
39+
40+
// Args setting specifies additional command-line arguments passed to specific member added at the end.
41+
// +doc/type: []string
42+
// +doc/default: []
43+
Args Arguments `json:"args,omitempty"`
3944
}
4045

4146
func (a *ArangoMemberSpecOverrides) HasVolumeClaimTemplate(g *ServerGroupSpec) bool {
@@ -68,6 +73,14 @@ func (a *ArangoMemberSpecOverrides) GetVolumeClaimTemplate(g *ServerGroupSpec) *
6873
return nil
6974
}
7075

76+
func (a *ArangoMemberSpecOverrides) GetArgs() []string {
77+
if a == nil {
78+
return nil
79+
}
80+
81+
return a.Args
82+
}
83+
7184
func (a *ArangoMemberSpecOverrides) GetResources(g *ServerGroupSpec) core.ResourceRequirements {
7285
rl := core.ResourceList{}
7386
rr := core.ResourceList{}

pkg/apis/deployment/v1/arguments.go

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2025 ArangoDB GmbH, Cologne, Germany
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// Copyright holder is ArangoDB GmbH, Cologne, Germany
19+
//
20+
21+
package v1
22+
23+
import (
24+
"strings"
25+
26+
arangodOptions "github.com/arangodb/kube-arangodb/pkg/util/arangod/options"
27+
arangosyncOptions "github.com/arangodb/kube-arangodb/pkg/util/arangosync/options"
28+
"github.com/arangodb/kube-arangodb/pkg/util/errors"
29+
)
30+
31+
type Arguments []string
32+
33+
func (a Arguments) Validate(group ServerGroup) error {
34+
for _, arg := range a {
35+
parts := strings.Split(arg, "=")
36+
optionKey := strings.TrimSpace(parts[0])
37+
switch group.Type() {
38+
case ServerGroupTypeArangoD:
39+
if arangodOptions.IsCriticalOption(optionKey) {
40+
return errors.WithStack(errors.Wrapf(ValidationError, "Critical option '%s' cannot be overriden", optionKey))
41+
}
42+
case ServerGroupTypeArangoSync:
43+
if arangosyncOptions.IsCriticalOption(optionKey) {
44+
return errors.WithStack(errors.Wrapf(ValidationError, "Critical option '%s' cannot be overriden", optionKey))
45+
}
46+
}
47+
}
48+
49+
return nil
50+
}

pkg/apis/deployment/v1/server_group_spec.go

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,13 @@ package v1
2222

2323
import (
2424
"math"
25-
"strings"
2625
"time"
2726

2827
core "k8s.io/api/core/v1"
2928
"k8s.io/apimachinery/pkg/api/resource"
3029

3130
shared "github.com/arangodb/kube-arangodb/pkg/apis/shared"
3231
"github.com/arangodb/kube-arangodb/pkg/util"
33-
arangodOptions "github.com/arangodb/kube-arangodb/pkg/util/arangod/options"
34-
arangosyncOptions "github.com/arangodb/kube-arangodb/pkg/util/arangosync/options"
3532
"github.com/arangodb/kube-arangodb/pkg/util/errors"
3633
kresources "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/resources"
3734
)
@@ -444,19 +441,8 @@ func (s *ServerGroupSpec) Validate(group ServerGroup, used bool, mode Deployment
444441
return errors.WithStack(errors.Wrapf(ValidationError, "Invalid storageClassName: %s", err))
445442
}
446443
}
447-
for _, arg := range s.Args {
448-
parts := strings.Split(arg, "=")
449-
optionKey := strings.TrimSpace(parts[0])
450-
switch group.Type() {
451-
case ServerGroupTypeArangoD:
452-
if arangodOptions.IsCriticalOption(optionKey) {
453-
return errors.WithStack(errors.Wrapf(ValidationError, "Critical option '%s' cannot be overriden", optionKey))
454-
}
455-
case ServerGroupTypeArangoSync:
456-
if arangosyncOptions.IsCriticalOption(optionKey) {
457-
return errors.WithStack(errors.Wrapf(ValidationError, "Critical option '%s' cannot be overriden", optionKey))
458-
}
459-
}
444+
if err := Arguments(s.Args).Validate(group); err != nil {
445+
return err
460446
}
461447

462448
if err := s.validate(); err != nil {

pkg/apis/deployment/v1/zz_generated.deepcopy.go

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/deployment/v2alpha1/arango_member_spec_overrides.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2023-2024 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2023-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -36,6 +36,11 @@ type ArangoMemberSpecOverrides struct {
3636
// +doc/type: core.ResourceRequirements
3737
// +doc/link: Documentation of core.ResourceRequirements|https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#resourcerequirements-v1-core
3838
Resources core.ResourceRequirements `json:"resources,omitempty"`
39+
40+
// Args setting specifies additional command-line arguments passed to specific member added at the end.
41+
// +doc/type: []string
42+
// +doc/default: []
43+
Args Arguments `json:"args,omitempty"`
3944
}
4045

4146
func (a *ArangoMemberSpecOverrides) HasVolumeClaimTemplate(g *ServerGroupSpec) bool {
@@ -68,6 +73,14 @@ func (a *ArangoMemberSpecOverrides) GetVolumeClaimTemplate(g *ServerGroupSpec) *
6873
return nil
6974
}
7075

76+
func (a *ArangoMemberSpecOverrides) GetArgs() []string {
77+
if a == nil {
78+
return nil
79+
}
80+
81+
return a.Args
82+
}
83+
7184
func (a *ArangoMemberSpecOverrides) GetResources(g *ServerGroupSpec) core.ResourceRequirements {
7285
rl := core.ResourceList{}
7386
rr := core.ResourceList{}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2025 ArangoDB GmbH, Cologne, Germany
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// Copyright holder is ArangoDB GmbH, Cologne, Germany
19+
//
20+
21+
package v2alpha1
22+
23+
import (
24+
"strings"
25+
26+
arangodOptions "github.com/arangodb/kube-arangodb/pkg/util/arangod/options"
27+
arangosyncOptions "github.com/arangodb/kube-arangodb/pkg/util/arangosync/options"
28+
"github.com/arangodb/kube-arangodb/pkg/util/errors"
29+
)
30+
31+
type Arguments []string
32+
33+
func (a Arguments) Validate(group ServerGroup) error {
34+
for _, arg := range a {
35+
parts := strings.Split(arg, "=")
36+
optionKey := strings.TrimSpace(parts[0])
37+
switch group.Type() {
38+
case ServerGroupTypeArangoD:
39+
if arangodOptions.IsCriticalOption(optionKey) {
40+
return errors.WithStack(errors.Wrapf(ValidationError, "Critical option '%s' cannot be overriden", optionKey))
41+
}
42+
case ServerGroupTypeArangoSync:
43+
if arangosyncOptions.IsCriticalOption(optionKey) {
44+
return errors.WithStack(errors.Wrapf(ValidationError, "Critical option '%s' cannot be overriden", optionKey))
45+
}
46+
}
47+
}
48+
49+
return nil
50+
}

pkg/apis/deployment/v2alpha1/server_group_spec.go

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,13 @@ package v2alpha1
2222

2323
import (
2424
"math"
25-
"strings"
2625
"time"
2726

2827
core "k8s.io/api/core/v1"
2928
"k8s.io/apimachinery/pkg/api/resource"
3029

3130
shared "github.com/arangodb/kube-arangodb/pkg/apis/shared"
3231
"github.com/arangodb/kube-arangodb/pkg/util"
33-
arangodOptions "github.com/arangodb/kube-arangodb/pkg/util/arangod/options"
34-
arangosyncOptions "github.com/arangodb/kube-arangodb/pkg/util/arangosync/options"
3532
"github.com/arangodb/kube-arangodb/pkg/util/errors"
3633
kresources "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/resources"
3734
)
@@ -444,19 +441,8 @@ func (s *ServerGroupSpec) Validate(group ServerGroup, used bool, mode Deployment
444441
return errors.WithStack(errors.Wrapf(ValidationError, "Invalid storageClassName: %s", err))
445442
}
446443
}
447-
for _, arg := range s.Args {
448-
parts := strings.Split(arg, "=")
449-
optionKey := strings.TrimSpace(parts[0])
450-
switch group.Type() {
451-
case ServerGroupTypeArangoD:
452-
if arangodOptions.IsCriticalOption(optionKey) {
453-
return errors.WithStack(errors.Wrapf(ValidationError, "Critical option '%s' cannot be overriden", optionKey))
454-
}
455-
case ServerGroupTypeArangoSync:
456-
if arangosyncOptions.IsCriticalOption(optionKey) {
457-
return errors.WithStack(errors.Wrapf(ValidationError, "Critical option '%s' cannot be overriden", optionKey))
458-
}
459-
}
444+
if err := Arguments(s.Args).Validate(group); err != nil {
445+
return err
460446
}
461447

462448
if err := s.validate(); err != nil {

pkg/apis/deployment/v2alpha1/zz_generated.deepcopy.go

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/crd/crds/database-member.schema.generated.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ v1:
2121
overrides:
2222
description: Overrides define Member Overrides (Override values from ServerGroup).
2323
properties:
24+
args:
25+
description: Args setting specifies additional command-line arguments passed to specific member added at the end.
26+
items:
27+
type: string
28+
type: array
2429
resources:
2530
description: Resources holds resource requests & limits. Overrides template provided on the group level.
2631
properties:
@@ -3241,6 +3246,11 @@ v2alpha1:
32413246
overrides:
32423247
description: Overrides define Member Overrides (Override values from ServerGroup).
32433248
properties:
3249+
args:
3250+
description: Args setting specifies additional command-line arguments passed to specific member added at the end.
3251+
items:
3252+
type: string
3253+
type: array
32443254
resources:
32453255
description: Resources holds resource requests & limits. Overrides template provided on the group level.
32463256
properties:

0 commit comments

Comments
 (0)