diff --git a/cmd/configuration/configuration.go b/cmd/configuration/configuration.go index 680b6c8896..be8421a640 100644 --- a/cmd/configuration/configuration.go +++ b/cmd/configuration/configuration.go @@ -58,7 +58,7 @@ var prompt = promptui.Select{ Items: []string{"S3", "GCS"}, } -var endpointPrefix = [3]string{"dns://", "http://", "https://"} +var endpointPrefix = [3]string{"dns:///", "http://", "https://"} // CreateConfigCommand will return configuration command func CreateConfigCommand() *cobra.Command { @@ -95,7 +95,7 @@ func initFlytectlConfig(ctx context.Context, reader io.Reader) error { if !validateEndpointName(trimHost) { return errors.New("Please use a valid endpoint") } - templateValues.Host = fmt.Sprintf("dns://%s", trimHost) + templateValues.Host = fmt.Sprintf("dns:///%s", trimHost) templateValues.Insecure = initConfig.DefaultConfig.Insecure templateStr = configutil.AdminConfigTemplate if initConfig.DefaultConfig.Storage { diff --git a/cmd/configuration/configuration_test.go b/cmd/configuration/configuration_test.go index 00fbfc29b6..4f6e6a6186 100644 --- a/cmd/configuration/configuration_test.go +++ b/cmd/configuration/configuration_test.go @@ -65,7 +65,7 @@ func TestSetupConfigFunc(t *testing.T) { } func TestTrimFunc(t *testing.T) { - assert.Equal(t, trimEndpoint("dns://localhost"), "localhost") + assert.Equal(t, trimEndpoint("dns:///localhost"), "localhost") assert.Equal(t, trimEndpoint("http://localhost"), "localhost") assert.Equal(t, trimEndpoint("https://localhost"), "localhost") }