Skip to content

Conversation

@ktock
Copy link
Member

@ktock ktock commented Dec 14, 2020

#194

This enables to import estargz without extra dependencies from the snapshotter &
ctr-remote by adding go.mod to estargz package.
From this commit, estargz lib is handled as an independent package separated from stargz snapshotter.

Currently, estargz lib isn't remotely importable so stargz snapshotter directly
uses the local estargz lib with replace directive. Thus stargz snapshotter
refers to the estargz lib contained in the same commit.

Once estargz lib starts its own release lifecycle (i.e. starts to have its own
version separated from stargz snapshotter), we can switch to import that
released version if needed.

limitations under the License.
*/

package estargz
Copy link
Member

Choose a reason for hiding this comment

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

I don't like this self copy in vendor dir. Can we remove vendor directory entirely?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we can.

@AkihiroSuda
Copy link
Member

cc @mattmoor PTAL

This enables to import estargz without extra dependencies from the snapshotter &
ctr-remote. From this commit, estargz lib is handled as an independent package
separated from stargz snapshotter.

Currently, estargz lib isn't remotely importable so stargz snapshotter directly
uses the local estargz lib with `replace` directive. Thus stargz snapshotter
refers to the estargz lib contained in the same commit.

Once estargz lib starts its own release lifecycle (i.e. starts to have its own
version separated from stargz snapshotter), we can switch to import that
released version if needed.

Signed-off-by: Kohei Tokunaga <[email protected]>
@mattmoor
Copy link
Contributor

Awesome!

@AkihiroSuda
Copy link
Member

+376 −1,054,545

🤣

@AkihiroSuda AkihiroSuda merged commit f3593f6 into containerd:master Dec 14, 2020
@ktock ktock deleted the import-esgz branch December 15, 2020 05:06
AkihiroSuda added a commit to AkihiroSuda/buildkit_poc that referenced this pull request Dec 18, 2020
The git repo of github.com/containerd/stargz-snapshotter now has two go.mod modules:
- github.com/containerd/stargz-snapshotter
- github.com/containerd/stargz-snapshotter/estargz

So we need to have the following `replace` directive in `go.mod`:
```
github.com/containerd/stargz-snapshotter/estargz => github.com/containerd/stargz-snapshotter/estargz <VERSION>
```

Otherwise `go mod tidy` fails with the following error:
```
go: github.com/containerd/[email protected] requires
        github.com/containerd/stargz-snapshotter/[email protected]: invalid version: unknown revision 000000000000
```

ref: containerd/stargz-snapshotter#195

Signed-off-by: Akihiro Suda <[email protected]>
alexcb pushed a commit to alexcb/buildkit that referenced this pull request Jan 20, 2021
The git repo of github.com/containerd/stargz-snapshotter now has two go.mod modules:
- github.com/containerd/stargz-snapshotter
- github.com/containerd/stargz-snapshotter/estargz

So we need to have the following `replace` directive in `go.mod`:
```
github.com/containerd/stargz-snapshotter/estargz => github.com/containerd/stargz-snapshotter/estargz <VERSION>
```

Otherwise `go mod tidy` fails with the following error:
```
go: github.com/containerd/[email protected] requires
        github.com/containerd/stargz-snapshotter/[email protected]: invalid version: unknown revision 000000000000
```

ref: containerd/stargz-snapshotter#195

Signed-off-by: Akihiro Suda <[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