Skip to content

Commit e01ecd2

Browse files
authored
Merge pull request #89 from ygelfand/add-path-to-service
Add path to service
2 parents 3b8045c + 55f3b66 commit e01ecd2

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

api/v1alpha1/tunnelbinding_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ type TunnelBindingSubjectSpec struct {
4646
//+kubebuilder:validation:Optional
4747
Protocol string `json:"protocol,omitempty"`
4848

49+
// Path specifies a regular expression for to match on the request for http/https services
50+
// If a rule does not specify a path, all paths will be matched.
51+
//+kubebuilder:validation:Optional
52+
Path string `json:"path,omitempty"`
53+
4954
// Target specified where the tunnel should proxy to.
5055
// Defaults to the form of <protocol>://<service.metadata.name>.<service.metadata.namespace>.svc:<port>
5156
//+kubebuilder:validation:Optional

config/crd/bases/networking.cfargotunnel.com_tunnelbindings.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ spec:
9393
description: NoTlsVerify disables TLS verification for this
9494
service. Only useful if the protocol is HTTPS.
9595
type: boolean
96+
path:
97+
description: Path specifies a regular expression for to match
98+
on the request for http/https services If a rule does not
99+
specify a path, all paths will be matched.
100+
type: string
96101
protocol:
97102
description: Protocol specifies the protocol for the service.
98103
Should be one of http, https, tcp, udp, ssh or rdp. Defaults

controllers/tunnelbinding_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,6 @@ func (r *TunnelBindingReconciler) configureCloudflareDaemon() error {
574574
} else {
575575
targetService = binding.Status.Services[i].Target
576576
}
577-
578577
originRequest := OriginRequestConfig{}
579578
originRequest.NoTLSVerify = &subject.Spec.NoTlsVerify
580579
originRequest.ProxyAddress = &subject.Spec.ProxyAddress
@@ -588,6 +587,7 @@ func (r *TunnelBindingReconciler) configureCloudflareDaemon() error {
588587
finalIngresses = append(finalIngresses, UnvalidatedIngressRule{
589588
Hostname: binding.Status.Services[i].Hostname,
590589
Service: targetService,
590+
Path: subject.Spec.Path,
591591
OriginRequest: originRequest,
592592
})
593593
}

0 commit comments

Comments
 (0)