Skip to content

Conversation

g-linville
Copy link
Member

for #4677

@g-linville g-linville marked this pull request as draft October 17, 2025 22:23
Comment on lines +43 to +45
// Retry loop to handle conflicts
var settings v1.K8sSettings
for i := 0; i < 5; i++ {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure why I was experiencing 409s here to begin with, but the loop fixed it. If there is a better fix or something obviously wrong that was causing the 409s, please let me know.

func newK8sSettingsGetter(client storage.Client) K8sSettingsGetter {
return &k8sSettingsGetter{
client: client,
cacheTTL: 30 * time.Second, // Cache for 30 seconds
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure that a cache is really necessary, but Claude added one, so I figured we might as well keep it.

Comment on lines +15 to +17
type K8sSettingsGetter interface {
GetK8sSettings(ctx context.Context) (*v1.K8sSettingsSpec, error)
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm really not sure that this interface is necessary. It seems the main reason it is here is for locking and caching purposes. Pretty sure caching is not needed, but I don't think locking is needed either. In the place where this Getter is used, I think we can just use an obot storage client directly instead...let me know if you have any thoughts on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant