-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Generalize container image representation #8702
Comments
One note - with the addition of the digest syntax it's tag or digest. There may be value (speaking from experience) in treating it as an opaque value in the API (DockerImage -> name) vs trying to split out tag and digest and copy them. That avoids the "is empty tag 'latest' or not" question.
|
One of my API Rules is that we shouldn't munge fields set by the user/client. One benefit of a separate field for digest is that it could be filled in asynchronously (by defaulting, admission control, or late initialization) and favored over the tag if present -- the tag would remain for informational purposes, which is useful since the digest isn't human-friendly. |
We could also populate tag with "latest" by default to eliminate ambiguity about that. |
Although at some point that field is allegedly going away. We definitely regretted decomposing the fields in v1beta1 and went to pure physical and virtual (kind not represented in scheme) object references.
|
@smarterclayton Are you suggesting we leave the image string as is, or that we just don't break out tag from name, or do you have another concrete suggestion? |
@smarterclayton Could you elaborate what is the bad experience for separating the tags? |
Generally not mutate/parse the string at all for Docker and treat it as opaque - if we have a more structured format eventually (URL form) support that via some separate field / struct. My concern is that we are generally dealing with an opaque value (what the Docker API expects) which is insufficiently specified at this time. It did not seem we had a strong reason to parse the value except as a benefit to API consumers - and they already typically deal with the value in an opaque fashion (go-dockerclient). If we require consumers to split the value themselves that requires them to also implement the same logic as and as Docker. For instance, someone writing a python client of Kube that wants to insert a string image value they get from the Docker API has to parse that value them self, pass it to us, and then we likely reconstruct it back to its original form to pass to adocker. For Rocket, a structured value is more logical because it's guided by an explicit specification.
|
The Docker 1.6 API and client accept "172.30.180.175:5000/myproject/origin-ruby-sample@sha256:82f39128a0705eba6964bad1e1e548ec72b59e8428914e0001479bdb6211a051" which looks like a tag if you use one parsing algorithm, but not if you use the other. We're currently in OpenShift and Kube using the direct docker parsers pkg
but it makes me pretty uncomfortable to tell clients they also need to implement that. |
Ok, so the problem is the client spec, not the API. There is a server, repo (namespace + name), and tag or digest, but that's encoded in an unfortunate way. Anyway, the most important part of this change is making it possible to add other specs later. The minimal thing we'd need to do is rename the image field to dockerImage and change it from required to optional. I'd prefer to also add the struct so that we could add fields to dockerImage, though. That would look like:
|
@smarterclayton As @bgrant0607 pointed out #8702 (comment) Separating the fields sounds more like the future to me. IMHO, this looks cleaner in the API. But I am OK with just a string for the first iteration to make the change smoother. |
cc/ myself |
Sorry, but we don't currently have consensus on this change, and we've run out of time to debate/bikeshed the API change. We'll need to revisit in the v2 API. One suggestion was to serialize new representations into the image string field in older APIs. Problems with that include:
cc @thockin |
For completeness, we'll be serializing the state using the v1 API and Kubelet will pull pods from apiserver via the v1 API for the foreseeable future, so it will need an encoding in v1 that doesn't lose information. I don't see a future where we don't need to introduce a new field or fields for new formats, references, etc. We should document that the current image field is optional (i.e., add |
Why can't we add a On Tue, May 26, 2015 at 5:01 PM, Brian Grant notifications@github.com
|
I am not saying it's going to be pleasant, but if we can't figure out how On Tue, May 26, 2015 at 6:05 PM, Brian Grant notifications@github.com
|
FWIW, In #8839 I am replacing the string with struct in v1 and the internal representation, I keep the string as they are for all other versions. I am not expecting beta1, beta2, beta3 to run things other than docker image. |
The concern is whether we have the bandwidth to take this change before 1.0 On Tue, May 26, 2015 at 6:23 PM, Yifan Gu notifications@github.com wrote:
|
@thockin Our API versioning has handled the vast majority of API changes so far, but there are scenarios where it doesn't -- where newer extensions subsuming existing functionality are not representable in older API versions, especially where the fields were required. See also the selector API changes as an example. |
We're going to make the image field officially optional in v1, by tagging the field with "omitempty". In practice, it will be required until another image field is added. |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
/remove-lifecycle stale |
kubernetes/pkg/apis/core/types.go Lines 4184 to 4192 in 6fdb5a8
A recent PR by @roycaihw : Mark ContainerImage.names as optional #102159 which seem to be related. Could someone take a look if this issue needs to be working on further? |
/kind feature |
Forked from #7018 and #7203.
We need to generalize the representation of container images so that we can support more image formats, pinning to specific image hashes, references to image API objects, and other features in the future. Generalizing this representation breaks ALL API versions, so we should do that now.
The proposed format is here: #7203 (comment)
It follows the approach of VolumeSource.
@bakins @philips @smarterclayton @yifan-gu
The text was updated successfully, but these errors were encountered: