diff --git a/README.md b/README.md index 0ab694e..67cd2df 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,9 @@ The encapi base URL comes from the first of: 5. the compiled-in default `http://encapi.encapi.svc.cluster.local`. Conf files are shell-sourceable `KEY=VALUE` (`ENCAPI_URL=https://...`). -`encapic init` prompts for the URL, writes the user conf and offers to install -shell completion. With no config found, an interactive run prints a hint to +`encapic init` prompts for the URL (default +`https://encapi.k8s.syd1.au.unkin.net`), writes the user conf and offers to +install shell completion. With no config found, an interactive run prints a hint to stderr; non-TTY runs (the puppet exec ENC) stay silent. ### Shell completion diff --git a/config.go b/config.go index 8204330..5b6d37c 100644 --- a/config.go +++ b/config.go @@ -11,7 +11,7 @@ import ( "strings" ) -const initDefaultURL = "https://encapi" +const initDefaultURL = "https://encapi.k8s.syd1.au.unkin.net" // systemConfPaths follow the user conf in precedence; the legacy path is a // read-only fallback for hosts whose puppet still manages it. diff --git a/config_test.go b/config_test.go index 0e61a57..b943f7c 100644 --- a/config_test.go +++ b/config_test.go @@ -71,7 +71,7 @@ func TestInitConfig(t *testing.T) { name, input, want string wantErr bool }{ - {"default", "\nn\n", "ENCAPI_URL=https://encapi\n", false}, + {"default", "\nn\n", "ENCAPI_URL=https://encapi.k8s.syd1.au.unkin.net\n", false}, {"custom", "http://encapi.example:8080\nn\n", "ENCAPI_URL=http://encapi.example:8080\n", false}, {"invalid", "ftp://nope\n", "", true}, {"no host", "encapi.example\n", "", true}, @@ -94,7 +94,7 @@ func TestInitConfig(t *testing.T) { if string(b) != tc.want { t.Errorf("conf = %q, want %q", b, tc.want) } - if !strings.Contains(out.String(), "encapi URL [https://encapi]: ") { + if !strings.Contains(out.String(), "encapi URL [https://encapi.k8s.syd1.au.unkin.net]: ") { t.Errorf("missing URL prompt in %q", out.String()) } fi, err := os.Stat(filepath.Dir(userConfPath()))