Skip to content

Commit d9474d2

Browse files
authored
Merge pull request #1001 from dcantah/remove-mergemaps-v2
Get rid of mergemaps functionality for v2 codepaths
2 parents c1d3621 + 442a9aa commit d9474d2

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

internal/uvm/create.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ import (
2323

2424
// Options are the set of options passed to Create() to create a utility vm.
2525
type Options struct {
26-
ID string // Identifier for the uvm. Defaults to generated GUID.
27-
Owner string // Specifies the owner. Defaults to executable name.
28-
AdditionHCSDocumentJSON string // Optional additional JSON to merge into the HCS document prior
26+
ID string // Identifier for the uvm. Defaults to generated GUID.
27+
Owner string // Specifies the owner. Defaults to executable name.
2928

3029
// MemorySizeInMB sets the UVM memory. If `0` will default to platform
3130
// default.
@@ -105,9 +104,7 @@ func verifyCloneUvmCreateOpts(templateOpts, cloneOpts *OptionsWCOW) bool {
105104
// Save the original values of the fields that we want to ignore and replace them with
106105
// the same values as that of the other object. So that we can simply use `==` operator.
107106
templateIDBackup := templateOpts.ID
108-
templateAdditionalJsonBackup := templateOpts.AdditionHCSDocumentJSON
109107
templateOpts.ID = cloneOpts.ID
110-
templateOpts.AdditionHCSDocumentJSON = cloneOpts.AdditionHCSDocumentJSON
111108

112109
// We can't use `==` operator on structs which include slices in them. So compare the
113110
// Layerfolders separately and then directly compare the Options struct.
@@ -119,7 +116,6 @@ func verifyCloneUvmCreateOpts(templateOpts, cloneOpts *OptionsWCOW) bool {
119116

120117
// set original values
121118
templateOpts.ID = templateIDBackup
122-
templateOpts.AdditionHCSDocumentJSON = templateAdditionalJsonBackup
123119
return result
124120
}
125121

internal/uvm/create_lcow.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"github.com/Microsoft/hcsshim/internal/gcs"
1818
"github.com/Microsoft/hcsshim/internal/log"
1919
"github.com/Microsoft/hcsshim/internal/logfields"
20-
"github.com/Microsoft/hcsshim/internal/mergemaps"
2120
"github.com/Microsoft/hcsshim/internal/oc"
2221
"github.com/Microsoft/hcsshim/internal/processorinfo"
2322
hcsschema "github.com/Microsoft/hcsshim/internal/schema2"
@@ -377,12 +376,7 @@ func CreateLCOW(ctx context.Context, opts *OptionsLCOW) (_ *UtilityVM, err error
377376
}
378377
}
379378

380-
fullDoc, err := mergemaps.MergeJSON(doc, ([]byte)(opts.AdditionHCSDocumentJSON))
381-
if err != nil {
382-
return nil, fmt.Errorf("failed to merge additional JSON '%s': %s", opts.AdditionHCSDocumentJSON, err)
383-
}
384-
385-
err = uvm.create(ctx, fullDoc)
379+
err = uvm.create(ctx, doc)
386380
if err != nil {
387381
return nil, fmt.Errorf("error while creating the compute system: %s", err)
388382
}

internal/uvm/create_wcow.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"github.com/Microsoft/hcsshim/internal/gcs"
1212
"github.com/Microsoft/hcsshim/internal/log"
1313
"github.com/Microsoft/hcsshim/internal/logfields"
14-
"github.com/Microsoft/hcsshim/internal/mergemaps"
1514
"github.com/Microsoft/hcsshim/internal/ncproxyttrpc"
1615
"github.com/Microsoft/hcsshim/internal/oc"
1716
"github.com/Microsoft/hcsshim/internal/processorinfo"
@@ -315,12 +314,7 @@ func CreateWCOW(ctx context.Context, opts *OptionsWCOW) (_ *UtilityVM, err error
315314
uvm.IsTemplate = true
316315
}
317316

318-
fullDoc, err := mergemaps.MergeJSON(doc, ([]byte)(opts.AdditionHCSDocumentJSON))
319-
if err != nil {
320-
return nil, fmt.Errorf("failed to merge additional JSON '%s': %s", opts.AdditionHCSDocumentJSON, err)
321-
}
322-
323-
err = uvm.create(ctx, fullDoc)
317+
err = uvm.create(ctx, doc)
324318
if err != nil {
325319
return nil, fmt.Errorf("error while creating the compute system: %s", err)
326320
}

0 commit comments

Comments
 (0)