Skip to content

Commit

Permalink
fix: use 'dns:///' instead of 'dns://' (flyteorg#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigobaron authored Feb 6, 2022
1 parent 9e1971a commit c726223
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/configuration/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit c726223

Please sign in to comment.