Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- (Feature) Add action progress
- (Feature) Ensure consistency during replication cancellation
- (Feature) Add annotation to change architecture of a member
- (Bugfix) Prevent Member Maintenance Error log

## [1.2.18](https://github.com/arangodb/kube-arangodb/tree/1.2.18) (2022-09-28)
- (Feature) Define Actions PlaceHolder
Expand Down
15 changes: 14 additions & 1 deletion pkg/deployment/features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@

package features

import "github.com/arangodb/go-driver"
import (
"github.com/arangodb/go-driver"

api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
)

const (
Enabled = "true"
Expand All @@ -40,6 +44,7 @@ type Feature interface {
Deprecated() (bool, string)
Hidden() bool
Supported(v driver.Version, enterprise bool) bool
ImageSupported(i *api.ImageInfo) bool
}

type feature struct {
Expand All @@ -51,6 +56,14 @@ type feature struct {
hidden bool
}

func (f feature) ImageSupported(i *api.ImageInfo) bool {
if i == nil {
return false
}

return f.Supported(i.ArangoDBVersion, i.Enterprise)
}

func (f feature) Hidden() bool {
return f.hidden
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/reconcile/helper_wrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func withMemberMaintenance(group api.ServerGroup, member api.MemberStatus, reaso
return plan
}

if !features.Version310().Enabled() {
if !features.Version310().ImageSupported(member.Image) {
return plan
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/resources/pod_creator_probes.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,5 +513,5 @@ func getProbeRetries(group api.ServerGroup) (int32, int32) {
// IsServerProgressAvailable returns true if server progress is available.
func IsServerProgressAvailable(group api.ServerGroup, imageInfo api.ImageInfo) bool {
return group == api.ServerGroupDBServers &&
features.Version310().Supported(imageInfo.ArangoDBVersion, imageInfo.Enterprise)
features.Version310().ImageSupported(&imageInfo)
}