Skip to content
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

fix sublease token propagation during creation of managed replica accounts #446

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

majewsky
Copy link
Contributor

A classic case of stringly-typed interface: Because the return type on the callback was only string, we did not notice that we returned the full serialized token when we should only have been returning the contents of the secret field. To avoid this error, the callback now returns a structured keppel.SubleaseToken value.

Also, I changed the callback to return just error instead of *keppel.RegistryV2Error. The latter is more consistent with what CreateOrUpdateAccount returns, but this change makes the callback implementations shorter, which overall helps readability.

The problem here is that the sublease token callback is supposed to
return just the secret from the token, but the callback implementation
in createOrUpdateManagedAccount returns the full serialized token.

Will fix this in the next commit.
…ounts

A classic case of stringly-typed interface: Because the return type on
the callback was only string, we did not notice that we returned the
full serialized token when we should only have been returning the
contents of the `secret` field. To avoid this error, the callback now
returns a structured `keppel.SubleaseToken` value.

Also, I changed the callback to return just `error` instead of
`*keppel.RegistryV2Error`. The latter is more consistent with what
`CreateOrUpdateAccount` returns, but this change makes the callback
implementations shorter, which overall helps readability.
@majewsky majewsky force-pushed the fix-creation-of-managed-replicas branch from 787398f to 43e0609 Compare October 18, 2024 12:54
Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

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

Lgtm

@coveralls
Copy link

Coverage Status

coverage: 80.226% (+0.3%) from 79.976%
when pulling 43e0609 on fix-creation-of-managed-replicas
into d5d95cf on master.

@majewsky majewsky merged commit fa0a7cd into master Oct 18, 2024
7 of 8 checks passed
@majewsky majewsky deleted the fix-creation-of-managed-replicas branch October 18, 2024 13:02
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.

3 participants