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

libcni: add InitCNIConfigWithCacheDir() and deprecate RuntimeConfig.CacheDir #682

Merged
merged 1 commit into from
Jun 26, 2019

Conversation

dcbw
Copy link
Member

@dcbw dcbw commented Jun 20, 2019

CacheDir is a property of the entire CNIConfig object and there is no
point to having it be different between container invocations. It was
originally put in RuntimeConfig to make re-vendoring easier so that
users wouldn't have to update calls to InitCNIConfig.

@containernetworking/cni-maintainers

@mars1024
Copy link
Member

ref to #683 , CNIConfig seems to be a more reasonable location to hold cache dir, thanks @dcbw

libcni/api.go Outdated Show resolved Hide resolved
…acheDir

CacheDir is a property of the entire CNIConfig object and there is no
point to having it be different between container invocations. It was
originally put in RuntimeConfig to make re-vendoring easier so that
users wouldn't have to update calls to InitCNIConfig.
Copy link
Member

@mars1024 mars1024 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@jellonek jellonek left a comment

Choose a reason for hiding this comment

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

LGTM

@dcbw dcbw merged commit ef03d04 into containernetworking:master Jun 26, 2019
Luap99 pushed a commit to Luap99/ocicni that referenced this pull request Feb 18, 2021
Add a new function InitCNIWithCache which works like
InitCNI except that it accepts an extra parameter to
set the cache directory.

This change is needed for rootless users which are
trying to use cni in a user+net namespace because the
default directory is not writeable by rootless users.

Second, setting the cni cache directory via the runtime
config is deprecated. It has to be set with
NewCNIConfigWithCacheDir for the cni config.
see: containernetworking/cni#682

Signed-off-by: Paul Holzinger <[email protected]>
Luap99 pushed a commit to Luap99/ocicni that referenced this pull request Feb 18, 2021
Add a new function InitCNIWithCache which works like
InitCNI except that it accepts an extra parameter to
set the cache directory.

This change is needed for rootless users which are
trying to use cni in a user+net namespace because the
default directory is not writeable by rootless users.

Second, setting the cni cache directory via the runtime
config is deprecated. It has to be set with
NewCNIConfigWithCacheDir for the cni config.
see: containernetworking/cni#682

Signed-off-by: Paul Holzinger <[email protected]>
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