-
Notifications
You must be signed in to change notification settings - Fork 162
fix: new fields and fixes for Terraform, Cargo, Nuget, Helm, Ansible #1257
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: master
Are you sure you want to change the base?
Conversation
…nsible Signed-off-by: richard.le-terrier <[email protected]>
Signed-off-by: richard.le-terrier <[email protected]>
|
Work in progress to adapt unit tests. |
|
please check CI failures |
|
Please update description and also provide appropriate labels |
| type HelmRemoteRepositoryParams struct { | ||
| RemoteRepositoryBaseParams | ||
| ChartsBaseUrl string `json:"chartsBaseUrl,omitempty"` | ||
| ChartsBaseUrl string `json:"chartsBaseUrl"` // do not set omitempty to be able to empty the value when updating |
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.
if let's say this used for updating, are we making sure any empty value sent to the server is not updated in the database?
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'm not sure about the implementation in the Artifactory API since I don't have the source for it. But in the client updating local and remote repositories config will result in a call to the method https://github.com/jfrog/jfrog-client-go/blob/master/artifactory/services/repository.go#L28 that will marshal the struct (remove the empty values from the body) and send a POST request. Maybe the POST is implemented like a PATCH on the server and ignore missing fields.
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.
Also what strange in that performRequest function is that the update will run a POST while the create will do a PUT.
| setCacheVirtualRepositoryParams(&tvp.CommonCacheVirtualRepositoryParams, true) | ||
|
|
||
| err = testsUpdateVirtualRepositoryService.Terraform(tvp) | ||
| assert.NoError(t, err, "Failed to update "+repoKey) |
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.
isn't this assertion valid? Is it possible to provide proper comment in the codebase why it was decided to be removed?
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.
Removed this two lines because there are the same assertions at line 680.
|
|
||
| err = testsUpdateVirtualRepositoryService.Terraform(tvp) | ||
| assert.NoError(t, err, "Failed to update "+repoKey) | ||
| validateRepoConfig(t, repoKey, tvp) |
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.
same
Signed-off-by: richard.le-terrier <[email protected]>

This PR add some missing fields on local and remote repository structs. The Ansible implmentation was also added.
Another changes that is introduced here is removing some omitempty tags. Without removing this tags it seems impossible to empty some fields when updating the repositories config.