Merge pull request #9718 from jsturtevant/transfer-service-windows
Add a default differ for Windows that matches the snapshotter when using transfer service
This commit is contained in:
commit
a896610da1
23
defaults/defaults_differ_windows.go
Normal file
23
defaults/defaults_differ_windows.go
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
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 defaults
|
||||||
|
|
||||||
|
const (
|
||||||
|
// DefaultDiffer will set the default differ for the platform.
|
||||||
|
// This differ should be compatible with the windows snapshotter.
|
||||||
|
DefaultDiffer = "windows"
|
||||||
|
)
|
@ -22,7 +22,6 @@ import (
|
|||||||
"github.com/containerd/containerd/v2/core/diff"
|
"github.com/containerd/containerd/v2/core/diff"
|
||||||
"github.com/containerd/containerd/v2/core/leases"
|
"github.com/containerd/containerd/v2/core/leases"
|
||||||
"github.com/containerd/containerd/v2/core/metadata"
|
"github.com/containerd/containerd/v2/core/metadata"
|
||||||
"github.com/containerd/containerd/v2/defaults"
|
|
||||||
"github.com/containerd/containerd/v2/pkg/imageverifier"
|
"github.com/containerd/containerd/v2/pkg/imageverifier"
|
||||||
"github.com/containerd/containerd/v2/pkg/transfer/local"
|
"github.com/containerd/containerd/v2/pkg/transfer/local"
|
||||||
"github.com/containerd/containerd/v2/pkg/unpack"
|
"github.com/containerd/containerd/v2/pkg/unpack"
|
||||||
@ -81,12 +80,7 @@ func init() {
|
|||||||
// If UnpackConfiguration is not defined, set the default.
|
// If UnpackConfiguration is not defined, set the default.
|
||||||
// If UnpackConfiguration is defined and empty, ignore.
|
// If UnpackConfiguration is defined and empty, ignore.
|
||||||
if config.UnpackConfiguration == nil {
|
if config.UnpackConfiguration == nil {
|
||||||
config.UnpackConfiguration = []unpackConfiguration{
|
config.UnpackConfiguration = defaultUnpackConfig()
|
||||||
{
|
|
||||||
Platform: platforms.Format(platforms.DefaultSpec()),
|
|
||||||
Snapshotter: defaults.DefaultSnapshotter,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for _, uc := range config.UnpackConfiguration {
|
for _, uc := range config.UnpackConfiguration {
|
||||||
p, err := platforms.Parse(uc.Platform)
|
p, err := platforms.Parse(uc.Platform)
|
||||||
@ -122,7 +116,7 @@ func init() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if applier != nil {
|
if applier != nil {
|
||||||
log.G(ic.Context).Warnf("multiple differs match for platform, set `differ` option to choose, skipping %q", name)
|
log.G(ic.Context).Warnf("multiple differs match for platform, set `differ` option to choose, skipping %q", plugin.Registration.ID)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
inst, err := plugin.Instance()
|
inst, err := plugin.Instance()
|
||||||
|
33
plugins/transfer/plugin_defaults_other.go
Normal file
33
plugins/transfer/plugin_defaults_other.go
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
//go:build !windows
|
||||||
|
|
||||||
|
/*
|
||||||
|
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 transfer
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/containerd/containerd/v2/defaults"
|
||||||
|
"github.com/containerd/platforms"
|
||||||
|
)
|
||||||
|
|
||||||
|
func defaultUnpackConfig() []unpackConfiguration {
|
||||||
|
return []unpackConfiguration{
|
||||||
|
{
|
||||||
|
Platform: platforms.Format(platforms.DefaultSpec()),
|
||||||
|
Snapshotter: defaults.DefaultSnapshotter,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
32
plugins/transfer/plugin_defaults_windows.go
Normal file
32
plugins/transfer/plugin_defaults_windows.go
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
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 transfer
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/containerd/containerd/v2/defaults"
|
||||||
|
"github.com/containerd/platforms"
|
||||||
|
)
|
||||||
|
|
||||||
|
func defaultUnpackConfig() []unpackConfiguration {
|
||||||
|
return []unpackConfiguration{
|
||||||
|
{
|
||||||
|
Platform: platforms.Format(platforms.DefaultSpec()),
|
||||||
|
Snapshotter: defaults.DefaultSnapshotter,
|
||||||
|
Differ: defaults.DefaultDiffer,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user