Conversation
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| } | ||
| p.client = client | ||
| }) | ||
| return p.clientErr |
There was a problem hiding this comment.
Bug: Client Silently Ignores Credential Updates.
The ensureClient method accepts a serviceAccountKey parameter but only uses it during the first call due to sync.Once. If subsequent requests provide different credentials (e.g., after Secret rotation), they're silently ignored and the client continues using the original credentials. This creates a mismatch between the credentials passed in requests and those actually used by the client, potentially causing authentication failures or security issues.
…esting credential updates would be picked up automatically
Only create the iaas client once and use it for all STACKIT connections.
Note
Lazily initialize and reuse a single STACKIT SDK IaaS client per provider instance, removing per-call credentials and updating core flows, interfaces, tests, and docs.
ensureClientfor lazy, single-tenant client initialization and reuse; warn on credential changes.CreateMachine,DeleteMachine,GetMachineStatus,ListMachinesto init client once and drop per-call credentials in client invocations.NewStackitClientwith storediaasClient; extractcreateIAASClient.StackitClientmethods toCreateServer/GetServer/DeleteServer/ListServers(ctx, projectID, region, ...)(removeserviceAccountKeyparams).ErrServerNotFound.Written by Cursor Bugbot for commit cb448d3. This will update automatically on new commits. Configure here.