@@ -26,12 +26,11 @@ import (
2626 "github.com/containerd/containerd/identifiers"
2727 "github.com/containerd/containerd/mount"
2828 "github.com/containerd/containerd/namespaces"
29+ "github.com/containerd/containerd/oci"
2930 "github.com/containerd/typeurl/v2"
3031 "github.com/opencontainers/runtime-spec/specs-go"
3132)
3233
33- const configFilename = "config.json"
34-
3534// LoadBundle loads an existing bundle from disk
3635func LoadBundle (ctx context.Context , root , id string ) (* Bundle , error ) {
3736 ns , err := namespaces .NamespaceRequired (ctx )
@@ -107,9 +106,10 @@ func NewBundle(ctx context.Context, root, state, id string, spec typeurl.Any) (b
107106 }
108107 if spec := spec .GetValue (); spec != nil {
109108 // write the spec to the bundle
110- err = os .WriteFile (filepath .Join (b .Path , configFilename ), spec , 0666 )
109+ specPath := filepath .Join (b .Path , oci .ConfigFilename )
110+ err = os .WriteFile (specPath , spec , 0666 )
111111 if err != nil {
112- return nil , fmt .Errorf ("failed to write %s " , configFilename )
112+ return nil , fmt .Errorf ("failed to write bundle spec: %w " , err )
113113 }
114114 }
115115 return b , nil
0 commit comments