Skip to content

Commit

Permalink
refactor into distinct packages to prep for adding firewall support t…
Browse files Browse the repository at this point in the history
…o Nodes
  • Loading branch information
AshleyDumaine committed Mar 8, 2024
1 parent 53a5848 commit edc6484
Show file tree
Hide file tree
Showing 9 changed files with 673 additions and 607 deletions.
34 changes: 34 additions & 0 deletions cloud/annotations/annotations.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package annotations

const (
// AnnLinodeDefaultProtocol is the annotation used to specify the default protocol
// for Linode load balancers. Options are tcp, http and https. Defaults to tcp.
AnnLinodeDefaultProtocol = "service.beta.kubernetes.io/linode-loadbalancer-default-protocol"
AnnLinodePortConfigPrefix = "service.beta.kubernetes.io/linode-loadbalancer-port-"
AnnLinodeDefaultProxyProtocol = "service.beta.kubernetes.io/linode-loadbalancer-default-proxy-protocol"

AnnLinodeCheckPath = "service.beta.kubernetes.io/linode-loadbalancer-check-path"
AnnLinodeCheckBody = "service.beta.kubernetes.io/linode-loadbalancer-check-body"
AnnLinodeHealthCheckType = "service.beta.kubernetes.io/linode-loadbalancer-check-type"

AnnLinodeHealthCheckInterval = "service.beta.kubernetes.io/linode-loadbalancer-check-interval"
AnnLinodeHealthCheckTimeout = "service.beta.kubernetes.io/linode-loadbalancer-check-timeout"
AnnLinodeHealthCheckAttempts = "service.beta.kubernetes.io/linode-loadbalancer-check-attempts"
AnnLinodeHealthCheckPassive = "service.beta.kubernetes.io/linode-loadbalancer-check-passive"

// AnnLinodeThrottle is the annotation specifying the value of the Client Connection
// Throttle, which limits the number of subsequent new connections per second from the
// same client IP. Options are a number between 1-20, or 0 to disable. Defaults to 20.
AnnLinodeThrottle = "service.beta.kubernetes.io/linode-loadbalancer-throttle"

AnnLinodeLoadBalancerPreserve = "service.beta.kubernetes.io/linode-loadbalancer-preserve"
AnnLinodeNodeBalancerID = "service.beta.kubernetes.io/linode-loadbalancer-nodebalancer-id"

AnnLinodeHostnameOnlyIngress = "service.beta.kubernetes.io/linode-loadbalancer-hostname-only-ingress"
AnnLinodeLoadBalancerTags = "service.beta.kubernetes.io/linode-loadbalancer-tags"
AnnLinodeCloudFirewallID = "service.beta.kubernetes.io/linode-loadbalancer-firewall-id"
AnnLinodeCloudFirewallACL = "service.beta.kubernetes.io/linode-loadbalancer-firewall-acl"

AnnLinodeNodePrivateIP = "node.k8s.linode.com/private-ip"
AnnLinodeHostUUID = "node.k8s.linode.com/host-uuid"
)
4 changes: 2 additions & 2 deletions cloud/linode/client.go → cloud/client/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package linode
package client

//go:generate go run github.com/golang/mock/mockgen -destination mock_client_test.go -package linode github.com/linode/linode-cloud-controller-manager/cloud/linode Client

Expand Down Expand Up @@ -39,7 +39,7 @@ type Client interface {
// linodego.Client implements Client
var _ Client = (*linodego.Client)(nil)

func newLinodeClient(token, ua, apiURL string) (*linodego.Client, error) {
func NewLinodeClient(token, ua, apiURL string) (*linodego.Client, error) {
linodeClient := linodego.NewClient(nil)
linodeClient.SetUserAgent(ua)
linodeClient.SetToken(token)
Expand Down
Loading

0 comments on commit edc6484

Please sign in to comment.