When retrieving an existing docker respository with V2 enabled, there is a mismatch in Repository.docker_api_version and Repository.raw["dockerApiVersion"].
For example, create a new docker repository in the artifactory web console with V2 enabled. Then:
Retrieve the repository and enumerate the object's properties:
When retrieving an existing docker respository with V2 enabled, there is a mismatch in Repository.docker_api_version and Repository.raw["dockerApiVersion"].
For example, create a new docker repository in the artifactory web console with V2 enabled. Then:
Retrieve the repository and enumerate the object's properties:
You'll see something like this:
If you update the repo using
repo.update()
the result is thatrepo.docker_api_version
is used and the repository is incorrectly changed to V1. https://github.com/devopshq/artifactory/blob/0.8.0/dohq_artifactory/admin.py#L771I believe the culprit is the init function of RepositoryLocal sets the version to V1: https://github.com/devopshq/artifactory/blob/0.8.0/dohq_artifactory/admin.py#L734
And then _read_response does not grab the real value from the API response: https://github.com/devopshq/artifactory/blob/0.8.0/dohq_artifactory/admin.py#L791
So the default value of V1 is always used.
Solution:
I propose the _read_response function should be changed to also update
self.docker_api_version
using the value from the api response.