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

[Feature] Allow to Override Entrypoint (#658)

This commit is contained in:
Adam Janikowski 2020-11-04 10:00:44 +01:00 committed by GitHub
parent 797418d6e6
commit 7bddf2c82b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 34 additions and 3 deletions

View file

@ -4,6 +4,7 @@
- Allow to mount EmptyDir
- Allow to specify initContainers in pods
- Add serviceAccount, resources and securityContext fields to ID Group
- Allow to override Entrypoint
- Add NodeSelector to Deployment Helm Chart
## [1.1.0](https://github.com/arangodb/kube-arangodb/tree/master) (2020-10-14)

View file

@ -48,6 +48,8 @@ type ServerGroupSpec struct {
MaxCount *int `json:"maxCount,omitempty"`
// Args holds additional commandline arguments
Args []string `json:"args,omitempty"`
// Entrypoint overrides container executable
Entrypoint *string `json:"entrypoint,omitempty"`
// StorageClassName specifies the classname for storage of the servers.
StorageClassName *string `json:"storageClassName,omitempty"`
// Resources holds resource requests & limits
@ -623,3 +625,11 @@ func (s ServerGroupSpec) GetVolumeAllowShrink() bool {
return *s.VolumeAllowShrink
}
func (s *ServerGroupSpec) GetEntrypoint(defaultEntrypoint string) string {
if s == nil || s.Entrypoint == nil {
return defaultEntrypoint
}
return *s.Entrypoint
}

View file

@ -26,6 +26,8 @@ import core "k8s.io/api/core/v1"
// ServerIDGroupSpec contains the specification for Image Discovery image.
type ServerIDGroupSpec struct {
// Entrypoint overrides container executable
Entrypoint *string `json:"entrypoint,omitempty"`
// Tolerations specifies the tolerations added to Pods in this group.
Tolerations []core.Toleration `json:"tolerations,omitempty"`
// NodeSelector speficies a set of selectors for nodes
@ -72,3 +74,11 @@ func (s *ServerIDGroupSpec) GetResources() core.ResourceRequirements {
return *s.Resources
}
func (s *ServerIDGroupSpec) GetEntrypoint(defaultEntrypoint string) string {
if s == nil || s.Entrypoint == nil {
return defaultEntrypoint
}
return *s.Entrypoint
}

View file

@ -1213,6 +1213,11 @@ func (in *ServerGroupSpec) DeepCopyInto(out *ServerGroupSpec) {
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Entrypoint != nil {
in, out := &in.Entrypoint, &out.Entrypoint
*out = new(string)
**out = **in
}
if in.StorageClassName != nil {
in, out := &in.StorageClassName, &out.StorageClassName
*out = new(string)
@ -1624,6 +1629,11 @@ func (in ServerGroupSpecVolumes) DeepCopy() ServerGroupSpecVolumes {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ServerIDGroupSpec) DeepCopyInto(out *ServerIDGroupSpec) {
*out = *in
if in.Entrypoint != nil {
in, out := &in.Entrypoint, &out.Entrypoint
*out = new(string)
**out = **in
}
if in.Tolerations != nil {
in, out := &in.Tolerations, &out.Tolerations
*out = make([]corev1.Toleration, len(*in))

View file

@ -227,7 +227,7 @@ func (ib *imagesBuilder) fetchArangoDBImageIDAndVersion(ctx context.Context, ima
}
func (a *ArangoDImageUpdateContainer) GetExecutor() string {
return resources.ArangoDExecutor
return a.spec.ID.GetEntrypoint(resources.ArangoDExecutor)
}
func (a *ArangoDImageUpdateContainer) GetProbes() (*core.Probe, *core.Probe, error) {

View file

@ -98,7 +98,7 @@ func (a *ArangoDContainer) GetPorts() []core.ContainerPort {
}
func (a *ArangoDContainer) GetExecutor() string {
return ArangoDExecutor
return a.groupSpec.GetEntrypoint(ArangoDExecutor)
}
func (a *ArangoDContainer) GetSecurityContext() *core.SecurityContext {

View file

@ -77,7 +77,7 @@ func (a *ArangoSyncContainer) GetPorts() []core.ContainerPort {
}
func (a *ArangoSyncContainer) GetExecutor() string {
return ArangoSyncExecutor
return a.groupSpec.GetEntrypoint(ArangoSyncExecutor)
}
func (a *ArangoSyncContainer) GetSecurityContext() *core.SecurityContext {