mirror of
https://github.com/arangodb/kube-arangodb.git
synced 2024-12-14 11:57:37 +00:00
[CLI] Hidden arguments (#1082)
This commit is contained in:
parent
616b96a792
commit
b153b7183a
10 changed files with 28 additions and 5 deletions
|
@ -186,7 +186,9 @@ func init() {
|
|||
f.IntVar(&operatorKubernetesOptions.burst, "kubernetes.burst", kclient.DefaultBurst, "Burst for the k8s API")
|
||||
f.BoolVar(&crdOptions.install, "crd.install", true, "Install missing CRD if access is possible")
|
||||
f.IntVar(&operatorBackup.concurrentUploads, "backup-concurrent-uploads", globals.DefaultBackupConcurrentUploads, "Number of concurrent uploads per deployment")
|
||||
features.Init(&cmdMain)
|
||||
if err := features.Init(&cmdMain); err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func Execute() int {
|
||||
|
|
|
@ -30,6 +30,7 @@ var encryptionRotation = &feature{
|
|||
version: "3.7.0",
|
||||
enterpriseRequired: true,
|
||||
enabledByDefault: false,
|
||||
hidden: true,
|
||||
}
|
||||
|
||||
func EncryptionRotation() Feature {
|
||||
|
|
|
@ -33,6 +33,7 @@ type Feature interface {
|
|||
Enabled() bool
|
||||
EnabledPointer() *bool
|
||||
Deprecated() (bool, string)
|
||||
Hidden() bool
|
||||
Supported(v driver.Version, enterprise bool) bool
|
||||
}
|
||||
|
||||
|
@ -42,6 +43,11 @@ type feature struct {
|
|||
enterpriseRequired, enabledByDefault, enabled bool
|
||||
deprecated string
|
||||
constValue *bool
|
||||
hidden bool
|
||||
}
|
||||
|
||||
func (f feature) Hidden() bool {
|
||||
return f.hidden
|
||||
}
|
||||
|
||||
func (f feature) Supported(v driver.Version, enterprise bool) bool {
|
||||
|
|
|
@ -30,6 +30,7 @@ var gracefulShutdown = &feature{
|
|||
version: "3.6.0",
|
||||
enterpriseRequired: false,
|
||||
enabledByDefault: true,
|
||||
hidden: true,
|
||||
}
|
||||
|
||||
func GracefulShutdown() Feature {
|
||||
|
|
|
@ -30,6 +30,7 @@ var jwtRotation = &feature{
|
|||
version: "3.7.0",
|
||||
enterpriseRequired: true,
|
||||
enabledByDefault: true,
|
||||
hidden: true,
|
||||
}
|
||||
|
||||
func JWTRotation() Feature {
|
||||
|
|
|
@ -54,7 +54,7 @@ var internalCMD = &cobra.Command{
|
|||
Run: cmdRun,
|
||||
}
|
||||
|
||||
func Init(cmd *cobra.Command) {
|
||||
func Init(cmd *cobra.Command) error {
|
||||
featuresLock.Lock()
|
||||
defer featuresLock.Unlock()
|
||||
|
||||
|
@ -80,12 +80,21 @@ func Init(cmd *cobra.Command) {
|
|||
}
|
||||
|
||||
featureName := fmt.Sprintf("deployment.feature.%s", feature.Name())
|
||||
f.BoolVar(feature.EnabledPointer(), featureName, feature.EnabledByDefault(), z)
|
||||
if ok, reason := feature.Deprecated(); ok {
|
||||
f.MarkDeprecated(featureName, reason)
|
||||
if err := f.MarkDeprecated(featureName, reason); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
f.BoolVar(feature.EnabledPointer(), featureName, feature.EnabledByDefault(), z)
|
||||
if feature.Hidden() {
|
||||
if err := f.MarkHidden(featureName); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func cmdRun(_ *cobra.Command, _ []string) {
|
||||
|
|
|
@ -30,6 +30,7 @@ var maintenance = &feature{
|
|||
version: "3.6.0",
|
||||
enterpriseRequired: false,
|
||||
enabledByDefault: true,
|
||||
hidden: true,
|
||||
}
|
||||
|
||||
func Maintenance() Feature {
|
||||
|
|
|
@ -36,6 +36,7 @@ var metricsExporter = &feature{
|
|||
enabledByDefault: true,
|
||||
deprecated: "It is always set to True",
|
||||
constValue: util.NewBool(true),
|
||||
hidden: true,
|
||||
}
|
||||
|
||||
// deprecated
|
||||
|
|
|
@ -31,6 +31,7 @@ var tlsRotation Feature = &feature{
|
|||
version: "3.7.0",
|
||||
enterpriseRequired: true,
|
||||
enabledByDefault: true,
|
||||
hidden: true,
|
||||
}
|
||||
|
||||
func TLSRotation() Feature {
|
||||
|
|
2
pkg/generated/timezones/timezones.go
generated
2
pkg/generated/timezones/timezones.go
generated
|
@ -34,7 +34,7 @@ type Timezone struct {
|
|||
}
|
||||
|
||||
func (t Timezone) GetData() ([]byte, bool) {
|
||||
if d, ok := timezonesData[t.Name]; ok {
|
||||
if d, ok := timezonesData[t.Parent]; ok {
|
||||
if d, err := base64.StdEncoding.DecodeString(d); err == nil {
|
||||
return d, true
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue