8000 OAS-10003 Gateway custom image (#1707) · arangodb/kube-arangodb@8264471 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8264471

Browse files
authored
OAS-10003 Gateway custom image (#1707)
1 parent 88c5df2 commit 8264471

9 files changed

+71
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- (Feature) Integration Service Authentication
1818
- (Improvement) Better panic handling
1919
- (Feature) PongV1 Integration Service
20+
- (Feature) Custom Gateway image
2021

2122
## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23)
2223
- (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries

docs/api/ArangoDeployment.V1.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3045,7 +3045,21 @@ Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.
30453045

30463046
### .spec.gateway.enabled
30473047

3048-
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L24)</sup>
3048+
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L29)</sup>
3049+
3050+
Enabled setting enables/disables support for gateway in the cluster.
3051+
When enabled, the cluster will contain a number of `gateway` servers.
3052+
3053+
Default Value: `false`
3054+
3055+
***
3056+
3057+
### .spec.gateway.image
3058+
3059+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L33)</sup>
3060+
3061+
Image is the image to use for the gateway.
3062+
By default, the image is determined by the operator.
30493063

30503064
***
30513065

docs/generated/actions.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,5 +195,4 @@ spec:
195195
WaitForMemberUp: 30m0s
196196

197197
```
198-
199198
[END_INJECT]: # (actionsModYaml)

pkg/apis/deployment/v1/deployment_spec_gateway.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,20 @@
2020

2121
package v1
2222

23+
import "github.com/arangodb/kube-arangodb/pkg/util"
24+
2325
type DeploymentSpecGateway struct {
26+
// Enabled setting enables/disables support for gateway in the cluster.
27+
// When enabled, the cluster will contain a number of `gateway` servers.
28+
// +doc/default: false
2429
Enabled *bool `json:"enabled,omitempty"`
30+
31+
// Image is the image to use for the gateway.
32+
// By default, the image is determined by the operator.
33+
Image *string `json:"image"`
2534
}
2635

36+
// IsEnabled returns whether the gateway is enabled.
2737
func (d *DeploymentSpecGateway) IsEnabled() bool {
2838
if d == nil || d.Enabled == nil {
2939
return false
@@ -32,6 +42,12 @@ func (d *DeploymentSpecGateway) IsEnabled() bool {
3242
return *d.Enabled
3343
}
3444

45+
// Validate the given spec
3546
func (d *DeploymentSpecGateway) Validate() error {
3647
return nil
3748
}
49+
50+
// GetImage returns the image to use for the gateway.
51+
func (d *DeploymentSpecGateway) GetImage() string {
52+
return util.TypeOrDefault[string](d.Image)
53+
}

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

Lines changed: 5 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/deployment_spec_gateway.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@
2020

2121
package v2alpha1
2222

23+
import "github.com/arangodb/kube-arangodb/pkg/util"
24+
2325
type DeploymentSpecGateway struct {
24-
Enabled *bool `json:"enabled,omitempty"`
26+
Enabled *bool `json:"enabled,omitempty"`
27+
Image *string `json:"image"`
2528
}
2629

2730
func (d *DeploymentSpecGateway) IsEnabled() bool {
@@ -35,3 +38,7 @@ func (d *DeploymentSpecGateway) IsEnabled() bool {
3538
func (d *DeploymentSpecGateway) Validate() error {
3639
return nil
3740
}
41+
42+
func (d *DeploymentSpecGateway) GetImage() string {
43+
return util.TypeOrDefault[string](d.Image)
44+
}

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

Lines changed: 5 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-deployment.schema.generated.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6568,7 +6568,15 @@ v1:
65686568
description: Gateway defined main Gateway configuration.
65696569
properties:
65706570
enabled:
6571+
description: |-
6572+
Enabled setting enables/disables support for gateway in the cluster.
6573+
When enabled, the cluster will contain a number of `gateway` servers.
65716574
type: boolean
6575+
image:
6576+
description: |-
6577+
Image is the image to use for the gateway.
6578+
By default, the image is determined by the operator.
6579+
type: string
65726580
type: object
65736581
gateways:
65746582
description: Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`.
@@ -22587,7 +22595,15 @@ v1alpha:
2258722595
description: Gateway defined main Gateway configuration.
2258822596
properties:
2258922597
enabled:
22598+
description: |-
22599+
Enabled setting enables/disables support for gateway in the cluster.
22600+
When enabled, the cluster will contain a number of `gateway` servers.
2259022601
type: boolean
22602+
image:
22603+
description: |-
22604+
Image is the image to use for the gateway.
22605+
By default, the image is determined by the operator.
22606+
type: string
2259122607
type: object
2259222608
gateways:
2259322609
description: Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`.
@@ -38607,6 +38623,8 @@ v2alpha1:
3860738623
properties:
3860838624
enabled:
3860938625
type: boolean
38626+
image:
38627+
type: string
3861038628
type: object
3861138629
gateways:
3861238630
description: Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`.

pkg/deployment/resources/pod_creator.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,9 @@ func (r *Resources) RenderPodForMember(ctx context.Context, acs sutil.ACS, spec
390390
}
391391
case api.ServerGroupTypeGateway:
392392
imageInfo.Image = r.context.GetOperatorImage()
393+
if spec.Gateway.GetImage() != "" {
394+
imageInfo.Image = spec.Gateway.GetImage()
395+
}
393396

394397
podCreator = &MemberGatewayPod{
395398
podName: podName,

0 commit comments

Comments
 (0)
0