diff --git a/manager/config/config_flags.go b/manager/config/config_flags.go index 652af81ed..0e143f881 100755 --- a/manager/config/config_flags.go +++ b/manager/config/config_flags.go @@ -55,6 +55,7 @@ func (cfg Config) GetPFlagSet(prefix string) *pflag.FlagSet { cmdFlags.String(fmt.Sprintf("%v%v", prefix, "pod-template-name"), DefaultConfig.PodTemplateName, "K8s PodTemplate name to use for starting FlytePropeller pods") cmdFlags.String(fmt.Sprintf("%v%v", prefix, "pod-template-namespace"), DefaultConfig.PodTemplateNamespace, "Namespace where the k8s PodTemplate is located") cmdFlags.String(fmt.Sprintf("%v%v", prefix, "scan-interval"), DefaultConfig.ScanInterval.String(), "Frequency to scan FlytePropeller pods and start / restart if necessary") + cmdFlags.String(fmt.Sprintf("%v%v", prefix, "shard.type"), DefaultConfig.ShardConfig.Type.String(), "Shard implementation to use") cmdFlags.Int(fmt.Sprintf("%v%v", prefix, "shard.shard-count"), DefaultConfig.ShardConfig.ShardCount, "The number of shards to manage for a 'hash' shard type") return cmdFlags } diff --git a/manager/config/config_flags_test.go b/manager/config/config_flags_test.go index fcf0118de..887452276 100755 --- a/manager/config/config_flags_test.go +++ b/manager/config/config_flags_test.go @@ -169,6 +169,20 @@ func TestConfig_SetFlags(t *testing.T) { } }) }) + t.Run("Test_shard.type", func(t *testing.T) { + + t.Run("Override", func(t *testing.T) { + testValue := "1" + + cmdFlags.Set("shard.type", testValue) + if vString, err := cmdFlags.GetString("shard.type"); err == nil { + testDecodeJson_Config(t, fmt.Sprintf("%v", vString), &actual.ShardConfig.Type) + + } else { + assert.FailNow(t, err.Error()) + } + }) + }) t.Run("Test_shard.shard-count", func(t *testing.T) { t.Run("Override", func(t *testing.T) {