1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

OAS-10003 Gateway custom image (#1707)

This commit is contained in:
jwierzbo 2024-08-28 11:26:04 +02:00 committed by GitHub
parent 88c5df2078
commit 8264471502
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 71 additions and 3 deletions

View file

@ -17,6 +17,7 @@
- (Feature) Integration Service Authentication
- (Improvement) Better panic handling
- (Feature) PongV1 Integration Service
- (Feature) Custom Gateway image
## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23)
- (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries

View file

@ -3045,7 +3045,21 @@ Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.
### .spec.gateway.enabled
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L24)</sup>
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L29)</sup>
Enabled setting enables/disables support for gateway in the cluster.
When enabled, the cluster will contain a number of `gateway` servers.
Default Value: `false`
***
### .spec.gateway.image
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.42/pkg/apis/deployment/v1/deployment_spec_gateway.go#L33)</sup>
Image is the image to use for the gateway.
By default, the image is determined by the operator.
***

View file

@ -195,5 +195,4 @@ spec:
WaitForMemberUp: 30m0s
```
[END_INJECT]: # (actionsModYaml)

View file

@ -20,10 +20,20 @@
package v1
import "github.com/arangodb/kube-arangodb/pkg/util"
type DeploymentSpecGateway struct {
// Enabled setting enables/disables support for gateway in the cluster.
// When enabled, the cluster will contain a number of `gateway` servers.
// +doc/default: false
Enabled *bool `json:"enabled,omitempty"`
// Image is the image to use for the gateway.
// By default, the image is determined by the operator.
Image *string `json:"image"`
}
// IsEnabled returns whether the gateway is enabled.
func (d *DeploymentSpecGateway) IsEnabled() bool {
if d == nil || d.Enabled == nil {
return false
@ -32,6 +42,12 @@ func (d *DeploymentSpecGateway) IsEnabled() bool {
return *d.Enabled
}
// Validate the given spec
func (d *DeploymentSpecGateway) Validate() error {
return nil
}
// GetImage returns the image to use for the gateway.
func (d *DeploymentSpecGateway) GetImage() string {
return util.TypeOrDefault[string](d.Image)
}

View file

@ -1179,6 +1179,11 @@ func (in *DeploymentSpecGateway) DeepCopyInto(out *DeploymentSpecGateway) {
*out = new(bool)
**out = **in
}
if in.Image != nil {
in, out := &in.Image, &out.Image
*out = new(string)
**out = **in
}
return
}

View file

@ -20,8 +20,11 @@
package v2alpha1
import "github.com/arangodb/kube-arangodb/pkg/util"
type DeploymentSpecGateway struct {
Enabled *bool `json:"enabled,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Image *string `json:"image"`
}
func (d *DeploymentSpecGateway) IsEnabled() bool {
@ -35,3 +38,7 @@ func (d *DeploymentSpecGateway) IsEnabled() bool {
func (d *DeploymentSpecGateway) Validate() error {
return nil
}
func (d *DeploymentSpecGateway) GetImage() string {
return util.TypeOrDefault[string](d.Image)
}

View file

@ -1179,6 +1179,11 @@ func (in *DeploymentSpecGateway) DeepCopyInto(out *DeploymentSpecGateway) {
*out = new(bool)
**out = **in
}
if in.Image != nil {
in, out := &in.Image, &out.Image
*out = new(string)
**out = **in
}
return
}

View file

@ -6568,7 +6568,15 @@ v1:
description: Gateway defined main Gateway configuration.
properties:
enabled:
description: |-
Enabled setting enables/disables support for gateway in the cluster.
When enabled, the cluster will contain a number of `gateway` servers.
type: boolean
image:
description: |-
Image is the image to use for the gateway.
By default, the image is determined by the operator.
type: string
type: object
gateways:
description: Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`.
@ -22587,7 +22595,15 @@ v1alpha:
description: Gateway defined main Gateway configuration.
properties:
enabled:
description: |-
Enabled setting enables/disables support for gateway in the cluster.
When enabled, the cluster will contain a number of `gateway` servers.
type: boolean
image:
description: |-
Image is the image to use for the gateway.
By default, the image is determined by the operator.
type: string
type: object
gateways:
description: Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`.
@ -38607,6 +38623,8 @@ v2alpha1:
properties:
enabled:
type: boolean
image:
type: string
type: object
gateways:
description: Gateways contain specification for Gateway pods running in deployment mode `Single` or `Cluster`.

View file

@ -390,6 +390,9 @@ func (r *Resources) RenderPodForMember(ctx context.Context, acs sutil.ACS, spec
}
case api.ServerGroupTypeGateway:
imageInfo.Image = r.context.GetOperatorImage()
if spec.Gateway.GetImage() != "" {
imageInfo.Image = spec.Gateway.GetImage()
}
podCreator = &MemberGatewayPod{
podName: podName,