Skip to content

Commit 3eaea28

Browse files
authored
fix: using https in the url in the status (#1104)
1 parent 68bd182 commit 3eaea28

4 files changed

Lines changed: 36 additions & 1 deletion

File tree

api/v1alpha1/amaltheasession_types.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,19 @@ type Ingress struct {
219219
// account if `TLSSecret` above is left unset, if the `TLSSecret` field is set
220220
// then that value will take precedence and this boolean flag will be ignored.
221221
UseDefaultClusterTLSCert bool `json:"useDefaultClusterTLSCert,omitempty"`
222+
// +optional
223+
// +kubebuilder:default:=false
224+
// If set to true Amalthea will template HTTPS for the URL to access the session
225+
// that is reported in the status. Without trying to guess whether to use HTTP or HTTPS
226+
// based on the TLS secret or other configurations provided. The reason for this flag
227+
// is that sometimes TLS secret can be provisioned simply by adding ingress annotations.
228+
// And in this case we cannot determine the right scheme reliably from the session spec.
229+
AssumeHttps bool `json:"assumeHttps,omitempty"`
222230
}
223231

224232
func (ingress *Ingress) UrlScheme() string {
225233
urlScheme := "http"
226-
if (ingress.TLSSecret != nil && ingress.TLSSecret.Name != "") || ingress.UseDefaultClusterTLSCert {
234+
if (ingress.TLSSecret != nil && ingress.TLSSecret.Name != "") || ingress.UseDefaultClusterTLSCert || ingress.AssumeHttps {
227235
urlScheme = "https"
228236
}
229237
return urlScheme

bundle/manifests/amalthea.dev_amaltheasessions.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4534,6 +4534,15 @@ spec:
45344534
additionalProperties:
45354535
type: string
45364536
type: object
4537+
assumeHttps:
4538+
default: false
4539+
description: |-
4540+
If set to true Amalthea will template HTTPS for the URL to access the session
4541+
that is reported in the status. Without trying to guess whether to use HTTP or HTTPS
4542+
based on the TLS secret or other configurations provided. The reason for this flag
4543+
is that sometimes TLS secret can be provisioned simply by adding ingress annotations.
4544+
And in this case we cannot determine the right scheme reliably from the session spec.
4545+
type: boolean
45374546
host:
45384547
type: string
45394548
x-kubernetes-validations:

config/crd/bases/amalthea.dev_amaltheasessions.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4534,6 +4534,15 @@ spec:
45344534
additionalProperties:
45354535
type: string
45364536
type: object
4537+
assumeHttps:
4538+
default: false
4539+
description: |-
4540+
If set to true Amalthea will template HTTPS for the URL to access the session
4541+
that is reported in the status. Without trying to guess whether to use HTTP or HTTPS
4542+
based on the TLS secret or other configurations provided. The reason for this flag
4543+
is that sometimes TLS secret can be provisioned simply by adding ingress annotations.
4544+
And in this case we cannot determine the right scheme reliably from the session spec.
4545+
type: boolean
45374546
host:
45384547
type: string
45394548
x-kubernetes-validations:

helm-chart/amalthea-sessions/templates/amaltheasession-crd.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4536,6 +4536,15 @@ spec:
45364536
additionalProperties:
45374537
type: string
45384538
type: object
4539+
assumeHttps:
4540+
default: false
4541+
description: |-
4542+
If set to true Amalthea will template HTTPS for the URL to access the session
4543+
that is reported in the status. Without trying to guess whether to use HTTP or HTTPS
4544+
based on the TLS secret or other configurations provided. The reason for this flag
4545+
is that sometimes TLS secret can be provisioned simply by adding ingress annotations.
4546+
And in this case we cannot determine the right scheme reliably from the session spec.
4547+
type: boolean
45394548
host:
45404549
type: string
45414550
x-kubernetes-validations:

0 commit comments

Comments
 (0)