-
Notifications
You must be signed in to change notification settings - Fork 204
chore: fix field comments on ClientSet #701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
k8s-ci-robot
merged 1 commit into
kubernetes-sigs:master
from
justinsb:fix_field_comments_clientset
Jan 29, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,42 +38,67 @@ const ( | |
|
|
||
| // ClientSet consists of clients connected to each instance of an HA proxy server. | ||
| type ClientSet struct { | ||
| mu sync.Mutex //protects the clients. | ||
| clients map[string]*Client // map between serverID and the client | ||
| // connects to this server. | ||
|
|
||
| agentID string // ID of this agent | ||
| address string // proxy server address. Assuming HA proxy server | ||
|
|
||
| leaseCounter ServerCounter // counts number of proxy server leases | ||
| lastReceivedServerCount int // last server count received from a proxy server | ||
| lastServerCount int // last server count value from either lease system or proxy server, former takes priority | ||
|
|
||
| // unless it is an HA server. Initialized when the ClientSet creates | ||
| // the first client. When syncForever is set, it will be the most recently seen. | ||
| syncInterval time.Duration // The interval by which the agent | ||
| // periodically checks that it has connections to all instances of the | ||
| // proxy server. | ||
| probeInterval time.Duration // The interval by which the agent | ||
| // mu guards access to the clients map | ||
| mu sync.Mutex | ||
|
|
||
| // clients is a map between serverID and the client | ||
| // connected to this server. | ||
| clients map[string]*Client | ||
|
|
||
| // agentID is "our ID" - the ID of this agent. | ||
| agentID string | ||
|
|
||
| // Address is the proxy server address. Assuming HA proxy server | ||
| address string | ||
|
|
||
| // leaseCounter counts number of proxy server leases | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: This only used if the relevant feature is enabled. |
||
| leaseCounter ServerCounter | ||
|
|
||
| // lastReceivedServerCount is the last serverCount value received when connecting to a proxy server | ||
| lastReceivedServerCount int | ||
|
|
||
| // lastServerCount is the most-recently observed serverCount value from either lease system or proxy server, | ||
| // former takes priority unless it is an HA server. | ||
| // Initialized when the ClientSet creates the first client. | ||
| // When syncForever is set, it will be the most recently seen. | ||
| lastServerCount int | ||
|
|
||
| // syncInterval is the interval at which the agent periodically checks | ||
| // that it has connections to all instances of the proxy server. | ||
| syncInterval time.Duration | ||
|
|
||
| // The maximum interval for the syncInterval to back off to when unable to connect to the proxy server | ||
| syncIntervalCap time.Duration | ||
|
|
||
| // syncForever is true if we should continue syncing (support dynamic server count). | ||
| syncForever bool | ||
|
|
||
| // probeInterval is the interval at which the agent | ||
| // periodically checks if its connections to the proxy server is ready. | ||
| syncIntervalCap time.Duration // The maximum interval | ||
| // for the syncInterval to back off to when unable to connect to the proxy server | ||
| probeInterval time.Duration | ||
|
|
||
| dialOptions []grpc.DialOption | ||
| // file path contains service account token | ||
|
|
||
| // serviceAccountTokenPath is the file path to our kubernetes service account token | ||
| serviceAccountTokenPath string | ||
|
|
||
| // channel to signal that the agent is pending termination. | ||
| drainCh <-chan struct{} | ||
|
|
||
| // channel to signal shutting down the client set. Primarily for test. | ||
| stopCh <-chan struct{} | ||
|
|
||
| agentIdentifiers string // The identifiers of the agent, which will be used | ||
| // agentIdentifiers is the identifiers of the agent, which will be used | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this is a comma delineated list. |
||
| // by the server when choosing agent | ||
| agentIdentifiers string | ||
|
|
||
| warnOnChannelLimit bool | ||
| xfrChannelSize int | ||
|
|
||
| syncForever bool // Continue syncing (support dynamic server count). | ||
| // serverCountSource controls how we compute the server count. | ||
| // The proxy server sends the serverCount header to each connecting agent, | ||
| // and the agent figures out from these observations how many | ||
| // agent-to-proxy-server connections it should maintain. | ||
| serverCountSource string | ||
| } | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO to improve this. Its the address we use to contact the ANP Server. Normally this would be a LB address in front of the ANP Servers.