Skip to content

Commit 4915d57

Browse files
dklibanopenshift-merge-robot
authored andcommitted
Fixes bug related to CONTENT_ORIGIN scheme always being https
fixes: #1048
1 parent 71cde22 commit 4915d57

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGES/1048.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed a bug that caused the CONTENT_ORIGIN scheme to always be https.

controllers/repo_manager/utils.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,12 +446,16 @@ func (r *RepoManagerReconciler) isNginxIngress(pulp *repomanagerpulpprojectorgv1
446446

447447
// getRootURL handles user facing URLs
448448
func getRootURL(resource controllers.FunctionResources) string {
449+
scheme := "https"
449450
if isIngress(resource.Pulp) {
451+
if resource.Pulp.Spec.IngressTLSSecret == "" {
452+
scheme = "http"
453+
}
450454
hostname := resource.Pulp.Spec.IngressHost
451455
if len(resource.Pulp.Spec.Hostname) > 0 { // [DEPRECATED] Temporarily adding to keep compatibility with ansible version.
452456
hostname = resource.Pulp.Spec.Hostname
453457
}
454-
return "https://" + hostname
458+
return scheme + "://" + hostname
455459
}
456460
if isRoute(resource.Pulp) {
457461
return "https://" + pulp_ocp.GetRouteHost(resource.Pulp)

0 commit comments

Comments
 (0)