Skip to content

Commit 7bddf2c

Browse files
authored
[Feature] Allow to Override Entrypoint (#658)
1 parent 797418d commit 7bddf2c

File tree

7 files changed

+34
-3
lines changed

7 files changed

+34
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Allow to mount EmptyDir
55
- Allow to specify initContainers in pods
66
- Add serviceAccount, resources and securityContext fields to ID Group
7+
- Allow to override Entrypoint
78
- Add NodeSelector to Deployment Helm Chart
89

910
## [1.1.0](https://github.com/arangodb/kube-arangodb/tree/master) (2020-10-14)

pkg/apis/deployment/v1/server_group_spec.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ type ServerGroupSpec struct {
4848
MaxCount *int `json:"maxCount,omitempty"`
4949
// Args holds additional commandline arguments
5050
Args []string `json:"args,omitempty"`
51+
// Entrypoint overrides container executable
52+
Entrypoint *string `json:"entrypoint,omitempty"`
5153
// StorageClassName specifies the classname for storage of the servers.
5254
StorageClassName *string `json:"storageClassName,omitempty"`
5355
// Resources holds resource requests & limits
@@ -623,3 +625,11 @@ func (s ServerGroupSpec) GetVolumeAllowShrink() bool {
623625

624626
return *s.VolumeAllowShrink
625627
}
628+
629+
func (s *ServerGroupSpec) GetEntrypoint(defaultEntrypoint string) string {
630+
if s == nil || s.Entrypoint == nil {
631+
return defaultEntrypoint
632+
}
633+
634+
return *s.Entrypoint
635+
}

pkg/apis/deployment/v1/server_id_group_spec.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import core "k8s.io/api/core/v1"
2626

2727
// ServerIDGroupSpec contains the specification for Image Discovery image.
2828
type ServerIDGroupSpec struct {
29+
// Entrypoint overrides container executable
30+
Entrypoint *string `json:"entrypoint,omitempty"`
2931
// Tolerations specifies the tolerations added to Pods in this group.
3032
Tolerations []core.Toleration `json:"tolerations,omitempty"`
3133
// NodeSelector speficies a set of selectors for nodes
@@ -72,3 +74,11 @@ func (s *ServerIDGroupSpec) GetResources() core.ResourceRequirements {
7274

7375
return *s.Resources
7476
}
77+
78+
func (s *ServerIDGroupSpec) GetEntrypoint(defaultEntrypoint string) string {
79+
if s == nil || s.Entrypoint == nil {
80+
return defaultEntrypoint
81+
}
82+
83+
return *s.Entrypoint
84+
}

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

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

pkg/deployment/images.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ func (ib *imagesBuilder) fetchArangoDBImageIDAndVersion(ctx context.Context, ima
227227
}
228228

229229
func (a *ArangoDImageUpdateContainer) GetExecutor() string {
230-
return resources.ArangoDExecutor
230+
return a.spec.ID.GetEntrypoint(resources.ArangoDExecutor)
231231
}
232232

233233
func (a *ArangoDImageUpdateContainer) GetProbes() (*core.Probe, *core.Probe, error) {

pkg/deployment/resources/pod_creator_arangod.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func (a *ArangoDContainer) GetPorts() []core.ContainerPort {
9898
}
9999

100100
func (a *ArangoDContainer) GetExecutor() string {
101-
return ArangoDExecutor
101+
return a.groupSpec.GetEntrypoint(ArangoDExecutor)
102102
}
103103

104104
func (a *ArangoDContainer) GetSecurityContext() *core.SecurityContext {

pkg/deployment/resources/pod_creator_sync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (a *ArangoSyncContainer) GetPorts() []core.ContainerPort {
7777
}
7878

7979
func (a *ArangoSyncContainer) GetExecutor() string {
80-
return ArangoSyncExecutor
80+
return a.groupSpec.GetEntrypoint(ArangoSyncExecutor)
8181
}
8282

8383
func (a *ArangoSyncContainer) GetSecurityContext() *core.SecurityContext {

0 commit comments

Comments
 (0)