Skip to content

Commit

Permalink
native: support for FreeBSD
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel Karp <me@samuelkarp.com>
  • Loading branch information
samuelkarp committed Dec 23, 2020
1 parent d6baafa commit b624486
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 6 deletions.
9 changes: 3 additions & 6 deletions snapshots/native/native.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,9 @@ func (o *snapshotter) mounts(s storage.Snapshot) []mount.Mount {

return []mount.Mount{
{
Source: source,
Type: "bind",
Options: []string{
roFlag,
"rbind",
},
Source: source,
Type: mountType,
Options: append(defaultMountOptions, roFlag),
},
}
}
Expand Down
23 changes: 23 additions & 0 deletions snapshots/native/native_default.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// +build !freebsd

/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package native

const mountType = "bind"

var defaultMountOptions = []string{"rbind"}
23 changes: 23 additions & 0 deletions snapshots/native/native_freebsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// +build freebsd

/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package native

const mountType = "nullfs"

var defaultMountOptions = []string{}

0 comments on commit b624486

Please sign in to comment.