-
Notifications
You must be signed in to change notification settings - Fork 43
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
Move properties fetcher methods into Provider #4181
Conversation
// FetchAllProperties implements the provider interface | ||
// TODO: Implement this | ||
func (_ *dockerHubImageLister) FetchAllProperties(_ context.Context, _ string, _ minderv1.Entity) (*properties.Properties, error) { | ||
return nil, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo for me: Handle nil
receiver on Properties
(Property
already does)
@@ -36,9 +36,6 @@ type REST struct { | |||
credential provifv1.RestCredential | |||
} | |||
|
|||
// Ensure that REST implements the REST interface | |||
var _ provifv1.REST = (*REST)(nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to remove these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, REST and Git are not actually providers, but helper code that providers use to implement the relevant traits. I was thinking it would be good to start migrating away from these "trying" to implement the provider interface. This gets a little tricky, as we do treat them as providers in some test code, so I might just create a provider wrapper that uses these.
// FetchAllProperties fetches all properties for the given entity | ||
FetchAllProperties(ctx context.Context, name string, entType minderv1.Entity) (*properties.Properties, error) | ||
// FetchProperty fetches a single property for the given entity | ||
FetchProperty(ctx context.Context, name string, entType minderv1.Entity, key string) (*properties.Property, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with moving these
15e572a
to
a5adbd8
Compare
Signed-off-by: Juan Antonio Osorio <[email protected]>
a5adbd8
to
d279d90
Compare
Summary
This effectively enforces that providers must implement properties fetching as part of their implementation.
Change Type
Mark the type of change your PR introduces:
Testing
Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.
Review Checklist: