Skip to content

Commit

Permalink
Merge pull request #89 from ygelfand/add-path-to-service
Browse files Browse the repository at this point in the history
Add path to service
  • Loading branch information
adyanth authored Aug 28, 2023
2 parents 3b8045c + 55f3b66 commit e01ecd2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions api/v1alpha1/tunnelbinding_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ type TunnelBindingSubjectSpec struct {
//+kubebuilder:validation:Optional
Protocol string `json:"protocol,omitempty"`

// Path specifies a regular expression for to match on the request for http/https services
// If a rule does not specify a path, all paths will be matched.
//+kubebuilder:validation:Optional
Path string `json:"path,omitempty"`

// Target specified where the tunnel should proxy to.
// Defaults to the form of <protocol>://<service.metadata.name>.<service.metadata.namespace>.svc:<port>
//+kubebuilder:validation:Optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ spec:
description: NoTlsVerify disables TLS verification for this
service. Only useful if the protocol is HTTPS.
type: boolean
path:
description: Path specifies a regular expression for to match
on the request for http/https services If a rule does not
specify a path, all paths will be matched.
type: string
protocol:
description: Protocol specifies the protocol for the service.
Should be one of http, https, tcp, udp, ssh or rdp. Defaults
Expand Down
2 changes: 1 addition & 1 deletion controllers/tunnelbinding_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,6 @@ func (r *TunnelBindingReconciler) configureCloudflareDaemon() error {
} else {
targetService = binding.Status.Services[i].Target
}

originRequest := OriginRequestConfig{}
originRequest.NoTLSVerify = &subject.Spec.NoTlsVerify
originRequest.ProxyAddress = &subject.Spec.ProxyAddress
Expand All @@ -588,6 +587,7 @@ func (r *TunnelBindingReconciler) configureCloudflareDaemon() error {
finalIngresses = append(finalIngresses, UnvalidatedIngressRule{
Hostname: binding.Status.Services[i].Hostname,
Service: targetService,
Path: subject.Spec.Path,
OriginRequest: originRequest,
})
}
Expand Down

0 comments on commit e01ecd2

Please sign in to comment.