Skip to content

Commit

Permalink
fixups: add comments and documentations
Browse files Browse the repository at this point in the history
Signed-off-by: Alay Patel <[email protected]>
  • Loading branch information
alaypatel07 committed Nov 13, 2021
1 parent d374eff commit 2addf39
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
8 changes: 6 additions & 2 deletions transport/stunnel/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ import (
)

const (
// TCP_NODELAY=1 bypasses Nagle's Delay algorithm
// this means that the tcp stack does not way of receiving an acc
// before sending the next packet https://en.wikipedia.org/wiki/Nagle%27s_algorithm
// At scale setting/unsetting this option might drive different network characteristics
stunnelServerConfTemplate = `foreground = yes
pid =
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
debug = 7
sslVersion = TLSv1.2
[rsync]
sslVersion = TLSv1.3
[transfer]
accept = {{ $.acceptPort }}
connect = {{ $.connectPort }}
key = /etc/stunnel/certs/tls.key
Expand Down
17 changes: 14 additions & 3 deletions transport/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
)

// Transport exposes the methods required for transfers to add
// a tunneling mechanism for the traffic sent over the network.
type Transport interface {
// NamespacedName returns the namespaced name to identify this transport Transport
NamespacedName() types.NamespacedName
Expand Down Expand Up @@ -44,15 +46,24 @@ type Transport interface {
MarkForCleanup(ctx context.Context, c client.Client, key, value string) error
}

// Options allows users of the transport to configure certain field
type Options struct {
// Labels will be applied to objects reconciled by the transport
Labels map[string]string
// Owners will be applied to all objects reconciled by the transport
Owners []metav1.OwnerReference
Image string
// Image allows for specifying the image used for running the transport containers
Image string

ProxyURL string
// ProxyURL is used if the cluster is behind a proxy
ProxyURL string
// ProxyUsername username for connecting to the proxy
ProxyUsername string
// ProxyPassword password for connecting to the proxy
ProxyPassword string
NoVerifyCA bool
// NoVerifyCA allows you to override verification of TLS certs
NoVerifyCA bool
// CAVerifyLevel the level at which CA certs will be verify if NoVerifyCA is false
CAVerifyLevel string
}

Expand Down

0 comments on commit 2addf39

Please sign in to comment.