Skip to content

Find Lease by index - #133

Open
gman0 wants to merge 1 commit into
platform-mesh:mainfrom
gman0:get-lease-fix
Open

gman0 wants to merge 1 commit into
platform-mesh:mainfrom
gman0:get-lease-fix

Conversation

@gman0

@gman0 gman0 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

This PR fixes how the hearbeat Leases are retrieved, i.e. just find it by matching annotation.

On-behalf-of: @SAP robert.vasek@sap.com
Signed-off-by: Robert Vasek <rvasek01@gmail.com>
return fmt.Errorf("getting lease %s/%s: %w", leaseNamespace, leaseName, err)
}
lease = found
lease, err := r.findLeaseByConnection(ctx, c, cc.Name)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually this findLeaseByConnection could have been called something else, and the signature is also weird. It returns error on listing failures, but it can also return nil when the Lease is not found by name. I don't like this can fail in two ways. Will change.

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

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant