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 RESTClient not implementing v2 API Client interface #172

Merged

Conversation

sergimrz
Copy link

With the latest changes some clients has been added on the V2 API without ensuring that RESTClient matches the Client interface:
https://github.com/mittwald/goharbor-client/blob/master/apiv2/client.go#L222 vs https://github.com/mittwald/goharbor-client/blob/master/apiv2/pkg/clients/configure/configure.go#L35

https://github.com/mittwald/goharbor-client/blob/master/apiv2/client.go#L268 vs https://github.com/mittwald/goharbor-client/blob/master/apiv2/pkg/clients/label/label.go#L38

Fixed this two references and added the following line to ensure that the RESTClient struct always implements the Client interface, preventing the following contributions to break the interface implementation:
var _ Client = (*RESTClient)(nil)

@sergimrz
Copy link
Author

@elenz97 could you please check this PR? This don't allows us to perform proper mocking on the RESTClient.
Thank you in advance!

Copy link
Collaborator

@elenz97 elenz97 left a comment

Choose a reason for hiding this comment

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

Hey @sergimrz, good catch and thanks for the PR!

@elenz97 elenz97 merged commit e172771 into mittwald:master Aug 30, 2023
5 checks passed
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.

2 participants