Skip to content

Remove image spec fork that was added to support ArgsEscaped non-OCI docker field#44

Merged
kiashok merged 4 commits into
kevpar:windows_portfrom
kiashok:removeImageSpecFork
Jul 14, 2022
Merged

Remove image spec fork that was added to support ArgsEscaped non-OCI docker field#44
kiashok merged 4 commits into
kevpar:windows_portfrom
kiashok:removeImageSpecFork

Conversation

@kiashok
Copy link
Copy Markdown
Collaborator

@kiashok kiashok commented Jun 15, 2022

Root Cause:

Image-spec fork was added to our CRI branch to support the non-OCI docker image-spec field called 'ArgsEscaped'. ArgsEscaped is used by docker to determine how the image command should be interpreted. If ArgsEscaped is set, then the first element of the command array will be used as-is.
We would like to get rid of the dependency on the image-fork spec while we work on a cleaner fix that can be pushed upstream as well.

Fix:

Instead of relying on the image-fork spec and adding the ArgsEscaped field to our image spec, we try to read the ArgsEscaped value by making an extra json.Unmarshal call during getImage()

Testing

Manually tested the changes to make sure that the fix does not regress any behavior that the original fix was made for. I will be adding regression tests to the upcoming PR that has the complete upstream fix.

Comment thread pkg/server/container_create_windows.go Outdated
Comment thread pkg/store/image/image.go
@kevpar
Copy link
Copy Markdown
Owner

kevpar commented Jun 15, 2022

Since this is only a temporary fix that will very soon be replaced by the cleaner upstream fix, I will be adding regression tests to the upcoming PR instead of this one.

Does this refer to the fact that once opencontainers/image-spec#892 gets in, we can remove this change?

@kiashok
Copy link
Copy Markdown
Collaborator Author

kiashok commented Jun 16, 2022

Since this is only a temporary fix that will very soon be replaced by the cleaner upstream fix, I will be adding regression tests to the upcoming PR instead of this one.

Does this refer to the fact that once opencontainers/image-spec#892 gets in, we can remove this change?

I was referring more to your WIP changes that I am looking into as your changes seem to handle all cases and I was wondering if we just wanted to have the upstream fix in our fork too and that's why I mentioned it. But after giving this a second thought, it should not be a problem to leave these changes as is since we longer have dependency on image-spec fork.

@kevpar
Copy link
Copy Markdown
Owner

kevpar commented Jun 16, 2022

Since this is only a temporary fix that will very soon be replaced by the cleaner upstream fix, I will be adding regression tests to the upcoming PR instead of this one.

Does this refer to the fact that once opencontainers/image-spec#892 gets in, we can remove this change?

I was referring more to your WIP changes that I am looking into as your changes seem to handle all cases and I was wondering if we just wanted to have the upstream fix in our fork too and that's why I mentioned it. But after giving this a second thought, it should not be a problem to leave these changes as is since we longer have dependency on image-spec fork.

I think even with my WIP changes, we still need a way to determine if ArgsEscaped is set on the image config, so we will still need this change (or ArgsEscaped added to image-spec). IIRC this same change was part of my WIP.

@kiashok
Copy link
Copy Markdown
Collaborator Author

kiashok commented Jun 22, 2022

Since this is only a temporary fix that will very soon be replaced by the cleaner upstream fix, I will be adding regression tests to the upcoming PR instead of this one.

Does this refer to the fact that once opencontainers/image-spec#892 gets in, we can remove this change?

I was referring more to your WIP changes that I am looking into as your changes seem to handle all cases and I was wondering if we just wanted to have the upstream fix in our fork too and that's why I mentioned it. But after giving this a second thought, it should not be a problem to leave these changes as is since we longer have dependency on image-spec fork.

I think even with my WIP changes, we still need a way to determine if ArgsEscaped is set on the image config, so we will still need this change (or ArgsEscaped added to image-spec). IIRC this same change was part of my WIP.

I updated the description. Since I am in the process of adding regression tests to your WIP code changes, I'll check them in as part of that PR.

Comment thread pkg/server/container_create.go Outdated
Comment thread pkg/server/container_create_windows.go Outdated
Comment thread vendor.conf
Copy link
Copy Markdown
Collaborator

@helsaawy helsaawy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am understanding correctly, the blob data in the content store is set by docker, so we don't need to set that when pulling an image, right?

@kiashok kiashok force-pushed the removeImageSpecFork branch from 1cca14d to 6baf401 Compare July 14, 2022 00:14
@kiashok
Copy link
Copy Markdown
Collaborator Author

kiashok commented Jul 14, 2022

If I am understanding correctly, the blob data in the content store is set by docker, so we don't need to set that when pulling an image, right?

That is right. We are only trying to read argsEscaped from the blob data we got in

Copy link
Copy Markdown
Owner

@kevpar kevpar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kiashok kiashok merged commit 25b3e5f into kevpar:windows_port Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants