Skip to content

Commit 184c12e

Browse files
Simon Emmsroboquat
authored andcommitted
[installer]: avoid exposing minio via proxy if using GCP storage
1 parent 1233ac3 commit 184c12e

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

installer/pkg/components/proxy/configmap.go

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,6 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
8282
return nil, err
8383
}
8484

85-
minio, err := renderTemplate(vhostMinioTmpl, commonTpl{
86-
Domain: ctx.Config.Domain,
87-
ReverseProxy: fmt.Sprintf("minio.%s.%s:%d", ctx.Namespace, kubeDomain, minioComponent.ServiceConsolePort),
88-
})
89-
if err != nil {
90-
return nil, err
91-
}
92-
9385
openVSX, err := renderTemplate(vhostOpenVSXTmpl, openVSXTpl{
9486
Domain: ctx.Config.Domain,
9587
RepoURL: fmt.Sprintf("openvsx-proxy.%s.%s:%d", ctx.Namespace, kubeDomain, openvsxproxy.ServicePort),
@@ -117,12 +109,23 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
117109

118110
data := map[string]string{
119111
"vhost.empty": *empty,
120-
"vhost.minio": *minio,
121112
"vhost.open-vsx": *openVSX,
122113
"vhost.payment-endpoint": *paymentEndpoint,
123114
"vhost.kedge": *kedge,
124115
}
125116

117+
if ctx.Config.ObjectStorage.CloudStorage == nil {
118+
// Don't expose Minio if using cloud storage
119+
minio, err := renderTemplate(vhostMinioTmpl, commonTpl{
120+
Domain: ctx.Config.Domain,
121+
ReverseProxy: fmt.Sprintf("minio.%s.%s:%d", ctx.Namespace, kubeDomain, minioComponent.ServiceConsolePort),
122+
})
123+
if err != nil {
124+
return nil, err
125+
}
126+
data["vhost.minio"] = *minio
127+
}
128+
126129
if pointer.BoolDeref(ctx.Config.ContainerRegistry.InCluster, false) {
127130
username := ctx.Values.InternalRegistryUsername
128131
if username == "" {

0 commit comments

Comments
 (0)