Skip to content
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

image-rs: Redefine constructions of ImageClient and ImageConfig #416

Merged
merged 2 commits into from
Dec 25, 2023

Conversation

ChengyuZhu6
Copy link
Member

@ChengyuZhu6 ChengyuZhu6 commented Dec 22, 2023

To enable guest pulling within the kata-agent, it is imperative to configure CC_IMAGE_WORK_DIR variable within kata-agent before call image-rs to pull image. However, the use of CC_IMAGE_WORK_DIR may cause confusion in the context of kata-containers. Therefore, we can redefine constructions of ImageConfig and ImageClient that accept the image work directory as a parameter and construct instances of ImageConfig and ImageClient.

Fixes #415

@ChengyuZhu6
Copy link
Member Author

/cc @jiangliu @arronwy

Copy link
Member

@Xynnn007 Xynnn007 left a comment

Choose a reason for hiding this comment

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

Will this break the kata-agent side logic now?

@ChengyuZhu6
Copy link
Member Author

Will this break the kata-agent side logic now?

I will simultaneously update the variable name within the kata side.

ImageConfig represents the configuration of an image. Previously, we used
the `CC_IMAGE_WORK_DIR` environment variable to set the image work directory,
but this was not flexible or reliable enough for different use cases.
Now, we provide a `new()` method that takes the image work directory as an argument,
and returns an ImageConfig instance with that directory.
This way, consumers can customize the image work directory as they need.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
@ChengyuZhu6 ChengyuZhu6 changed the title image-rs: Modify the name of CC_IMAGE_WORK_DIR more generic image-rs: Redefine constructions of ImageClient and ImageConfig Dec 22, 2023
@ChengyuZhu6 ChengyuZhu6 force-pushed the variable branch 9 times, most recently from f6c3449 to be0d122 Compare December 22, 2023 15:07
ImageClient is a client for image management. It has an associated field ImageConfig
that could specify the image work directory. Previously, we created an ImageClient instance with default(),
which used the `CC_IMAGE_WORK_DIR` environment variable to set the image work directory.
This approach was not flexible or reliable for different scenarios. Now, we offer a new() method
that accepts the image work directory as a parameter, and returns an ImageClient instance
with an ImageConfig that uses that directory. This way, users can customize the image work directory as they wish.

Fixes confidential-containers#415

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
@jiangliu jiangliu merged commit af092b3 into confidential-containers:main Dec 25, 2023
6 checks passed
@ChengyuZhu6 ChengyuZhu6 deleted the variable branch December 25, 2023 08:30
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.

image-rs: Remove the environment variable CC_IMAGE_WORK_DIR
3 participants