-
Notifications
You must be signed in to change notification settings - Fork 2
feat: support import for sonatyperepo_repository_apt_* resources
#171
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
base: main
Are you sure you want to change the base?
Conversation
|
sonatyperepo_repository_apt_* resources
| } else { | ||
| // Set default values when API doesn't provide replication data | ||
| m.Replication = &RepositoryReplicationModel{ | ||
| PreemptivePullEnabled: types.BoolValue(false), |
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.
Extract false to a common constant and use in schema please @yfougeray-euphoria
| } | ||
|
|
||
| // DoImportRequest implements the import functionality for APT Hosted repositories | ||
| func (f *AptRepositoryFormatHosted) DoImportRequest(repositoryName string, apiClient *sonatyperepo.APIClient, ctx context.Context) (any, *http.Response, 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.
Why not call the DoReadRequest function that exists already? This looks like code duplication...
| } | ||
|
|
||
| // DoImportRequest implements the import functionality for APT Proxy repositories | ||
| func (f *AptRepositoryFormatProxy) DoImportRequest(repositoryName string, apiClient *sonatyperepo.APIClient, ctx context.Context) (any, *http.Response, 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.
Why not call the DoReadRequest function that exists already? This looks like code duplication...
| } | ||
|
|
||
| // ValidateRepositoryForImport validates that the imported repository is indeed an APT Hosted repository | ||
| func (f *AptRepositoryFormatHosted) ValidateRepositoryForImport(repositoryData any, expectedFormat string, expectedType RepositoryType) 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.
Can't see ValidateRepositoryForImport being called from anywhere @yfougeray-euphoria ?
| return *apiResponse, httpResponse, nil | ||
| } | ||
|
|
||
| // ValidateRepositoryForImport validates that the imported repository is indeed an APT Proxy repository |
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.
Can't see ValidateRepositoryForImport being called from anywhere @yfougeray-euphoria ?



Resolve #146