Skip to content

Commit c4ea20d

Browse files
committed
Add gitpodHost
1 parent 7c72f7e commit c4ea20d

File tree

6 files changed

+16
-4
lines changed

6 files changed

+16
-4
lines changed

components/service-waiter/cmd/component.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ var componentCmdOpt struct {
2929
component string
3030
labels string
3131
ideMetricsHost string
32+
gitpodHost string
3233

3334
featureFlagTimeout time.Duration
3435
}
@@ -143,6 +144,7 @@ func init() {
143144
componentCmd.Flags().StringVar(&componentCmdOpt.labels, "labels", "", "Labels of deployment")
144145
componentCmd.Flags().StringVar(&componentCmdOpt.ideMetricsHost, "ide-metrics-host", "", "Host of ide metrics")
145146
componentCmd.Flags().DurationVar(&componentCmdOpt.featureFlagTimeout, "feature-flag-timeout", 3*time.Minute, "The maximum time to wait for feature flag")
147+
componentCmd.Flags().StringVar(&componentCmdOpt.gitpodHost, "gitpod-host", "", "Domain of Gitpod installation")
146148

147149
_ = componentCmd.MarkFlagRequired("namespace")
148150
_ = componentCmd.MarkFlagRequired("component")
@@ -181,7 +183,8 @@ func ActualWaitFeatureFlag(ctx context.Context, client experiments.Client, defau
181183
return defaultValue, false, fetchTimes
182184
default:
183185
stringValue := client.GetStringValue(ctx, experiments.ServiceWaiterSkipComponentsFlag, "NONE", experiments.Attributes{
184-
Component: componentCmdOpt.component,
186+
GitpodHost: componentCmdOpt.gitpodHost,
187+
Component: componentCmdOpt.component,
185188
})
186189
fetchTimes++
187190
if stringValue == "true" {

install/installer/pkg/common/common.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,8 @@ func componentWaiterContainer(ctx *RenderContext, component, labels, image strin
532532
Args: []string{
533533
"-v",
534534
"component",
535+
"--gitpod-host",
536+
ctx.Config.Domain,
535537
"--ide-metrics-host",
536538
"http://" + IDEMetricsComponent + ":" + strconv.Itoa(IDEMetricsPort),
537539
"--namespace",

install/installer/pkg/common/common_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func TestPublicApiServerComponentWaiterContainer(t *testing.T) {
6060
labels := common.DefaultLabelSelector(common.PublicApiComponent)
6161
require.Equal(t, labels, "app=gitpod,component=public-api-server")
6262
ideMetricsHost := "http://" + common.IDEMetricsComponent + ":" + strconv.Itoa(common.IDEMetricsPort)
63-
require.Equal(t, []string{"-v", "component", "--ide-metrics-host", ideMetricsHost, "--namespace", "test_namespace", "--component", common.PublicApiComponent, "--labels", labels, "--image", ctx.Config.Repository + "/public-api-server:" + "happy_path_papi_image"}, container.Args)
63+
require.Equal(t, []string{"-v", "component", "--gitpod-host", ctx.Config.Domain, "--ide-metrics-host", ideMetricsHost, "--namespace", "test_namespace", "--component", common.PublicApiComponent, "--labels", labels, "--image", ctx.Config.Repository + "/public-api-server:" + "happy_path_papi_image"}, container.Args)
6464
}
6565

6666
func TestServerComponentWaiterContainer(t *testing.T) {
@@ -74,5 +74,5 @@ func TestServerComponentWaiterContainer(t *testing.T) {
7474
labels := common.DefaultLabelSelector(common.ServerComponent)
7575
require.Equal(t, labels, "app=gitpod,component=server")
7676
ideMetricsHost := "http://" + common.IDEMetricsComponent + ":" + strconv.Itoa(common.IDEMetricsPort)
77-
require.Equal(t, []string{"-v", "component", "--ide-metrics-host", ideMetricsHost, "--namespace", "test_namespace", "--component", common.ServerComponent, "--labels", labels, "--image", ctx.Config.Repository + "/server:" + "happy_path_server_image"}, container.Args)
77+
require.Equal(t, []string{"-v", "component", "--gitpod-host", ctx.Config.Domain, "--ide-metrics-host", ideMetricsHost, "--namespace", "test_namespace", "--component", common.ServerComponent, "--labels", labels, "--image", ctx.Config.Repository + "/server:" + "happy_path_server_image"}, container.Args)
7878
}

install/installer/pkg/common/constants.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const (
6262
AuthPKISecretName = "auth-pki"
6363
IDEServiceComponent = "ide-service"
6464
OpenVSXProxyComponent = "openvsx-proxy"
65+
DashboardComponent = "dashboard"
6566
IDEMetricsComponent = "ide-metrics"
6667
IDEMetricsPort = 3000
6768
)

install/installer/pkg/components/dashboard/constants.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44

55
package dashboard
66

7+
import "github.com/gitpod-io/gitpod/installer/pkg/common"
8+
79
const (
8-
Component = "dashboard"
10+
Component = common.DashboardComponent
911
ContainerPort = 80
1012
PortName = "http"
1113
ServicePort = 3001

install/installer/pkg/components/proxy/networkpolicy.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ func networkpolicy(ctx *common.RenderContext) ([]runtime.Object, error) {
100100
PodSelector: &metav1.LabelSelector{MatchLabels: map[string]string{
101101
"component": common.OpenVSXProxyComponent,
102102
}},
103+
}, {
104+
PodSelector: &metav1.LabelSelector{MatchLabels: map[string]string{
105+
"component": common.DashboardComponent,
106+
}},
103107
}},
104108
}},
105109
},

0 commit comments

Comments
 (0)