11//
22// DISCLAIMER
33//
4- // Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
4+ // Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany
55//
66// Licensed under the Apache License, Version 2.0 (the "License");
77// you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import (
2424 "github.com/arangodb/go-driver"
2525
2626 api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
27+ "github.com/arangodb/kube-arangodb/pkg/version"
2728)
2829
2930const (
@@ -38,6 +39,7 @@ type Feature interface {
3839 Description () string
3940 Version () driver.Version
4041 EnterpriseRequired () bool
42+ OperatorEnterpriseRequired () bool
4143 EnabledByDefault () bool
4244 Enabled () bool
4345 EnabledPointer () * bool
@@ -48,12 +50,12 @@ type Feature interface {
4850}
4951
5052type feature struct {
51- name , description string
52- version driver.Version
53- enterpriseRequired , enabledByDefault , enabled bool
54- deprecated string
55- constValue * bool
56- hidden bool
53+ name , description string
54+ version driver.Version
55+ enterpriseRequired , operatorEnterpriseRequired , enabledByDefault , enabled bool
56+ deprecated string
57+ constValue * bool
58+ hidden bool
5759}
5860
5961func (f feature ) ImageSupported (i * api.ImageInfo ) bool {
@@ -73,6 +75,13 @@ func (f feature) Supported(v driver.Version, enterprise bool) bool {
7375}
7476
7577func (f feature ) Enabled () bool {
78+ if f .operatorEnterpriseRequired {
79+ // Operator Enterprise is required for this feature
80+ if ! version .GetVersionV1 ().IsEnterprise () {
81+ return false
82+ }
83+ }
84+
7685 if f .constValue != nil {
7786 return * f .constValue
7887 }
@@ -96,6 +105,10 @@ func (f feature) EnterpriseRequired() bool {
96105 return f .enterpriseRequired
97106}
98107
108+ func (f feature ) OperatorEnterpriseRequired () bool {
109+ return f .operatorEnterpriseRequired
110+ }
111+
99112func (f feature ) EnabledByDefault () bool {
100113 return f .enabledByDefault
101114}
0 commit comments