Skip to content

Commit

Permalink
Support HTTPS in StartSenderToResource (#559)
Browse files Browse the repository at this point in the history
This will allow reusing tests that use `StartSenderToResource` with
strict transport-encryption.

Signed-off-by: Pierangelo Di Pilato <[email protected]>
  • Loading branch information
pierDipi authored Jul 31, 2023
1 parent 645a631 commit 6b6046a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/eventshub/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ func StartSenderToResource(gvr schema.GroupVersionResource, name string) EventsH
if u == nil {
return fmt.Errorf("resource %v named %s is not addressable", gvr, name)
}

if u.URL.Scheme == "https" {
return StartSenderURLTLS(u.URL.String(), u.CACerts)(ctx, envs)
}

return StartSenderURL(u.URL.String())(ctx, envs)
}
}
Expand Down

0 comments on commit 6b6046a

Please sign in to comment.