@@ -51,6 +51,21 @@ coder providers create my-provider --hostname=https://provider.example.com --clu
51
51
return err
52
52
}
53
53
54
+ version , err := client .APIVersion (ctx )
55
+ if err != nil {
56
+ return xerrors .Errorf ("get application version: %w" , err )
57
+ }
58
+
59
+ cemanagerURL := client .BaseURL ()
60
+ ingressHost , err := url .Parse (hostname )
61
+ if err != nil {
62
+ return xerrors .Errorf ("parse hostname: %w" , err )
63
+ }
64
+
65
+ if cemanagerURL .Scheme != ingressHost .Scheme {
66
+ return xerrors .Errorf ("Coder access url and hostname must have matching protocols: coder access url: %s, workspace provider hostname: %s" , cemanagerURL .String (), ingressHost .String ())
67
+ }
68
+
54
69
// ExactArgs(1) ensures our name value can't panic on an out of bounds.
55
70
createReq := & coder.CreateWorkspaceProviderReq {
56
71
Name : args [0 ],
@@ -64,15 +79,12 @@ coder providers create my-provider --hostname=https://provider.example.com --clu
64
79
return xerrors .Errorf ("create workspace provider: %w" , err )
65
80
}
66
81
67
- cemanagerURL := client .BaseURL ()
68
- ingressHost , err := url .Parse (hostname )
69
- if err != nil {
70
- return xerrors .Errorf ("parse hostname: %w" , err )
71
- }
72
-
73
- version , err := client .APIVersion (ctx )
74
- if err != nil {
75
- return xerrors .Errorf ("get application version: %w" , err )
82
+ var sslNote string
83
+ if ingressHost .Scheme == "https" {
84
+ sslNote = `
85
+ NOTE: Since the hostname provided is using https you must ensure the deployment
86
+ has a valid SSL certificate. See https://coder.com/docs/guides/ssl-certificates
87
+ for more information.`
76
88
}
77
89
78
90
clog .LogSuccess (fmt .Sprintf (`
@@ -93,9 +105,11 @@ helm upgrade coder-workspace-provider coder/workspace-provider \
93
105
--install \
94
106
--force \
95
107
--set envproxy.token=` + wp .EnvproxyToken + ` \
108
+ --set envproxy.accessURL=` + ingressHost .String ()+ ` \
96
109
--set ingress.host=` + ingressHost .Hostname ()+ ` \
97
110
--set envproxy.clusterAddress=` + clusterAddress + ` \
98
111
--set cemanager.accessURL=` + cemanagerURL .String ()+ `
112
+ ` + sslNote + `
99
113
100
114
WARNING: The 'envproxy.token' is a secret value that authenticates the workspace provider,
101
115
make sure not to share this token or make it public.
0 commit comments