Skip to content

Conversation

@dcbw
Copy link
Member

@dcbw dcbw commented Jun 1, 2018

When a downstream project just uses libcni, it takes a lot of harness
code to set up binaries on-disk that get called. Instead we can handle
that by passing an execer interface to libcni APIs that gets called
instead, which the downstreams can use to avoid execing thing entirely
and instead check arguments/environment in code.

@containernetworking/cni-maintainers @squeed

@dcbw dcbw force-pushed the libcni-exec-interface branch from 8ce8dd8 to d0767cd Compare June 2, 2018 02:51
@dcbw
Copy link
Member Author

dcbw commented Jun 5, 2018

@matthewdupre @bboreham @rosenhouse too

@dcbw dcbw requested review from bboreham, matthewdupre, rosenhouse, squaremo and squeed and removed request for squaremo June 5, 2018 14:43
@dcbw dcbw force-pushed the libcni-exec-interface branch from d0767cd to 6c95fb8 Compare June 7, 2018 16:26
@dcbw
Copy link
Member Author

dcbw commented Jun 7, 2018

@containernetworking/cni-maintainers now updated to handle delegate.go and add an example of how the exec faking would be used. PTAL thanks!

@dcbw
Copy link
Member Author

dcbw commented Jun 8, 2018

@dcbw dcbw force-pushed the libcni-exec-interface branch 2 times, most recently from 95378d4 to cd09eae Compare June 11, 2018 17:19
dcbw added 2 commits June 11, 2018 15:33
When a downstream project just uses libcni, it takes a lot of harness
code to set up binaries on-disk that get called.  Instead we can handle
that by passing an execer interface to libcni APIs that gets called
instead, which the downstreams can use to avoid execing thing entirely
and instead check arguments/environment in code.

Downstream users that currently create a CNIConfig object like this:

    cniconf := libcni.CNIConfig{Path: []string{"foobar"}}

Can now fake out all on-disk binary exec/find operations with:

    cniconf := libcni.NewCNIConfig([]string{"foobar"}, <exec interface>)
@dcbw dcbw force-pushed the libcni-exec-interface branch from cd09eae to ffc1e7b Compare June 11, 2018 20:34
@squeed squeed merged commit 07c1a6d into containernetworking:master Jun 13, 2018
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